Page 1 of 1

Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-08T10:36:04-07:00
by goodoldgames
Hello,

I have installed the latest ImageMagick version 6.3.6-1 on my Windows XP (SP2) system, together with Ghostscript 8.60.

When I try to convert the following PDF file the resulting JPG image is not correct.

PDF file to convert (9 MB!)

The bogus result looks like this

Image

but I would expect an image like

Image

When I use an old ImageMagick version like 6.3.2, the result is perfect.

The same bug occured once on IM 6.3.3, but you fixed it and now it seems to be back.

I am using this convert command:

convert -profile ./cmyk.icc -profile ./rgb.icc -resize "300x300>" ./sample.pdf -colorspace RGB ./test.jpg

You can download the color-porfiles here, but you can also reproduce the bug without the profiles.

cmyk profile
rgb profile

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-08T11:08:19-07:00
by magick
We have a patch for the problem you reported in ImageMagick 6.3.6-2 Beta available sometime tomorrow. A release version will be available in about a week.

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-13T11:34:02-07:00
by goodoldgames
I just test IM 6.3.6-2 (beta) and the result looks much better now:

Image

When I convert the same PDF with the same command and the same Ghostscript version with the older ImageMagick 6.3.1-0 the result looks like:

Image

Can you fix the transparency problem shown above in IM 6.3.6, too ?

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-13T13:04:57-07:00
by magick
Try this command:
  • convert -colorspace rgb sample.pdf sample.png

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-14T03:02:44-07:00
by goodoldgames
The transparency is now OK, but the colors are wrong. I think I have to use profiles to get the correct colors but then the transparency is missing. Do you have an idea how to get transparency and correct colors ?

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-14T07:08:50-07:00
by magick
The problem is with Ghostscript. There does not seem to be a Ghostscript device that supports CMYKA. If you can identify one we'll investigate.

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-14T10:49:44-07:00
by goodoldgames
I have checked Ghostscript and tried to convert the PDF to a JPEG image using the "jpeg-device" of GS. I get a much better color result when I add the "-dUseCIEColor" parameter. When I remove this parameter, the colors are like in IM.

Can ImageMagick use this parameter, too ?

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-17T10:44:22-07:00
by goodoldgames
Is their a way to use the GS parameter "-dUseCIEColor" when converting PDFs with ImageMagick ? Which GS device is IM using to convert PDFs to JPEG ?

Re: Bug in convert (IM 6.3.6) with PDF files

Posted: 2007-10-17T11:38:50-07:00
by magick
ImageMagick automatically sets the UseCIEColor definition if it detects a CMYK PDF. It uses the Ghostscript device defined by the ps:cmyk tag in the delegates.xml configuration file. In most cases it uses the PAM device. It would be ideal if Ghostscript had one device that supports 8 & 16 bit RGB, RGBA, CMYK, and CMYKA colorspaces but alas there is none.