Create a gist now

Instantly share code, notes, and snippets.

Use pngcrush to batch reduce the size of a collection of PNG images
#!/bin/sh
# Reference:
# http://www.mactricksandtips.com/2012/02/installing-and-using-pngcrush-on-your-mac.html
for png in `find $1 -name "*.png"`;
do
echo "crushing $png"
pngcrush -rem allb -brute -reduce "$png" temp.png
mv -f temp.png $png
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment