Comment by k2xl
17 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?
17 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?
For image placeholders while the real image is loading. At 16 bytes, that can easily be just another attribute on an html img tag.
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).
These things are called Low-Quality Image Placeholders (LQIP) and frequently used for front-end performance engineering.