Get path geometry from image

自古美人都是妖i 提交于 2020-01-01 02:04:09

问题


If i have a logo, let's say done as a jpg or even a png. Any suggestion for how I can use that to define a path geometry? It would be really good if any suggestions could be provided for how i can do it in blend. Thanks


回答1:


Yes - I just tackled this problem for an LOB application two days ago.

I can't offer advice for Blend (though I've read that it can be done in Expression Designer). However, the best free tool I've found for this is called InkScape (http://www.inkscape.org).

It's opensource, and while it's intended primarily for editing SVG vector-based images, it has two key features that are useful to us WPFers:

  1. It can vectorize (i.e. "trace") raster images like bitmaps and jpegs, albeit not as well as one would hope, and
  2. It can export the vector image as XAML

You'll invariably find that you get better results from loading vector formats (like SVG, EMF, WMF, etc) and saving to XAML, than if you try to convert a bitmap/jpeg... simply because the process of vectorizing a raster image is error prone at best. So if you want to bring a company logo into XAML, try to get hold of the source files used to create the logo (perhaps done in Illustrator?) and import that into InkScape.

If this post is helpful, please be kind and give it a one-up.




回答2:


Jasema is a terrific tool right for the job.

Also, don't be shy to use Blend - it is somewhat more difficult to use (drawing shapes using pen) but it gets easier pretty fast. Switch on gridlines and optionally snap to them for good results.

What both Jasema and Blend are lacking, is the ability to easily create shapes with a central symmetry (like stars), so I took parts from Jasema and created my own tool (named Radius) that works a bit like a combination of a ruler and compass.




回答3:


I've solved my problem (export an image as XAML) using Microsoft Expression Design 4 (Free Version). I've downloaded from the link http://www.microsoft.com/en-us/download/confirmation.aspx?id=36180

As input, I had Adobe Ilustrator files.




回答4:


I have a good idea but you're png, bmp, jpg or other non vector file is must be very simple because we need best scan results and only use inkscape.

  1. Step: Drag and drop your file workspace on Inkscape, download free.

Tip: If your image is color white, Top menu item File->Document Properties-> heck Checkerboard Background and if you want uncheck Page border show.

  1. Step: Top menu item Path-> Trace Bitmap-> Mode check what you want property, i usually use color property and if your file is png check Remove Background then click OK, then wait again Ok button is Enable and close window.
  2. Step: Now you have a two layer, top layer vektor file and bottom layer your file. Select vector file and top menu item Edit-> XML Editor-> select svg path and look side column, d name propery in your data path value.

If you get complicated, you can look at the my gif.

But this method may not always work or may not give the desired results and draw your own shapes with the scape so you can get the path data from the XML editor.

Example, my first tests this like:

and after working on it some more:




回答5:


Adobe Illustrator / CorelDraw is perhaps the best tool out there for these operations that I have used. Personally, I prefer illustrator for on-screen media. These tracings can be exported into several formats such as EPS, SVG, AI, or even XAML (with this plugin)

Best of Luck !!!!




回答6:


I have recently been struggling with this myself. I had a set of icons done in data and needed to update them to look nicer.

I tried everything, manually typing them out. drawing in svg, converting svg to xaml.

in the end i found a list of open source icons from google material icons.

I then used this to convert from the svg files to data https://github.com/BerndK/SvgToXaml

It works well but not for the icons i drew myself.

I decided to place all the icons data i convert into an app i built myself that will give you the data and a preview of the icon. feel free to use and contribute. I will keep updating as much as i can. https://github.com/sgreaves1/XamlIcons



来源:https://stackoverflow.com/questions/983092/get-path-geometry-from-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!