如何将PNG图像转换为SVG?
当前回答
你可能想看看potrace。
其他回答
png是位图图像风格,SVG是支持位图的基于矢量的图形设计,因此它不会将图像转换为矢量,只是将图像嵌入到基于矢量的格式中。你可以使用免费的http://www.inkscape.org/来实现。它会嵌入它,但是它也有一个Live Trace之类的引擎,如果你愿意,它会尝试将它转换为路径(使用potrace)。查看adobe illustrator中的实时跟踪(商业)是一个例子:
http://graphicssoft.about.com/od/illustrator/ss/sflivetrace.htm
Easy
下载Inkscape(完全免费) 按照youtube上这段简短视频的说明去做
正如你将看到的,如果你想做很多其他聪明的。svg的东西,你也可以使用Inkscape。
一个非技术观察:我个人更喜欢这种方法,而不是“免费”网站提供的服务,因为除了通常需要注册之外,通过上传图像,在所有实际条件下,一个人是把图像交给网站所有者。
如果你使用的是Linux系统,imagemagick是完美的。即
convert somefile.png somefile.svg
这适用于大量不同的格式。
用于其他媒体,如视频和音频使用(ffmpeg) 我知道你清楚地说明png到svg,然而;这仍然与媒体有关。
ffmpeg -i somefile.mp3 somefile.ogg
如果你想浏览大量的文件,这是一个小技巧;一个循环使用基本的shell技巧。
for f in *.jpg; do convert $f ${f%jpg}png; done
这将删除jpg并添加png,这告诉转换你想要的。
有一个网站,你可以上传你的图片,并看到结果。
http://vectormagic.com/home
但是如果你想下载你的svg-image,你需要注册。 (注册即可免费获得2张图片)
I'm assuming that you wish to write software to do this. To do it naively you would just find lines and set the vectors. To do it intelligently, you attempt to fit shapes onto the drawing (model fitting). Additionally, you should attempt to ascertain bitmaped regions (regions you can't model through shames or applying textures. I would not recommend going this route as that it will take quite a bit of time and require a bit of graphics and computer vision knowledge. However, the output will much and scale much better than your original output.