Page 1 of 1

Identify -verbose thinks thinks file is in Gray colorspace

Posted: 2013-11-05T13:17:51-07:00
by jmcnevin
Hi all. I'm having a strange issue trying to determine the colorspace of an image.

Given the following command:

identify -quiet -ping -format "%[colorspace]" cover_front.jpg
"sRGB" is returned.

But, if I use -verbose:

Image: cover_front.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 1500x2400+0+0
Units: Undefined
Type: Grayscale
Endianess: Undefined
Colorspace: Gray
...

Now, this only seems to happen if the JPEG in question just doesn't happen to contain any color.

This is happening with IM 6.8.7-0. The file I'm using can be found here: https://www.dropbox.com/s/eofm1jzgjvc8l ... _front.jpg.

Am I doing something wrong here?

Re: Identify -verbose thinks thinks file is in Gray colorspa

Posted: 2013-11-05T13:32:03-07:00
by magick
JPEG encodes the colorspace. For your image, it returns JCS_RGB rather than JCS_GRAYSCALE. With -verbose, ImageMagick analyzes the image and determines its actually grayscale rather than sRGB.

Re: Identify -verbose thinks thinks file is in Gray colorspa

Posted: 2013-11-05T13:46:02-07:00
by fmw42
try

Code: Select all

identify -quiet -ping -format "%[type]" cover_front.jpg