htop
htop copied to clipboard
Optimize images to reduce filesize
It's a small change, but I've losslessly compressed the htop logo to save half a kilobyte on every computer it's installed on.
Which program did you use to optimize the images?
The images were optimized using zopflipng a subproject of Google's zopfli
@anthonyryan1 I've heard of zopflipng, but I usually optimize PNG image using a combination of OptiPNG, Advdef (with "zopfli" compression level), and DeflOpt.
@Explorer09 Thanks for sharing your compression recommendations. I did take a look for comparison.
With this image in particular:
- OptiPNG couldn't outperform zopflipng with any combination
- Advdef was able to outperform zopflipng by 1 byte after 20,000 iterations
I couldn't find any information on which package provides DeflOpt to give that a fair test. What package is that a part of, or can you link me to a source repository I can compile it from for testing?
So far all I've saved in 1 byte, but if we can do better I'm more than open to doing so.
I did manage to squeeze out some extra bytes using https://github.com/fhanau/Efficient-Compression-Tool
I've amended the commit, and nothing I've run can seem to do better.
I am not sure the zopfli compression is widely supported. Did you test on - say - Android 4.4 or other ancient-but-still-widely-used browsers / OS?
People should still be able to browser the website and docs even if their employer has the typical update cycles of regional governments :).
I haven't tested this image, but I have been using it on other images since 2013 and never had an issue with Android 4.4 back when it was still widely used.
Zopfli doesn't introduce compatibility issues, it maintains compatibility with all deflate decoders at the expense of not being as good as some newer compression formats.
@fasterit Zopfli is an encoder only and it's compatible with any DEFLATE decoder, Zopfli is, as far as I can see, the most aggressive DEFLATE-compatible encoder on the internet. It's slow and it's meant for compressing "offline" content.
@anthonyryan1 DeflOpt is here (https://encode.su/threads/3257-Deflopt). It's a little tool for optimizing an already compressed stream, and it is meant to be used after a compression tool like zopflipng, to squeeze out a byte or two on the compressed file.
I can't comment about Efficient Compression Tool yet. But I would like to tell that some online image optimizers like TinyPNG is actually lossy optimizer and you should stay away from it unless you know what you are doing.
@anthonyryan1 I played around with the Efficient Compression Tool you mentioned, and I was able to squeeze a few more bytes for the htop icon and the screenshot picture.
$ ect -9 -keep --strict --allfilters --pal_sort=120 screenshot.png
Processed 1 file
Saved 4B out of 45.07KB (0.0087%)
$ DeflOpt.exe -b -d -c -k screenshot.png
Number of bytes saved: 2 (46,144 --> 46,142)
File rewritten.
Number of files processed : 1
Number of files rewritten : 1
Total number of bytes saved: 2
23,606,371 cycles.
$ ect -9 -keep --strict --allfilters --pal_sort=120 htop.png
Processed 1 file
Saved 487B out of 3.03KB (15.6945%)
After ECT, I can't squeeze more bytes on htop.png with DeflOpt. And here you go, the optimized pictures in a zip file
Amended to incorporate your further optimized images!