Search code examples
pythonterminalinkscape

How to convert .PNG to .SVG in python or shell on Mac Big Sur (tried Inkscape Shell)?


I have a folder with a bunch of .PNG files that I would like to convert to .SVGs. I downloaded Inkscape and was able to manually convert a few of them, but soon I will need to convert a lot of .PNGs to .SVGs and it will not be feasible to do it manually.

I looked into Inkscape's shell feature and activated it as follows on the terminal on Mac Big Sur:

/Applications/Inkscape.app/Contents/MacOS/inkscape --shell

but then when I use this code:

--export-plain-svg /Users/Downloads/pictures/testpic.png

I get the following error:

Unable to find: --export-plain-svg /Users/Downloads/pictures/testpic.png
verbs_action: Invalid verb: --export-plain-svg /Users/Downloads/pictures/testpic.png

Solution

  • Try https://www.visioncortex.org/vtracer (https://github.com/visioncortex/vtracer) Opensource tool to convert color pngs to svg, Inkscape is not ok with colors AFAIK