Skip to content

Instantly share code, notes, and snippets.

@idosela
Created May 15, 2012 18:23
Show Gist options
  • Save idosela/2703946 to your computer and use it in GitHub Desktop.
Save idosela/2703946 to your computer and use it in GitHub Desktop.
Convert svg to png file and optimize using pngcrush.
#!/bin/sh
#
# Require:
# sudo apt-get install librsvg2-bin
# sudo apt-get install pngcrush
#
# Usage:
# sh svg2png.sh input.svg output.png
rsvg-convert -o "$2" "$1"
pngcrush -q -reduce -brute "$2" "$2.crushed"
mv "$2.crushed" "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment