Remix.run Logo
k2xl 8 hours ago

Thanks for sharing. I didn’t even know this type of thing had multiple algorithms.

Can you share what are the reasons someone may want to compress and image to 16 bytes?

montroser 7 hours ago | parent | next [-]

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).

lifthrasiir 7 hours ago | parent | prev [-]

These things are called Low-Quality Image Placeholders (LQIP) and frequently used for front-end performance engineering.