#!/bin/bash
#                       /usr/local/bin/png2svg
# https://crystalfaeries.net/posix/bin/png2svg
# celeste:crystalfaery PNG2SVG 2016-11-14 07:25:05+00:00
# Vectorize xkcd strips via ImageMagick and potrace
# http://www.commandlinefu.com/commands/view/17615/vectorize-xkcd-strips

while [ $# -ne 0 ]
do
	f="${1}";shift
	s=400; t=50; a=1.2;
	convert $f -resize ${s}% -threshold ${t}% bmp:- | \
	potrace -o ${f%.*}.svg -b svg -z black --fillcolor "#FFFFFF" --alphamax ${a}
done



syntax highlighted by Code2HTML, v. 0.9.1