All black image bug.

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
anon2501
Posts: 2
Joined: 2019-12-05T15:27:36-07:00
Authentication code: 1152

All black image bug.

Post by anon2501 »

Hello. I use PythonMagick in my project. When i convert SVG to JPG in command line like "convert x.svg x.jpg" it's ok. When i use PythonMagick i get all black image. I'm confused cuz i have that error only at 2 of 4 computers. They all have approximately similar libraries and OS ubuntu 16-18. Maybe someone can give me some tips what i do wrong. Here is my code.

tmp = tempfile.NamedTemporaryFile(delete=False)
blob = PythonMagick.Blob()
img = PythonMagick.Image('x.svg')
img.composite(img, 0, 0, PythonMagick.CompositeOperator.SrcOverCompositeOp)
img.write(blob, 'jpg')
tmp.write(blob.data)

User avatar
fmw42
Posts: 26273
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: All black image bug.

Post by fmw42 »

The issue is likely what SVG renderer is being used with Imagemagick on the various systems: IM's internal MSVG/XML, RSVG delegate, or Inkscape in order of increasing quality of result. Check your systems to see which are being used. I would guess that the bad results are coming from MSVG/XML and the good ones from RSVG or Inkscape. Also check the versions of the renderers if you are using RSVG or Inkscape. Also please identify your IM version's exact version number from

convert -version for IM 6 or magick -version from IM 7

Perhaps you need to upgrade Imagemagick as well.

anon2501
Posts: 2
Joined: 2019-12-05T15:27:36-07:00
Authentication code: 1152

Re: All black image bug.

Post by anon2501 »

Solved with MagickWand.

Post Reply