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.


Convert indexed image to RGB image


RGB = ind2rgb(X,cmap)


RGB = ind2rgb(X,cmap) converts the indexed image X and corresponding colormap cmap to RGB (truecolor) format.

Input Arguments

collapse all

Indexed image, specified as an m-by-n numeric matrix.

Color map associated with indexed image X, specified as a c-by-3 numeric array, where c is the number of colors.

Data Types: double

Output Arguments

collapse all

RGB image, returned as an m-by-n-by-3 numeric array.

See Also


Introduced before R2006a