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
ind2rgb Convert indexed image to RGB image
label2rgb Convert label matrix into RGB image
demosaic Convert Bayer pattern encoded image to truecolor image
imquantize Quantize image using specified quantization levels and output values
multithresh Multilevel image thresholds using Otsu's method
im2bw Convert image to binary image, based on threshold
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
Was this topic helpful?