-
-
Save psd/442683 to your computer and use it in GitHub Desktop.
csvg — create SVG from a bitmap image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# convert bitmap to SVG, works well with pen and ink drawings .. | |
# | |
set -e | |
for file in "$@" | |
do | |
# lose suffix to grab file basename | |
suffix=$(echo "$file" | sed 's/.*\.//') | |
svg=$(basename "$file" ".$suffix").svg | |
pnm=/tmp/$$.pnm | |
# convert to pixmap using http://www.imagemagick.org | |
convert "$file" $pnm | |
# trace bitmap using http://potrace.sourceforge.net | |
potrace -s -o "$svg" $pnm | |
rm $pnm | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment