使用python将PNG转换为SVG [英] Convert PNG to SVG using python

查看:1699
本文介绍了使用python将PNG转换为SVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以仅使用纯python或wand之类的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?

更准确地说,我想将png转换为真实的矢量图形,我不想在svg内嵌入位图,我想转换为图形代码.

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

我知道Illustrator或Inkscape可以实现,但是我需要一个自动化的过程.

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

谢谢!

推荐答案

您将需要运行外部程序来进行图像跟踪.一个流行的程序是potrace.这就是Inkscape用于执行任务的东西.

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.

有一些python绑定:

There are some python bindings for it:

https://pypi.python.org/pypi/pypotrace

这篇关于使用python将PNG转换为SVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆