-
Notifications
You must be signed in to change notification settings - Fork 7
PNG Compression Comparison (Icons)
Albert Huang edited this page Mar 23, 2017
·
1 revision
I recently had to convert an Inkscape SVG (an application icon) to multiple sizes of PNG. Those PNGs were also compressed losslessly to save space. I did some interesting benchmarks for lossless PNG compression, and here's what I found...
Reference PNGs are directly from Inkscape's PNG output. They were copied to ~/png-bench/ref
, and provide the basis of the command below.
-
setup:
for b in pingo zopflipng pngout advpng; do mkdir -p ~/png-bench/$b; cp ~/png-bench/ref/*.png ~/png-bench/$b; done
-
pingo (closed):
for p in ~/png-bench/pingo/*.png; do wine pingo -s4 "$p"; done
-
zopflipng (open, Apache):
for p in ~/png-bench/zopflipng/*.png; do ./zopflipng -y -m "$p" "$p"; done
-
pngout (closed):
for p in ~/png-bench/pngout/*.png; do ./pngout-static "$p"; done
-
advpng (open, GPLv2):
for p in ~/png-bench/advpng/*.png; do ./advpng -z -4 "$p"; done
albert@debian:~/png-bench$ du -sb ref pingo/ pngout/ zopflipng/ advpng/
153809 ref
126768 pingo/
130626 pngout/
126994 zopflipng/
132301 advpng/
- pingo (closed): saved 27041 bytes
- zopflipng (open, Apache): saved 26815 bytes (226 less than pingo)
- pngout (closed): saved 23183 bytes (3858 less than pingo)
- advpng (open, GPLv2): saved 21508 bytes (5533 less than pingo)
Same commands were run again to see if any more compression could be extracted. Interestingly, pingo was able to compress even further by shaving 36 more bytes...
153809 ref
126732 pingo/
130626 pngout/
126994 zopflipng/
132301 advpng/```
# Conclusion
This is NOT meant to be an exhaustive benchmark, but it does provide a rough insight to how PNG icon compression tools perform.