Name

Ind2RGB — converts an indexed image to RGB

Calling Sequence

RGB = Ind2RGB(IndexImage, ColorMap);

RGB = Ind2RGB(IndexImage, ColorMap, BackGroundColor);

Parameters

IndexImage

2D matrix of type uint8, uint16, uint32 or double. If IndexImage is of type double, all elements must be integer numbers >= 0.

ColorMap

matrix of type uint8, uint16, uint32 or double with three columns

BackGroundColor

vector with three columns, can be of type uint8, uint16, uint32 or double. If BackGround is of type double, all elements must be between zero and one. This parameter is optional. The default background color is white.

Description

This function converts an indexed image to an RGB image. All pixels that have values > 1 are mapped to a row of the color map. All zero valued pixels are mapped to the background color.

Examples

IndexImage = matrix(1 : 256, [16 16]);

ColorMap = jetcolormap(256);

RGB = Ind2RGB(IndexImage, ColorMap);

WriteImage(RGB, 'test.png');

See also

RGB2Ind, ShowImage, ShowColorImage, DrawBoundingBoxes