How can I find out if a file is a real one channel grayscale image or if it is an RGB image with three identical channels?
This is what I get in both cases:
identify -format %r
DirectClassGray
identify -verbose
Type: Grayscale
Colorspace: Gray
identify -type
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: identify -type
See IM Examples, Comparing Images, Sorting Images by Image Content
http://www.imagemagick.org/Usage/compare/#type_general
It starts by determining measures on how 'greyscale' an image is, and then how 'black and white' it is.
http://www.imagemagick.org/Usage/compare/#type_general
It starts by determining measures on how 'greyscale' an image is, and then how 'black and white' it is.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: identify -type
No, the examples just help telling how 'grayscale' images are but not how they were stored in their source files.
The problem is:
There is a 100% grayscale image.
I need to find out if it was stored with just one channel
or if it was saved with 3 identical RGB channels.
Image Magick optimizes channel settings which works fine with encoding
since you can disable it with the -type flag.
I guess it also optimizes channel settings on decoding.
And that would make it impossible to find out the non optimized original color space
a file was saved with.
The problem is:
There is a 100% grayscale image.
I need to find out if it was stored with just one channel
or if it was saved with 3 identical RGB channels.
Image Magick optimizes channel settings which works fine with encoding
since you can disable it with the -type flag.
I guess it also optimizes channel settings on decoding.
And that would make it impossible to find out the non optimized original color space
a file was saved with.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: identify -type
There are a lot of things imposible to determine after IM reads it. It is the nature of a general image processor. Sorry. IM just can't do everything for every type, though it can try.
Even in IM examples I have to occasionally resort to an external tool for some information, such as how many frames in a GIF animation actually has local color tables. IM itself does not really care, and that is understandable. Look like it is the same with what you are after.
Prehaps there are some specialised utilities for that file type (which you never mentioned).
Even in IM examples I have to occasionally resort to an external tool for some information, such as how many frames in a GIF animation actually has local color tables. IM itself does not really care, and that is understandable. Look like it is the same with what you are after.
Prehaps there are some specialised utilities for that file type (which you never mentioned).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/