Re:QOI: Lossless Image Compression in O(n) Time
by t0rakka on Thursday November 25, 2021 @08:49PM
(#29346825)
I wrote a small test bench for my own uses as wanted to compare with different codecs and see how "raw compression" would work, how would QOI+ZSTD combination work and so on.
Here's example output..
image: 1502 x 1800 ( 10560 KB )
----------------------------------------------
encode(ms) decode(ms) size(KB)
----------------------------------------------
qoi: 31.2 21.6 2452
qoi+zstd: 46.7 19.3 1832
zstd: 47.4 8.7 2742
lz4: 14.1 3.0 4108
png: 92.4 18.0 2795
zpng: 24.1 13.3 1394
jpg: 2.7 1.8 517 <-- lossy
webp: 199.6 19.1 227 <-- lossy
Though I wouldn't be myself if I didn't have few nitpicks ;)
- You are mixing lossy and lossless compression in your rant. And you are mixing containers with formats. Thing about lossy compression is that it is by design stupidly slow and complex to produce smallest possible results which has best perceived quality. Compress once and trade time for both image and compression quality. Lossless is not that bad, although your simple solution is well, simple :)
- I feel like the benchmark suite is lacking. For better overview you probably should include libpng results with max compression level and lowest compression level. Lossless modes of AVIF and WEBP would be nice. (also could throw similar project to yours like https://github.com/catid/Zpng) Not saying the benchmark is bad, but IMHO doesn't paint the full picture. From quick test I got significantly better compression on libpng, ofc in expense of time, but you didn't configure libpng for speed either. So we have some results, but they are not really representative imho.
- I understand it is pet project, but don't forget about importance of image metadata, like colorspace and so on.
- Also keep in mind that compression is easy at the beginning, but the tricky part is how to squeeze more.
EDIT: formatting...