The Image Processing Toolbox™ software defines four basic types of images, summarized in the following table. These image types determine the way MATLAB® interprets array elements as pixel intensity values.
All images in Image Processing Toolbox are assumed to have real, nonsparse, numeric or logical values unless otherwise specified.
Image data are stored as an m-by-n logical array. Array values of 0 and 1 are interpreted as black and white, respectively.
Image data are stored as an m-by-n numeric matrix whose elements are direct indices into a color map. Each row of the color map specifies the red, green, and blue components of a single color.
The colormap is a c-by-3 array of
(Also known as an intensity image)
Image data are stored as an m-by-n numeric array whose elements specify intensity values.
(Also known as an RGB image)
Image data are stored as an m-by-n-by-3 numeric array whose elements specify the intensity values of one of the three color channels. For RGB images, the three channels represent the red, green, and blue signals of the image.
There are other models, called color spaces, that describe
colors using three color channels. For these color spaces, the range
of each data type may differ from the range allowed by images in the
RGB color space. For example, pixel values in the L*a*b* color space
of data type