Navigation

Operators and Keywords

Function List:

C++ API

: img = gray2ind (I)
: img = gray2ind (I, n)
: img = gray2ind (BW)
: img = gray2ind (BW, n)
: [img, map] = gray2ind (…)

Convert a grayscale or binary intensity image to an indexed image.

The indexed image will consist of n different intensity values. If not given n defaults to 64 for grayscale images or 2 for binary black and white images.

The output img is of class uint8 if n is less than or equal to 256; Otherwise the return class is uint16.

See also: ind2gray, rgb2ind.

Package: octave