Reputation: 71
How is it possible to know if an image is RGB, or Gray scale? (without image processing toolbox, i mean)
Upvotes: 0
Views: 86
Reputation: 114796
When you read an image file, try and read its colormap
[I xmap] = imread( ... );
if xmap is not empty then the image is an indexed-RGB color image.
If size(I,3)>1
then you have a full RGB image (already in memory)
Otherwise you got yourself a grey-scale image.
Upvotes: 2