Skip to content

Instantly share code, notes, and snippets.

@ivoarch
Forked from ykarikos/png2svg.sh
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivoarch/e451e4aaecf321949091 to your computer and use it in GitHub Desktop.
Save ivoarch/e451e4aaecf321949091 to your computer and use it in GitHub Desktop.
Convert png to svg using imagemagick and potrace
#!/bin/bash
if [ "$1" == "" ]; then
echo Usage: $0 pngfile
exit 0;
fi
FILE=`basename $1 .png`
if [ ! -e $FILE.png ]; then
echo $FILE.png does not exist
exit 1;
fi
convert $FILE.png $FILE.pnm
potrace -s -o $FILE.svg $FILE.pnm
rm $FILE.pnm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment