1

I am using imagemagick with rsvg-convert to convert svgs into jpegs. Everything works fine except when using gamma function to color correct images. It produces very different image than the one in browser.

Here is a preview of what the svg looks like in the browser. Preview in chrome/firefox

This is the output of imagemagick+rsvg-convert after compiling the same svg Converted image

See how the details are blown out in the output image. Here is a link to download the actual svg with images

I tested it on windows as well as on ubuntu and centos using the same version below (see the picture for IM version). enter image description here

Here are a couple commands i tried so far. Every command outputs the same blown out image.

  • convert test.svg test.jpg
  • Applied im evaluate function to single image - convert green_1186.jpg -evaluate pow 1 -evaluate multiply 1.54 -evaluate add 0 green_1186.c.jpg (produces blown out image)
  • Applied gamma to the image - convert green_1186.jpg -gamma 1,1.54,0 green_1186.c.jpg
  • convert green_1186.jpg -colorspace srgb -evaluate pow 1 -evaluate multiply 1.54 -evaluate add 0 green_1186.c.jpg
  • convert green_1186.jpg -fx "1.54*(pow(u,1))+0" green_1186.c.jpg
  • convert green_1186.jpg -auto-gamma -fx "1.54*(pow(u,1))+0" green_1186.c.jpg

I am not sure if the svg is wrong or i need to re-sample the values for IM or if the commands are wrong. I would really appreciate an expert thought on this matter.

Michael Mullany
  • 30,283
  • 6
  • 81
  • 105
Wdy Dev
  • 219
  • 2
  • 11
  • What version of RSVG and what version of Imagemagick. Try installing Inkscape and Imagemagick will use it. It might work better than RSVG. – fmw42 Jan 20 '19 at 19:25
  • Imagemagick 6.9.10.24 Q16 Mac OSX Sierra gives error messages when trying to read your SVG file with Imagemagick internal MSVG renderer and with Inkscape. So I suspect something is corrupt in your file or at least not according to specs. There are linked files which cannot be found. – fmw42 Jan 21 '19 at 20:57
  • Please post a minimal verifiable test file ... – Michael Mullany Jan 23 '19 at 04:21

0 Answers0