Convert an image in red-green-blue (RGB) color space to an indexed image.
The input image rgb can be specified as a single matrix of size MxNx3, or as three separate variables, R, G, and B, its three color channels, red, green, and blue.
It outputs an indexed image x and a colormap map to interpret an image exactly the same as the input. No dithering or other form of color quantization is performed. The output class of the indexed image x can be uint8, uint16 or double, whichever is required to specify the number of unique colors in the image (which will be equal to the number of rows in map) in order
Multi-dimensional indexed images (of size MxNx3xK) are also supported, both via a single input (rgb) or its three color channels as separate variables.
See also: ind2rgb, rgb2hsv, rgb2ntsc.
Package: octave