Page 1 of 1

ImageMagick SVG rasterizing problem

Posted: 2008-06-23T10:31:57-07:00
by Whiles
I have a problem rasterizing SVG images:
http://chembook.org/doc/Immagine:Hazard_E.svg
As you can see, rasterized version is different from the native SVG ( http://chembook.org/w/images/Hazard_E.svg ).
Why? It seems to not consider border bends.
I taken the image from http://upload.wikimedia.org/wikipedia/c ... zard_E.svg , and here ( http://wikimediafoundation.org/wiki/Image:Hazard_E.svg ) it works well.

Is this a ImageMagick bug?

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-23T11:54:17-07:00
by fmw42
Maybe my eyes are bad, but I don't see any differences on IM 6.4.1-10 Q16. What version of IM are you using?

Never mind, I see the difference when alternating the images in the display. The black area in the lower left is more rounded than in your http://chembook.org/doc/Immagine:Hazard_E.svg version.

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-23T13:48:56-07:00
by Whiles
fmw42 wrote:Maybe my eyes are bad, but I don't see any differences on IM 6.4.1-10 Q16. What version of IM are you using?

Never mind, I see the difference when alternating the images in the display. The black area in the lower left is more rounded than in your http://chembook.org/doc/Immagine:Hazard_E.svg version.
phpinfo(): http://chembook.org/w/phpinfo.php#module_imagick
ImageMagick version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-23T15:40:39-07:00
by Whiles
Ah, another thing: I installed the lastest version of ImageMagick on local and the problem is the same:
Image

But with firefox this SVG image is different (as you said the black area in the lower left is more rounded).
Why? :(

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-23T17:31:35-07:00
by anthony
Why is your rasterized image in SVG vector image format?
That does not make any sense!

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-24T01:36:39-07:00
by Whiles
anthony wrote:Why is your rasterized image in SVG vector image format?
That does not make any sense!
Why? What should I use? :?

I don't understand what you mean.

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-24T20:40:54-07:00
by anthony
SVG is a vector image format, saving IM rendered images in it is equivelent to saving it into a JPG or PNG format with a SVG wrapper around it. You are better off using such a format directly, rather than saving in back into a SVG.

See A Word about Vector Image formats
http://imagemagick.org/Usage/formats/#vector

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-27T11:40:04-07:00
by Whiles
anthony wrote:SVG is a vector image format, saving IM rendered images in it is equivelent to saving it into a JPG or PNG format with a SVG wrapper around it. You are better off using such a format directly, rather than saving in back into a SVG.

See A Word about Vector Image formats
http://imagemagick.org/Usage/formats/#vector
I want to use it on MediaWiki, do you know how mediawiki works?

If i write [[Image:lol.svg|5000px]] MediaWiki software will rasterize lol.svg to png and show it in the page without loss of quality.
If i use one png image the quality loss is very high.

So I need SVG and I can't wrap it around...

Re: ImageMagick SVG rasterizing problem

Posted: 2008-06-28T01:01:31-07:00
by anthony
Then IM is not for you. IM is designed as a raster image processor, not a vector processor. Once rasterized it will be like PNG, best at a specific scale or resolution.

When IM outputs to SVG or a vector it is basically a wrapper around the raster image it generated.

There are seom vector to vector processors, and I even look at a raster to vector program called "AutoTrace", which attempts to convert a raster i mage to SVG or similar format without too much pixelization. See http://imagemagick.org/Usage/transform/#edge_vector for an example of this, where I use it to generate a smooth line drawing of a raster shape.