]> git.xonotic.org Git - xonotic/xonstat.git/blob - xonstat/batch/badges/optimize.sh
7d268b96306c756d55446f0ae102a6c411d6b74e
[xonotic/xonstat.git] / xonstat / batch / badges / optimize.sh
1 #!/bin/sh -e
2 # Optimize png files in output directory
3
4 find output -name "*.png" | while read png; do
5         # Reduce colors to 8bit
6         # <http://pngquant.org>
7         pngquant --skip-if-larger --force --output "$png" 256 "$png"
8
9         # Adjust bit depth, remove clutter
10         # <http://optipng.sourceforge.net>
11         optipng -o 1 -strip all "$png"
12
13         # Compress with zopfli
14         # <http://www.advancemame.it>
15         #advpng -z -4 "$png"
16 done