Page 1 of 1

Stroking an SVG file

Posted: 2009-08-14T04:04:18-07:00
by praviarun
Hi All,
I am new to the Imagemagick api.. and so forgive me if this is a silly question...
I am writing an effect which would apply stroke for fonts...
So I read a png image using Image Magick and would like to convert this to a vector format (SVG) which is supported in image magick
as i have built magick with the autotrace library..

code...
Magick::Image im1;
im1.read("D:/Test/abc.png");
im1.write("D:/Test/abc.svg");
..................
My questions are as follows..
1)Can I get the path of this SVG data in memory without actually saving an SVG file in the hard disk
2)How do I apply stroke to this svg file using the C++ api

Thanks in advance
Praveen

Re: Stroking an SVG file

Posted: 2009-08-14T08:03:10-07:00
by fmw42
IM is not a good app for converting raster to vector

see http://www.imagemagick.org/Usage/formats/#vector

Re: Stroking an SVG file

Posted: 2009-08-16T20:03:06-07:00
by anthony
SVG is a text format -- extract it from that file!

See... http://www.imagemagick.org/Usage/transform/#edge_vector
I do exactly that so I can modify the results to get a clean outline of a bitmap shape.

Re: Stroking an SVG file

Posted: 2009-08-17T06:51:02-07:00
by praviarun
Hi,

Thanks for the help...

I have got it to work the way u say...but i still have to write an svg file and extract info from that..Is there no way I can get the entire svg information into memory without actually writing into a file...

Thanks
Praveen

Re: Stroking an SVG file

Posted: 2009-08-17T17:49:58-07:00
by anthony
Well... Not really.

IM draw (using the internal MSVG decoder) does have a method of outputing the draw statements as IM draw operations. This however is for debugging, it is stored internally but their is no way to access.

In any case IM is a raster image processor, not a vector processor, so really this is beyond its scope.