MATLAB: When reading an image, why is the map value blank

blank variablecolor mapcolormapcolour maperrorimreadMATLAB

Hi,
I am currently doing a project relating to image compression. And I'm trying to figure out a slight error, my code reads like this to read the image
[uploadedImage, map] = imread('Test.png');
But when i look at the variable uploadedImage it shows a 3-dimensional array. Which is fine, however the map variable has a value of [ ]. Can anyone tell me why this is happening?

Best Answer

This is common.
RGB images are r x c x 3 with an empty map
CMYK images (tiff only) are r x c x 4 with an empty map
RGBA images are sometimes r x c x 4 with an empty map, but are sometimes r x c x 3 with a third output that can indicate alpha
Grayscale images are r x c with an empty map. These have an implicit grayscale map.
Gray+alpha images are uncommon but are r x c x 2 with an empty map
Pseudocolor images are r x c with a nonempty map and can be converted to rgb with ind2rgb()