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?
Identify -verbose thinks thinks file is in Gray colorspace
Re: Identify -verbose thinks thinks file is in Gray colorspa
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Identify -verbose thinks thinks file is in Gray colorspa
try
Code: Select all
identify -quiet -ping -format "%[type]" cover_front.jpg