minify_png

This script will minify the *.png files in the given directory ($PWD if not given) and its subdirectories.

This script will invoke optipng and/or oxipng; therefore install optipng and/or oxipng.

If you are using macOS you might want to use ImageOptim instead of using this script.

It is advisable to minimize image files before adding them to a Git repository.

Minimizing image files during a build is usually bad idea unless the build generates images files.

Also, you might want to add a hash to the minified image file before adding it to a Git repository.

Usage

$ scripts/web/minify_png.sh
$ scripts/web/minify_png.sh dist

Prerequisites