Bug in convert (IM 6.3.6) with PDF files

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
goodoldgames

Bug in convert (IM 6.3.6) with PDF files

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
goodoldgames

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

Post 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 ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

Try this command:
  • convert -colorspace rgb sample.pdf sample.png
goodoldgames

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

Post 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 ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
goodoldgames

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

Post 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 ?
goodoldgames

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

Post 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 ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
Post Reply