mardi 28 octobre 2014

JPG to SVG Conversion avoiding negative path values


Vote count:

0




Whenever I try to convert an jpg to svg (the jpg image is a floor plan), I always end up with negative values in the path element and get a transform attribute for the outermost group element. This ultimately messes up dynamically added points to the image.


I'm using inkscape for conversion (though I've tried some online converters to no avail) with x,y fixed to 0,0 then do "trace" the image with one of the single scan options selected such as edge detection.


Example:


I'll give an example to clarify the situation. Open up inkscape, embed jpg, jpg starts at 0,0 with artboard width and height equal to the jpg's, trace it, save as .svg. When I open up the svg file g has a transform="matrix()" attribute translating the y axis -259 units. So when I add a point to the svg with javascript, the point added is off by 259 units in y axis. I know I can handle this in javascript but don't want to write unnecessary code if this can be accomplished within svg. I also don't want to add the points in specific locations(same group with the path, or different group such and such transform attribute), since the structure might change in the future.


Is there a way to avoid negative values in the path element? Is there a conversion tool that can handle this? Or is my assumption is wrong about negative elements in the path causing the translation?



asked 3 mins ago







JPG to SVG Conversion avoiding negative path values

Aucun commentaire:

Enregistrer un commentaire