Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article suggest you could use (among others): "OptiPNG + Pngcrush combo"

What is the benefit of using pngcrush in addition to optipng? I got exellent reults using optipng only.



PNG recompressors perform different optimization and try at different levels of hard, so the improvements coming from one compressor may be different (and combinable with) another's.

Furthermore, depending on agressivity they may change some encoding property of the PNG and make them easier (or harder) to recompress via other compressors.

The benefit of using both is that it often allows you to squeeze a few extra percentage point of compression. Ideally you should test all combinations of compressors (presence and sequence) but that tends to be a bit expensive, especially when you involve PNGOut as it takes a pretty long time to run.

FWIW, I just tried the following on a screen capture:

* OptiPNG alone

* PNGCrush then OptiPNG

* OptiPNG then PNGCrush

* Squash (which runs a sequence of PNGrush, OptiPNG and AdvPNG, it can also run PNGOut but I didn't install it)

The source file was 250K, the files that went through OptiPNG, PNGCrush+OptiPNG and OptiPNG+PNGCrush were compressed to 159K (with a slight edge for the one compressed via PNGCrush first: both Optis are 162997 bytes, while PNGCrush + OptiPNG is 162978) and the file compressed via PNGSquash is 144K (147249 bytes).


I've gotten the best results by far by first doing pngout, then optipng, then advpng - in that order!!

On some images each step cuts the file size by 10-15%.

Change the order and you'll get worse results.

Also pngout (and optipng) will convert 24bit PNGs to paletized PNGs if there are not a lot of colors. The often makes the file smaller - but not always. So I also suggest using the -c4 -c2 or -c6 options to pngout (as appropriate for the file) and checking if the file got smaller. But sure to pass -nc to optipng in that case.


I get best results with pngout

http://www.advsys.net/ken/util/pngout.htm




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: