Page 1 of 1

All black image bug.

Posted: 2019-12-05T15:42:13-07:00
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)

Re: All black image bug.

Posted: 2019-12-05T17:45:18-07:00
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.

Re: All black image bug.

Posted: 2019-12-06T10:13:41-07:00
by anon2501
Solved with MagickWand.