Skip to content

Instantly share code, notes, and snippets.

@t-richards
Last active July 31, 2017 20:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t-richards/9190609 to your computer and use it in GitHub Desktop.
Save t-richards/9190609 to your computer and use it in GitHub Desktop.
Wrapper for pngcrush: removes almost all chunks, overwrites original file.
#!/usr/bin/env bash
if [ $# -eq 0 ]
then
echo "Usage: crush <pngfile(s)>"
exit
fi
for img in "$@"
do
pngcrush -force -rem allb -reduce -brute "$img" "${img%*.}crush.png"
mv "${img%*.}crush.png" "$img"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment