Incorrect color display with CMYK images

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
harrison

Incorrect color display with CMYK images

Post by harrison »

Found ImageMagick Display can't display CMYK colors correctly, see images created by Adobe Photoshop CS2, the dark blue color around the image is shown as green color.

Images are uploaded at: http://drop.io/8mqwjur
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Incorrect color display with CMYK images

Post by fmw42 »

if you add profiles to the display command before your image, then it converts to rgb and displays properly

display -profile <cmykprofile> -profile <rgbprofile> cmykimage
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Incorrect color display with CMYK images

Post by Drarakel »

And for those special test files, you probably only need:
display -profile <rgbprofile> cmykimage
(Or perhaps "display -colorspace RGB cmykimage". But that one won't be as good.)

Apart from that..
harrison wrote:the dark blue color around the image is shown as green color
Where is a "dark blue color" in the images? I only see a lot of green (also in the 'Adobe Photoshop display.png' screenshot).
harrison

Re: Incorrect color display with CMYK images

Post by harrison »

Sorry, should be the "the dark-green color around the image is shown wrongly as light-green color"

The CMYK images can be displayed correctly by Windows Picture and Fax Viewer also.

It seems ImageMagick has a bug to handle such CMYK image embedded with ICC profile.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Incorrect color display with CMYK images

Post by Drarakel »

I first thought that you were using partly Windows, partly Mac (or something). But now, it seems that you're only on Windows. You should have said that. :wink:
So, you're talking about 'IMDisplay', not 'display' - right? (These are different applications for different operating systems.)

If yes, then the described behaviour is not a bug. 'imdisplay' has to display the pictures as RGB - and probably does so by using something similar to "convert -colorspace RGB". That's only a rough conversion.
You will get the correct colors by using color profiles (with "convert") and feeding that result to imdisplay (or any other viewer). Your CMYK files already have embedded source color profiles. But you have to specify the destination color profile, e.g. a sRGB profile. ImageMagick (or ImageMagick's imdisplay) won't just assume some destination profile.
See also:
http://www.imagemagick.org/script/comma ... colorspace
http://www.imagemagick.org/Usage/formats/#color_profile

By the way: The Windows Picture Viewer (also the Microsoft Office Picture Manager) uses some color profiles per default, but not always in a correct manner. The conversion is usually better as with "-colorspace RGB". But with CMYK pictures, you won't get totally correct colors - as Windows uses some sort of hardcoded profiles there, and ignores the embedded profiles (at least on my Windows).
Post Reply