3 ms·
Things I have learned: optipng: png files are often not optimally small, even for what can be done by an automated process. Run optipng on the png's on your s
by justin_vanw 17y ago
Things I have learned:
optipng: png files are often not optimally small, even for what can be done by an automated process. Run optipng on the png's on your site, you'll be suprised.
example (compare before and after idat sizes):
find /usr/share/gnome -iname .png -print0|xargs -0 optipng -o7 -simulate
advancecomp: a zlib implementation that tries harder to compress, but with output that is still totally compatible.
use like: advpng -z -4 $file
advpng should only be used after* optipng, since optipng won't want to save the file if it is larger, even if the idat is smaller. since optipng can only use the regular zlib, the smallest files come from optimizing the idat, then optimizing the compression.
Just going through a regular debian desktop install, you will see png files that shrink over by over 90%. This is, of course, a lossless operation.
- woadwarrior01 17y agoHow does this compare to pngcrush ? I run pngcrush with "-rem alla -reduce -brute" flags.
- justin_vanw 17y agoI don't know. I think optipng is basically optimal for what it does. If you use the -o7 flag, I believe it uses every available combination of settings that a png file can have, as well as using the minimal color space. However, what would be really cool is something which would dither down, based on some of the research that is going on in that field. I saw a java applet once that could dither almost anything to 256 colors with barely any noticeable degradation. For something like the iphone, or any other memory limited/bandwidth limited device this would be awesome.