goofyahhbingus
1 year ago
Well, in my tests I've gotten the opposite results, WEBPs being consistently smaller than PNGs. That's quite strange... Could you give me more info on how you compress PNGs? I'm rather curious about it!
goofyahhbingus
1 year ago
Oh also some context on my workflow: I save images as PNG, compress them using Minuimus.pl, then I convert them to WEBP using libwebp (command being: cwebp -q 100 -lossless "[file]").
skullmund
1 year ago
i run optipng pngout and deflopt, theyre all lossless and pretty fast, makes for a small image already. then to shave off a few more bytes i run my own code which (somewhat brute-force) tries to find even better filter combinations / palette order / bit depth (8 might compress better than lower numbers, strange but true) and deflate with zopfli. i'll release it eventually but right now it only "works on my machine"
goofyahhbingus
1 year ago
Oh nice, that's interesting. If I'm not mistaken Minuimus.pl internally uses pngout and optipng only. I'll have to check deflopt and zopfli now! And I can't wait for your code release, hoping it'll be open sorce! :))))
skullmund
1 year ago
i just downloaded libwebp and have to say, webp compresses a lot better now than im used to. some are actually smaller as webps now but the differences are only about 1-5% either way
skullmund
1 year ago
i quickly tested 5 files: png is 109.742 bytes total and webp 108.946 although 3 out of 5 files are smaller as pngs. but tbfh the webp compression is nicer and faster
skullmund
1 year ago
also tried jxl with the same 5 images and while it performs best on 3/5 images leaving 1/5 for png and 1/5 for webp, it actually has the highest total size because it messes up on the largest image (116.765). so from my quick test they all perform well and theres no clear winner
goofyahhbingus
1 year ago
I've also done a few tests myself using your method, and I did get a few PNGs that were better compressed than WEBPs. Maybe it's the way the images' pixels themselves are structured that decides it? Compression sure works in mysterious ways... :)))
skullmund
1 year ago
idk about the other formats but png applies filters to image rows before compressing with zlib. both steps are non-deterministic to get the optimal result, which is both the fun and the pain of png. heres a simple explanation if youre interested: https://www.youtube.com/watch?v=EFUYNoFRHQI
He would cause unspeakable havoc. (> @_@)>