Page 1 of 1

CMYK conversion bug?

Posted: 2008-04-22T12:30:17-07:00
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

Re: CMYK conversion bug?

Posted: 2008-04-22T18:55:16-07:00
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.

Re: CMYK conversion bug?

Posted: 2008-04-23T00:09:53-07:00
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.

Re: CMYK conversion bug?

Posted: 2008-04-24T07:40:05-07:00
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'

Re: CMYK conversion bug?

Posted: 2008-04-24T23:32:31-07:00
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

Re: CMYK conversion bug?

Posted: 2008-04-24T23:34:30-07:00
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)

Re: CMYK conversion bug?

Posted: 2008-04-24T23:59:07-07:00
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

Re: CMYK conversion bug?

Posted: 2008-04-25T06:16:30-07:00
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).

Re: CMYK conversion bug?

Posted: 2008-05-05T00:15:44-07:00
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

Re: CMYK conversion bug?

Posted: 2008-05-08T00:30:53-07:00
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

Re: CMYK conversion bug?

Posted: 2008-05-08T06:42:51-07:00
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.

Re: CMYK conversion bug?

Posted: 2008-06-16T05:08:19-07:00
by masterbp
Any news on this issue?
When will it be fixed in windows?

Regards,

Benny Pedersen