Converts an image with a colormap to a 24 bit RGB color image.
IMAGE24(win)
win |
- |
Optional. A Window containing the source image. Defaults to the current Window. |
An array, a 24 bit color image.
W1: density(spline2(ravel(gnorm(100,1),10), 8));rainbow()
W2: image24(W1)
W1 contains an image of a random surface shaded with the colors of the spectrum ranging from red to blue. W2 converts the image into a 24 bit color image.
W1: density(spline2(ravel(gnorm(100,1),10), 8));rainbow()
p = image24(W1)
Same as above, except the 24 bit image is copied to variable p.
Unlike standard images, a 24 bit image does not reference a separate colormap. Instead, each pixel of the image is comprised of a composite 24 bit RED, GREEN, BLUE value packed into a long integer (4 bytes). Use:
(r, g, b) = getrgb(image)
to retrieve the separate red, green and blue values from a composite 24 bit RGB image.
To construct a 24 bit composite image from separate RGB values:
image = rgbimage(r, g, b)
Because 24 bit color images do not require a colormap (the colors are implicit), the image can be saved and restored automatically with the correct colors.