False Grayscale detection for CMYK image

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
Roman80
Posts: 25
Joined: 2017-08-03T21:26:15-07:00
Authentication code: 1151

False Grayscale detection for CMYK image

Post by Roman80 »

Hello,

i tested a CMYK image with 7.0.6-4 version of IM under Windows.
A RGB color image was detected as 24 bit RGB, the same image but with CMYK colorspace is detected as Grayscale.

I could narrow down the problem to

SetImageGray() -> IdentifyImageGray() -> IsPixelGray() -> this function should return false => UndefinedType.

Regards
Roman
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: False Grayscale detection for CMYK image

Post by fmw42 »

Probably best if you upload an example image to some free image hosting service that won't change the format and put the URL here.
Roman80
Posts: 25
Joined: 2017-08-03T21:26:15-07:00
Authentication code: 1151

Re: False Grayscale detection for CMYK image

Post by Roman80 »

Which free image hosting service could you recommend?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: False Grayscale detection for CMYK image

Post by fmw42 »

I use dropbox.com, but I am sure there are others.
Roman80
Posts: 25
Joined: 2017-08-03T21:26:15-07:00
Authentication code: 1151

Re: False Grayscale detection for CMYK image

Post by Roman80 »

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: False Grayscale detection for CMYK image

Post by snibgo »

You have uploaded two identical files, both encoded as sRGB.
snibgo's IM pages: im.snibgo.com
Roman80
Posts: 25
Joined: 2017-08-03T21:26:15-07:00
Authentication code: 1151

Re: False Grayscale detection for CMYK image

Post by Roman80 »

snibgo wrote: 2017-08-04T06:44:08-07:00 You have uploaded two identical files, both encoded as sRGB.
No, they are not identical. Have a look at the comparison: https://www.dropbox.com/s/qddet5vqwtgr9 ... e.jpg?dl=0
The left image is the CMYK the right image is RGB.
You can see the difference for example by the color green, blue or cyan.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: False Grayscale detection for CMYK image

Post by snibgo »

My mistake. I downloaded the same file twice. Sorry.

In v7.0.1-0, "magick identfy" on the CMYK file says:

Code: Select all

Image: c:downloads\cmyk_test_file.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 1024x768+0+0
  Resolution: 72x72
  Print size: 14.2222x10.6667
  Units: PixelsPerInch
  Type: ColorSeparation
  Endianess: Undefined
  Colorspace: CMYK
  Depth: 8-bit
  Channel depth:
    cyan: 8-bit
    magenta: 8-bit
    yellow: 8-bit
    black: 8-bit
  Channel statistics:
    Pixels: 786432
    Cyan:
      min: 0 (0)
      max: 255 (1)
{and so on}
In your v7, what says it is Grayscale?
snibgo's IM pages: im.snibgo.com
Roman80
Posts: 25
Joined: 2017-08-03T21:26:15-07:00
Authentication code: 1151

Re: False Grayscale detection for CMYK image

Post by Roman80 »

When you call SetImageGray() it returns as Grayscale, and this is wrong. I narrowed it down to the function IsPixelGray(). See my first post

Regards
Roman
Post Reply