5 comments

[ 2.7 ms ] story [ 22.8 ms ] thread
Does it vectorize bitmaps from the Enhanced Metafile?
No, and it doesn't even handle bitmap blobs yet.

The other big missing parts are clipping and emf+ records as a whole.

However, I am not sure it's a good idea to vectorize a bitmap.

Whether it matters depends on the use case of course.

If the bitmap is not vectorized it can't be styled with CSS. It also means that the resulting SVG contains arbitrary data from the source or edited as text.

Anyway, years ago when I was dealing with WMF in a vector context, not SVG, embedded bitmaps made the imported objects mostly worthless. Years before that, I would use Corel Draw to vectorize bitmaps and it worked remarkably well for ordinary cases.

The trick here is for "ordinary cases" ^^.

Vectorizing bitmap might not be trivial and results in crappy or huge (in size) outputs.

As far as I can, I would like to keep this conversion library as simple as possible. Ideally it should be a simple translation between EMF records and SVG with exceptions only where there is no direct mapping. Bitmap blobs, when supported, will be converted to png and embedded inside the svg.

However nothing forbids you from adding a post treatment on the generated svg to handle bitmap/png.

The day I will come back to my initial motivation for this lib (converting visio stencils to svg, including emf blobs), It's probably what I would do if I need to.

That makes sense. I have been curious about what would generate enough WMF files to justify writing a converter since I saw the post.

It might be useful to include why the software was written in the readme. It could improve discovery for people dealing with Visio.