DADiSP Worksheet Functions > Function Categories > Colors > GETRGB

 

GETRGB

Purpose:

Returns the separate RGB components of an image.

Syntax:

(r, g, b) = GETRGB(image)

image

-

An array. The input image.

r

-

An array, the output red values.

g

-

An array, the output green values.

b

-

An array, the output blue values.

Returns:

Up to three arrays.

Example:

W1: readimage(".\data\mandrill.bmp")

(r, g, b) = getrgb(w1);

g *= 1.2;

W2: rgbimage(r, g, b);

 

W2 contains a new RGB image formed by increasing the green component of W1 by 20%.

Remarks:

An RGB image consists of three separate components of red, green and blue values. Each RGB value ranges from 0.0 to 1.0.

 

See RGBIMAGE to create an image from separate RGB values.

 

See COLORTORGB to convert a color index into separate RGB values.

See Also:

COLORTORGB

GETCOLORMAP

IMAGE24

READIMAGE

READBMP

RGBIMAGE