Main Content

ind2rgb8

Convert indexed image to uint8 RGB image

Syntax

RGB = ind2rgb8(X,cmap)

Description

RGB = ind2rgb8(X,cmap) creates an RGB image of class uint8. X must be uint8, uint16, or double, and cmap must be a valid MATLAB® colormap.

Examples

% Convert the 'concord_ortho_e.tif' image to RGB.
[X, cmap] = imread('concord_ortho_e.tif');
RGB = ind2rgb8(X, cmap);
R = worldfileread('concord_ortho_e.tfw','planar',size(X));
mapshow(RGB, R);

Version History

Introduced before R2006a

See Also