Get path geometry from image

Irwin picture Irwin · Jun 11, 2009 · Viewed 20.8k times · Source

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

Answer

Mark picture Mark · Jun 11, 2009

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.