Skip to content

Instantly share code, notes, and snippets.

@johnantoni
Created August 15, 2011 22:07
Show Gist options
  • Select an option

  • Save johnantoni/1147991 to your computer and use it in GitHub Desktop.

Select an option

Save johnantoni/1147991 to your computer and use it in GitHub Desktop.
pngcrush directory script
#!/bin/sh
for png in `find $1 -name "*.png"`;
do
echo "crushing $png"
pngcrush -brute "$png" temp.png
mv -f temp.png $png
done;
@johnantoni

Copy link
Copy Markdown
Author

install pngcrush with brew http://mxcl.github.com/homebrew/ via....

brew install pngcrush

then with this bash script compress an entire directory via....

./crush.sh media/img

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment