Remix.run Logo
montroser 7 hours ago

For image placeholders while the real image is loading. At 16 bytes, that can easily be just another attribute on an html img tag.

Dwedit 5 hours ago | parent [-]

I've seen the alternative where you make a tiny JPEG file (discarding the huffman and quantization tables), and use that as the placeholder. Just glue the header and tables back on, and let the browser handle JPEG decoding and stretching. It's not as small as 16 bytes, but the code for handling it is fast and simple.

The trick of using common huffman and quantization tables for multiple images has been done for a long time, notably Flash used it to make embedded JPEGs smaller (for when they were saved at the same quality level).