08-04-2023, 07:52 AM
A real can of worms.
Gimp has a plugin autotrace_p.py which traces an image producing a Gimp path. It uses a utility called (surprise) Autotrace. Gimp on its own can not output an SVG image but as a side effect, autotrace makes temporary SVG file that you can retrieve. Great for one at a time but no way I can see of using it in a batch for 1000's. The temp.svg file is overwritten each time.
You might as well go straight to using Autotrace on a command line. https://github.com/autotrace/autotrace/releases
One snag is format, autotrace uses bmp or ppm not png so you need a conversion first. For command line use ImageMagick http://www.imagemagick.org magick in.png in.ppm and using my boilerplate command for autotrace for a single file. You might need to change the color-count and dump the progress indicator.
Best for simple graphics
potrace is very similar to autotrace with this limitation The input is a bitmap, which means, a pixel-based image composed of the two colors black and white only. The bitmap is bmp or ppm
Another way is explore Inkscape command line which also uses autotrace. Never done that. Try their forum. https://inkscape.org/forums/
Other snags, Never very good with text.
Gimp has a plugin autotrace_p.py which traces an image producing a Gimp path. It uses a utility called (surprise) Autotrace. Gimp on its own can not output an SVG image but as a side effect, autotrace makes temporary SVG file that you can retrieve. Great for one at a time but no way I can see of using it in a batch for 1000's. The temp.svg file is overwritten each time.
You might as well go straight to using Autotrace on a command line. https://github.com/autotrace/autotrace/releases
One snag is format, autotrace uses bmp or ppm not png so you need a conversion first. For command line use ImageMagick http://www.imagemagick.org magick in.png in.ppm and using my boilerplate command for autotrace for a single file. You might need to change the color-count and dump the progress indicator.
Code:
autotrace -color-count 10 -corner-always-threshold 20 -corner-threshold 60 -output-format svg -output-file out.svg -report-progress in.ppm
Best for simple graphics
potrace is very similar to autotrace with this limitation The input is a bitmap, which means, a pixel-based image composed of the two colors black and white only. The bitmap is bmp or ppm
Another way is explore Inkscape command line which also uses autotrace. Never done that. Try their forum. https://inkscape.org/forums/
Other snags, Never very good with text.