Thumbnail generation with imagemagick doesn't render the correct colors
- by Bastien
Generating thumbnails of PDFs with imagemagick sometimes renders incorrect colors. We're using an old version of imagemagick (6.5.7-8, that's the version installed on the heroku servers). Here is the command we're currently using:
convert -size "725x1200>" -colorspace RGB -flatten -density 300 -quality 100 input.pdf output.jpg
I've tried using different colorspaces like sRGB,YIQ,.. but none of them are rendering the color correctly.
Using imagemagick-6.7.7-6 locally works so I've tried to bundle the 'convert' command within my application /bin directory, the command works but the result is still wrong, so it seems that the problem comes either from another imagemagick command used by 'convert' or from another library.
Here's an example of the outputs:
Correct output: http://i.stack.imgur.com/gf9eG.jpg
Wrong output: http://i.stack.imgur.com/imUeD.jpg
Strangely, with some pages of the same pdf the output is always correct. Any idea which library or command could be the issue, or if there is a proper set of options to pass to imagemagick to always get it right?
Thanks in advance for your help.