CMYK conversion bug?

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
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

CMYK conversion bug?

Post by masterbp »

Hi

I have been using Imagemagick on a server to create previews of CMYK images using this command line:

Code: Select all

"c:\Program Files\ImageMagick-6.4.0-Q16\"convert.exe -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill white -draw "color 0,0 reset" -resize 216x400 -quality 85 -strip -density 72x72 CMYK_bad.tif output_bad.jpg
The above command line converts to RGB, resizes and fills anything outside the clipping path with white. Everything works great with around 90% of the images, but some results in a blank white image. No errors are thrown or anything.


And example of an working and not working image can be downloaded here:
http://www.dortheogbenny.dk/CMYK_test.zip (19Mb)

I'm not sure it is a but or just me goofing around, but I can't understand why the command work with some images.

Any help is appreciated.

Regards,

Benny Pedersen
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: CMYK conversion bug?

Post by magick »

Command line order is important. Its possible your image already has a color profile so you need to strip it before you apply your Coated and sRGB profiles:
  • "c:\Program Files\ImageMagick-6.4.0-Q16\"convert.exe CMYK_bad.tif -strip -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill white -draw "color 0,0 reset" -resize 216x400 -quality 85 -strip -density 72x72 CMYK_bad.tif output_bad.jpg
It is also possible there is an incomplete clip path or perhaps ImageMagick is not rendering it properly.
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

Hi

I tried to reorder the command line a little bit:

Code: Select all

"c:\Program Files\ImageMagick-6.4.0-Q16\"convert.exe CMYK_bad.tif -strip -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill white -draw "color 0,0 reset" -resize 216x400 -quality 85 -density 72x72 output_bad.jpg
The result is the same - A blank image. I also checked the clipping path in Photoshop and it looks fine.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: CMYK conversion bug?

Post by magick »

We have a patch in ImageMagick 6.4.0-10 Beta (available sometime tomorrow) to fix the problem you reported. With 6.4.0-10 we get:
  • convert CMYK_bad.tif -strip -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill black -draw "color 0,0 reset" -resize 216x400 -quality 85 -density 72x72 output_bad.jpg
    convert: CMYK_bad.tif: unknown field with tag 34152 (0x8568) encountered. `TIFFReadDirectory'.
    convert: CMYK_bad.tif: unknown field with tag 40961 (0xa001) encountered. `TIFFReadCustomDirectory'.
    convert: CMYK_bad.tif: unknown field with tag 34152 (0x8568) encountered. `TIFFReadDirectory'.
    convert: no clip path defined `CMYK_bad.tif'
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

What does the warning/error
'convert: no clip path defined `CMYK_bad.tif'' mean?
The tiff does indeed hold an clipping path. I have tested the clipping path in Photoshop, The gimp and had it validated on http://validator.w3.org. It is valid SVG 1.1
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

I think i know the answer: It is the -strip command that removes the clipping path? Is the any way to remove all profiles but still keep the clipping path? (other than explicit remove each profile type, fx +profile icc)
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

Tried the command

Code: Select all

"c:\Program Files\ImageMagick-6.4.0-Q16\"convert.exe CMYK_bad.tif -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill white -draw "color 0,0 reset" -resize 216x400 -quality 85 -density 72x72 output_bad.jpg
and it still gives me a blank image. :(
What did the fix do?

Code: Select all

C:\PM_TEST>"c:\Program Files\ImageMagick-6.4.0-Q8\"convert.exe -version
Version: ImageMagick 6.4.0 04/23/08 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: CMYK conversion bug?

Post by magick »

Its probable that the Windows binary release does not have the required patch. We built ImageMagick 6.4.0-10 from source and ran this command:
  • convert CMYK_bad.tif -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill black -draw "color 0,0 reset" -resize 216x400 -quality 85 -density 72x72 output_bad.jpg
and got the expected results (a clock with a black background).
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

Hi

I have no development enviroment and cannot build from source. When will this patch be available in the windows binaries? I have tried ImageMagick-6.4.1-0-Q16-windows-dll.exe with no luck.

Regards,

Benny Pedersen
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

Hi

I finally managed to build a version from source using the instructions found here: http://www.imagemagick.org/script/insta ... hp#windows.

This command still doesn't work:

Code: Select all

convert CMYK_bad.tif -profile EuropeISOCoatedFOGRA27.icc -profile sRGB.icm +clip-path #1 -fill black -draw "color 0,0 reset" -resize 216x400 -quality 85 -density 72x72 output_bad.jpg
I only get a blank black image :(

Are you testing on windows?

Regards,

Benny
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: CMYK conversion bug?

Post by magick »

The problem is specific to Windows. The conversion works fine under Linux / Mac OS X. The problem may be in the LCMS delegate library. It will take some time to investigate.
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: CMYK conversion bug?

Post by masterbp »

Any news on this issue?
When will it be fixed in windows?

Regards,

Benny Pedersen
Post Reply