位图(jpg bmp等...)到SVG [英] Bitmap(jpg bmp etc...) to SVG

查看:155
本文介绍了位图(jpg bmp等...)到SVG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我的问题是在c#中将位图转换为SVG。我找到了类似这样的内容http://docs.opencv.org/2.4.2/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html但这并没有解决我的问题。我需要将例如带有白色背景的face转换为svg。 c#中有没有可以帮助我的代码?...我不想使用XML。首先,我想将方块或三角形或CIR从位图转换为SVG。



THX求助:)

Hi guys

my problem is to convert bitmap to SVG in c#. I found something like this http://docs.opencv.org/2.4.2/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html but this didn´t solve my problem. I need to convert for example a facewith white background from bitmap to svg. Are there any codes in c# which can help me?... I dont want to use XML. For beginning i would like to convert square or triangle or circ from bitmap to SVG.

THX for help :)

推荐答案

我们无法为您提供开箱即用的解决方案:这不是一个简单的过程,无论是形式还是形式。



问题是Bimap,JPG,PNG等文件是光栅图形:它们以红色,绿色和蓝色(或色调,亮度和阴影等)的各种色调存储固定的像素阵列,同时SVG文件是矢量图形 - 这意味着它们将图像存储为从(x1,y1)到(x2,y2)的绘制线和在这里画一个弧命令。

这两个是不兼容的。



这是可能的 - 这个过程被称为矢量化 - 但结果不太可能是完美的,如果你在谈论一个自然世界的对象(就像一张脸的照片)如果你没有付出相当大的努力,这是非常非常不可能的。



当然,我知道没有简单的插件代码可以让你这样做:但是这种方法看起来很有趣:http://asserttrue.blogspot.co.uk/2010/01/fast-conversion-of-bitmaps-to- svg.html# [ ^ ]



我认为你不会发现这是一个简单的任务:准备放一些重要的努力做到这一点!
We aren't going to be able to give you an "out of the box" solution: this is not a trivial process in any way, shape or form.

The problem is that Bimap, JPG, PNG, etc. files are raster graphics: they store a fixed array of pixels in various shades of red, green and blue (or hue, lightness and shade - whatever) while SVG files are vector graphics - which means they store images as "draw line from (x1, y1) to (x2, y2)" and "draw an arc here" commands.
And the two are not compatible.

It is possible to do - the process is called "vectorisation" - but the results are unlikely to be perfect, and if you are talking about a natural world object (like a photo of a face) it's very, very unlikely to work without some considerable effort on your part.

Certainly, there is no simple "plug in code" that I know of that will let you do that: but there is this approach which looks interesting: http://asserttrue.blogspot.co.uk/2010/01/fast-conversion-of-bitmaps-to-svg.html#[^]

I don't think you are going to find this a simple task: be prepared to put some significant effort into this!


SVG是一种基于xml的格式,如果你不想使用xml,你将会遇到很多困难:)



关于SO的以下文章或许可以说明您的要求:

SO:将图像(JPG,BMP,GIF)转换为SVG [ ^ ]
SVG being an xml-based format, if you do not want to use xml, you are going to have quite a hard time :)

The following post on SO could perhaps shed a light on your requirement:
SO: Convert Image (JPG,BMP,GIF) to SVG[^]


确定所以现在..我需要跟踪那个位图...然后矢量化它...并保存为SVG ...但我不能使用像inkscape这样的免费软件......我需要制作我自己的应用程序。
ok so now.. i need to trace that bitmap... and then vectorize it... and save as SVG... but i cant use freeware like inkscape... i need to make my own app.


这篇关于位图(jpg bmp等...)到SVG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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