#!/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