This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Image Types in the Toolbox

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 Type

Interpretation

Binary Images

Image data are stored as an m-by-n logical array. Array values of 0 and 1 are interpreted as black and white, respectively.

Indexed Images

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.

  • For single or double arrays, integer values range from [1, p].

  • For logical, uint8, or uint16 arrays, values range from [0, p-1].

The colormap is a c-by-3 array of class double.

Grayscale Images

(Also known as an intensity image)

Image data are stored as an m-by-n numeric array whose elements specify intensity values.

  • For single or double arrays, values range from [0, 1].

  • For uint8 arrays, values range from [0,255].

  • For uint16, values range from [0, 65535].

  • For int16, values range from [-32768, 32767].

Truecolor Images

(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.

  • For single or double arrays, RGB values range from [0, 1].

  • For uint8 arrays, RGB values range from [0,255].

  • For uint16, RGB values range from [0, 65535].

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 double can be negative or greater than 1. For more information, see Understanding Color Spaces and Color Space Conversion.

Related Topics