Biju
Biju

Reputation: 71

How to know the colormap of the image in matlab with no image processing toolbox?

How is it possible to know if an image is RGB, or Gray scale? (without image processing toolbox, i mean)

Upvotes: 0

Views: 86

Answers (1)

Shai
Shai

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

Related Questions