Page 1 of 1

SVG, diagonal gradients not working

Posted: 2007-03-06T16:21:57-07:00
by penciledin
I've been working on converting svg's into several other formats using ImageMagick and so far, gradients have been pretty pig-headed.

Here's the SVG I created, with a diagonal gradient.

And here's the converted png, somehow with a vertical gradient:
Image

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="150px" height="150px" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<defs>
<linearGradient id="awesome" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:rgb(255,255,0);
stop-opacity:1"/>
<stop offset="100%" style="stop-color:rgb(255,0,0);
stop-opacity:1"/>
</linearGradient>
</defs>

<rect x="15" y="15" width="120" height="120" 
fill="url(#awesome)" />

</svg>
Any help would be appreciated.

P.S., This is one of a growing number of problems I've had with converting SVG's with gradients, and I posted this in hopes of starting with the smallest problem first. I'm new to these forums, and to keep with good etiquette, when I post new (but related) problems, should I post them in separate posts? Or as replies to a previous topic I created on the subject?

Many thanks.

Re: SVG, diagonal gradients not working

Posted: 2007-03-06T18:22:03-07:00
by magick
We have infa-structure for gradients but it is not complete yet. If you have a modern install of librsvg, ImageMagick will detect it at build time and convert all SVG using it instead of the built-in renderer.

Re: SVG, diagonal gradients not working

Posted: 2007-03-06T23:26:29-07:00
by anthony
Magick (cristy), is there some easy way to determine if the IM a user has, is using the librsvg library, or using the builtin svg->mvg conversion?

That is other than trying to convert a SVG with a gradient!
For example my own IM returns a diagonal gradient, so must be using librsvg (which is installed and I do built Im myself), but that is not simple test.

Re: SVG, diagonal gradients not working

Posted: 2007-03-07T08:10:47-07:00
by magick
For the ImageMagick 6.3.3.1 release, we'll associate librsvg with the SVG tag for the identify -list format command. If its not mentioned, ImageMagick is using the internal MVG renderer.