converts an RGB image to an indexed image
[IndexImage ColorMap] = RGB2Ind(RGB);
3D image of type uint8, uint16, uint32 or double
2D matrix with the same number of rows and columns as RGB
matrix with three columns and as many rows as RGB contains pixels. Note that this parameter is compulsory.
This function converts an RGB image to an indexed image and has the same effect as rgb2ind in previous versions.
RGB = rand(3, 3, 3) // generate random image [IndexedImage, ColorMap] = RGB2Ind(RGB) // RGB is converted to an indexed image FigureHandle = ShowImage(IndexedImage, 'Example', ColorMap); // IndexedImage is displayed | ![]() | ![]() |