From 6fbbd160b0d4baaabf61b0a479680bd87bc1a38e Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Tue, 11 Oct 2016 16:15:01 +0200 Subject: [PATCH] Add example script that optimizes the size of badge images --- xonstat/batch/badges/optimize.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 xonstat/batch/badges/optimize.sh diff --git a/xonstat/batch/badges/optimize.sh b/xonstat/batch/badges/optimize.sh new file mode 100755 index 0000000..7d268b9 --- /dev/null +++ b/xonstat/batch/badges/optimize.sh @@ -0,0 +1,16 @@ +#!/bin/sh -e +# Optimize png files in output directory + +find output -name "*.png" | while read png; do + # Reduce colors to 8bit + # + pngquant --skip-if-larger --force --output "$png" 256 "$png" + + # Adjust bit depth, remove clutter + # + optipng -o 1 -strip all "$png" + + # Compress with zopfli + # + #advpng -z -4 "$png" +done -- 2.39.2