Skip to content

Instantly share code, notes, and snippets.

@andresdominguez
Forked from idosela/svg2png.sh
Created June 1, 2012 18:39
Show Gist options
  • Save andresdominguez/2854278 to your computer and use it in GitHub Desktop.
Save andresdominguez/2854278 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