convert svg to png loses color information in certain files

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
coregis

convert svg to png loses color information in certain files

Post by coregis »

I have a stack of 150 files to convert from svg to png. Most of the files convert just fine, but about 10 of them lose all color information after transforming.

I'm using mogrify +antialias -depth 8 -format png *.svg

but even trying mogrify -format png *.svg or convert Fig_106.svg Fig106.png will still lose all the colors in these 10 files.

This becomes all black in colored areas.
This converts fine.

I can convert to colored png fine with gimp, but I can't seem to switch off antialiasing.

Any clues as to what is happening?

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert svg to png loses color information in certain files

Post by magick »

Looks like you are using the ImageMagick internal SVG renderer which does not support style sheets. If the RSVG delegate is available when ImageMagick is built it will use it instead of the internal renderer and will produce the image you expect. Type
  • identify -list configure
and look for rsvg associated with the DELEGATES tag.
Post Reply