color problem while converting PDF -> JPG

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
sergiiiiiii

color problem while converting PDF -> JPG

Post by sergiiiiiii »

It seems to have a problem with the flattering of a PDF with transparency.

Here's the command line used to convert the PDF :
convert -colorspace RGB test.pdf[0] test.jpg

The result image :
Image

The result image from Acrobat (the good one) :
Image

Do I use ImageMagick badly ?

Thanks
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: color problem while converting PDF -> JPG

Post by Drarakel »

Getting correct colors from PDFs can be a difficult task sometimes - as this depends more on Ghostscript (not so much on ImageMagick).
Can you upload your PDF?
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: color problem while converting PDF -> JPG

Post by Drarakel »

First: You probably have to update Ghostscript. I'm using current versions (Ghostscript 8.71, ImageMagick 6.6.1-5) and have better results/colors (with a simple "convert -density 300 test.pdf[0] output.png" command):
http://www.imagebanana.com/img/m84z7a2n ... dpi_im.png

But: There is still a difference to the Adobe output. (Adobe Reader shows that for me.) Sorry, I don't know what causes this..
One can see that the PDF has some transparency values in it - the 21 red squares go from fully opaque to fully transparent (1.0 to 0.0, with 0.05 steps; the 8th value seems to be off, it's 0.62 instead of 0.65 there). I can recreate the transparency with ImageMagick (without the PDF) and do get the same red tones as Adobe.. So I guess the Adobe output is the correct one.

ImageMagick has no fault here. You'll probably have to take this to the Ghostscript site if you want to resolve it.
sergiiiiiii

Re: color problem while converting PDF -> JPG

Post by sergiiiiiii »

I'll watch GhostScript for this problem.

Thanks.
Post Reply