python图片转svg,使用python将PNG转换为SVG

Is there way to convert a png file into SVG file using only pure python or a python module such as wand?

To be more precise, I want to convert a png into a real vector graphics, I dont want to embed a bitmap inside the svg, I want to convert into graphics code.

I know this is possible with Illustrator or Inkscape, but I need an automated process.

Thank you !

解决方案

You will need to run an external program to do the image tracing. A popular program is potrace. It is what Inkscape uses to perform the task.

There are some python bindings for it:

Is there way to convert a png file into SVG file using only pure python or a python module such as wand? To be more precise, I want to convert a png into a real vector graphics, I dont want to embed a bitmap inside the svg, I want to convert into graphics code. I know this is possible with Illustrator or Inkscape, but I need an automated process. Thank you ! 解决方案 You will need to run an external program to do the image tracing. A popular program is potrace. It is what Inkscape uses to perform the task. There are some python bindings for it:
经验分享 程序员 微信小程序 职场和发展