3 ms·
> if you throw lz4 or zstd on top of it, of it, it actually can beat png PNG is literally just "perform some simple filtering on the image data, then run that
by duskwuff 4y ago
> if you throw lz4 or zstd on top of it, of it, it actually can beat png
PNG is literally just "perform some simple filtering on the image data, then run that through zlib and wrap it with some metadata". It shouldn't come as any great surprise that you can outperform PNG with a newer stream compressor. You'd probably get even better results by using PNG's filters instead of QOI.
- nh2 4y ago> You'd probably get even better results by using PNG's filters instead of QOI Did anybody ever try this? It would be quite interesting and does not seem too difficult. The only thing I could find is https://github.com/catid/Zpng https://github.com/catid/Zpng which does not use the normal PNG filtering.
- mananaysiempre 4y agoLZ4[1] intentionally compresses worse than Deflate—where Deflate is LZ77 with Huffman in a bitstream, LZ4 is just LZ77 with a good choice of octet-aligned encoding. It’s “we’re saturating Gigabit Ethernet and have some compute left over” compression, not “we need to squeeze our backups as much as possible” compression. If filtering+LZ4 does better than Deflate, then you’ve chosen the filter well. Curiously, for some kinds of serialized binary data varints or even zero-packing[2] can be a good enough filter[3]. [1] https://lz4.github.io/lz4/ https://lz4.github.io/lz4/ [2] https://capnproto.org/encoding.html#packing https://capnproto.org/encoding.html#packing [3] https://news.ycombinator.com/item?id=24073752 https://news.ycombinator.com/item?id=24073752