Image Processing Toolbox™ supports binary, indexed, grayscale, and truecolor image types. In each image type, pixels are stored in different formats. For example, truecolors images represent a pixel as a triplet of red, green, and blue values, whereas grayscale image represent a pixel as a single intensity value. Pixels value can be stored in floating-point, signed and unsigned integers, or logical data types. Toolbox functions enable you to convert between the image types and data types.
|Convert grayscale or binary image to indexed image|
|Convert indexed image to grayscale image|
|Convert matrix to grayscale image|
|Convert RGB image or colormap to grayscale|
|Convert RGB image to indexed image|
|Convert indexed image to RGB image|
|Convert label matrix into RGB image|
|Convert Bayer pattern encoded image to truecolor image|
|Split multichannel image into its individual channels|
Image types determine how MATLAB® interprets data matrix elements as pixel intensity values. The toolbox supports binary, indexed, grayscale, and truecolor image types.
In a binary image, each pixel assumes one of only two discrete values: 1 or 0.
An indexed image consists of an array and a colormap matrix.
A grayscale image (also called gray-scale, gray scale, or gray-level) is a data matrix whose values represent intensities within some range.
A truecolor image is an image in which each pixel is specified by three values — one each for the red, blue, and green components of the pixel's color.
Certain image processing operations support only a subset of the image types. You can convert images between the image types to suit the operation.
You can convert image data between classes using functions that automatically rescale and offset the original data.
This example creates a simple truecolor image and then separates the color channels (planes).