Quantizes a 24-bit image to 8-bit pseudo-color.
n_colors (optional) An integer specifying the number of colors desired in the output pseudo-color image. This value must be greater than 0 and less than or equal to 256. (Default: !D.Table_Size)
Dither If set, Floyd-Steinberg dithering is used to quantize the 24-bit image.
Intleave A scalar string indicating the type of interleaving of 3D image arrays. This keyword can only be used when the input image is a 3D byte array. If Intleave is not specified, the default interleaving method corresponds to the minimum dimension of the array, where p is the minimum dimension.
Valid strings and the corresponding interleaving methods are:
'image'
The 3D image array arrangement is (x, y, p) for p image-interleaved images of x-by-y.
'row'
The 3D image array arrangement is (x, p, y) for p row-interleaved images of x-by-y.
'pixel'
The input array arrangement is (p, x, y) for p pixel-interleaved images of x-by-y.
NOTE: If the input image is an associative array, the interleaving method is found in the interleave field of the array.
Quiet Suppresses successive levels of error messages, depending on the integer value specified. This keyword accepts the same integer values used with the system variable !Quiet.
NOTE: The original 24-bit image cannot be reconstructed from the 8-bit quantized result.
Paul Heckbert. "Color Image Quantization for Frame Buffer Display", Siggraph `82 Proceedings, pp. 297-307.
NOTE: The filename used in this example is a UNIX specific filename, which must be modified for use on other platforms.
chautauqua = IMAGE_READ(GETENV('VNI_DIR') + $ '/image-1_0/data/chautauqua24.tiff'); Read in a 24-bit image-interleaved image. chautauqua_8bit = IMAGE_COLOR_QUANT(chautauqua, 256,) ; Convert the image to 8-bit pseudo-color. IMAGE_DISPLAY, chautauqua_8bit ; Display the 8-bit image.
The data used in the example comes from the red, green, and blue images of Boulder in the PV-WAVE
data
directory.
boulder_8bit = IMAGE_COLOR_QUANT(boulder, 256, /Loadcmap); Convert the image to 8-bit pseudo-color.
TV, boulder_8bit; Display the 8-bit image.