artursapek / mondrian

Web-based vector graphics editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import PNG

MagnaMike opened this issue · comments

Can you add the ability to import a png image so you draw a vector image based off of the png? For example I have a png, I import it to the background and draw vector shapes over top of it and then save the svg. The png isn't actually part of the final image, I just want to be able to 'trace' it. Does this make sense?

SVG does support embedding raster images. It's a good idea.

So it won't be too hard to implement?

You could add support for embedding of PNG files via drag & drop with something like this: https://gist.github.com/jarek-foksa/8613003

Thank you, but sorry, how do I use this?

@MagnaMike the gist just demonstrates how to use the DOM API in order to implement this functionality, it's not supposed to work out of the box (it's not even CoffeeScript).

Sorry all of this is going over my head, I don't have any real experience to speak of with this kind of stuff. I'll just ask this; is this functionality something you can/will add on in the future?

It could be done with drag & drop, with an upload field, with a url field...

The input isn't as important as the internal representation class that would have to be written for the <image> element. It will have to extend Monsvg like every other SVG element representation class (see the entire src/geometry directory). That's how Mondrian handles all SVG elements.