Skip to content

Instantly share code, notes, and snippets.

@dasgib
Created June 23, 2012 14:16
Show Gist options
  • Save dasgib/2978431 to your computer and use it in GitHub Desktop.
Save dasgib/2978431 to your computer and use it in GitHub Desktop.
Use Imagemagick to convert .SVG to .PNG
#!/bin/bash
if [ -z "$1" ] || [ -z "$3" ] || [ -z "$3" ]
then
echo "Syntax: svg2png <source.svg> <dest.png> <16x16> [<negate>]"
else
if [ -z "$4" ]
then
convert -background none -resize $3 -gravity center -extent $3 $1 $2
else
convert -background none -resize $3 -gravity center -negate -extent $3 $1 $2
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment