IMAGE24

Purpose:

Converts an image with a colormap to a 24 bit RGB color image.

Syntax:

IMAGE24(win)

win

-

Optional. A Window containing the source image. Defaults to the current Window.

Returns:

An array, a 24 bit color image.

Example:

W1: density(spline2(ravel(gnorm(100,1),10), 8));rainbow()

W2: image24(W1)

 

image\image24pic.gif

 

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.

Example:

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.

Remarks:

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.

See Also:

DENSITY

GETCOLORMAP

GETRGB

IMINTERP

READIMAGE

RGBIMAGE

SPLINE2

INTERP2