SVG文件:如何在使用Inkscape将PNG文件转换为SVG文件后获取路径标记数据?

SVG文件:如何在使用Inkscape将PNG文件转换为SVG文件后获取路径标记数据?

问题描述:

我在问是否有工具将PNG文件转换为SVG文件,我可以在其中获取Path标记。我尝试过使用Inkscape,但是当我编辑SVG文件时,我找不到路径标记,只有二进制数据。

I'm asking if there would be a tool to convert a PNG file into a SVG file where I could get the Path markup. I have tried with Inkscape but when I edit the SVG file I can't find the path markup, there is only "binary" datas.

SVG文件路径标记示例:
https://www.w3.org/TR/SVG/paths .html #PathData

SVG file path markup example : https://www.w3.org/TR/SVG/paths.html#PathData

有人有想法吗?

将PNG文件转换为SVG文件是什么意思?听起来你可能只是将PNG放入SVG文件中。这不会自动将其转换为路径。它只是嵌入在SVG中的位图。它保持位图。

What do you mean by "convert a PNG file into a SVG file"? It sounds like you might just be putting your PNG into an SVG file. That doesn't automatically turn it into a path. It is just a bitmap embedded in an SVG. It stays a bitmap.

你想要的是将你的位图转换为矢量。该过程通常称为位图跟踪。 Inkscape具有这样做的功能。选择PNG并执行路径 - >跟踪位图...

What it sounds like you want, is to convert your bitmap to a vector. That process is commonly called a "bitmap trace". Inkscape has a feature to do that. Select the PNG and do a Path->Trace Bitmap...

它的工作原理取决于您的图像。徽标通常运作良好。照片通常不会。

How well it works will depend on your image. Logos generally work well. Photos usually don't.

完成跟踪后,保存SVG文件,然后就可以获取路径数据了。

Once you have done the trace, save the SVG file and you will be able to get the path data then.