Skip to content

Instantly share code, notes, and snippets.

@edenwaith
Created August 7, 2015 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edenwaith/1d1353a6d8efbabfa455 to your computer and use it in GitHub Desktop.
Save edenwaith/1d1353a6d8efbabfa455 to your computer and use it in GitHub Desktop.
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