This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Image Type Conversion

Convert between the image types, such as RGB (truecolor), binary, grayscale, and indexed.


gray2ind Convert grayscale or binary image to indexed image
ind2gray Convert indexed image to grayscale image
mat2gray Convert matrix to grayscale image
rgb2gray Convert RGB image or colormap to grayscale
rgb2ind Convert RGB image to indexed image
ind2rgb Convert indexed image to RGB image
label2rgb Convert label matrix into RGB image
demosaic Convert Bayer pattern encoded image to truecolor image
imbinarize Binarize image by thresholding
imquantize Quantize image using specified quantization levels and output values
multithresh Multilevel image thresholds using Otsu's method
adaptthresh Adaptive image threshold using local first-order statistics
otsuthresh Global histogram threshold using Otsu's method
graythresh Global image threshold using Otsu's method
grayslice Convert grayscale image to indexed image using multilevel thresholding
im2double Convert image to double precision
im2int16 Convert image to 16-bit signed integers
im2java2d Convert image to Java buffered image
im2single Convert image to single precision
im2uint16 Convert image to 16-bit unsigned integers
im2uint8 Convert image to 8-bit unsigned integers


Image Types in the Toolbox

The Image Processing Toolbox™ software supports four fundamental image types: binary, indexed, grayscale, and truecolor.

Convert Between Image Types

Convert between binary, indexed, grayscale, and truecolor image types.

Convert Between Image Classes

Convert image data between classes using functions that automatically rescale and offset the original data.

Was this topic helpful?