From 4bf8faa0b9a1ca7f6758301047f35966ce2725fc Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sun, 29 Nov 2020 02:22:51 +0100 Subject: [PATCH 1/2] fix svg conversion script --- vision/imagemagick.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vision/imagemagick.md b/vision/imagemagick.md index a4e9080..f0dd395 100644 --- a/vision/imagemagick.md +++ b/vision/imagemagick.md @@ -48,13 +48,11 @@ The 'fuzz' option tells the computer that 'close to white' is fine. You might w # Mass convert -This script converts all jpg and png files in a directory to svg. +This script converts all jpg files in a directory to svg. ``` -for i in *png *jpg -do for j in *$i -do convert $j -resize 2048 $(ls $j | sed s#.$i\$#.svg#) -done +for i in *jpg +do convert "$i" $(ls "$i" | sed s#jpg\$#svg#) done ``` From 733ba43e7086d282af90d7652a95bb6d55e6f710 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Fri, 5 Feb 2021 18:08:39 +0100 Subject: [PATCH 2/2] add imagemagick potrace info --- vision/imagemagick.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vision/imagemagick.md b/vision/imagemagick.md index f0dd395..ecdea50 100644 --- a/vision/imagemagick.md +++ b/vision/imagemagick.md @@ -56,6 +56,16 @@ do convert "$i" $(ls "$i" | sed s#jpg\$#svg#) done ``` +# SVG + +The above script has crappy results. +It's better to use potrace. + +``` +$convert input.jpg output.ppm +$potrace -s output.ppm -o svgout.svg +``` + # Writing Words [docs](https://www.imagemagick.org/Usage/text/)