IM2GRAY(1)

NAME
im2gray - converts RGB or indexed images, or RGB colormaps to grayscale.

SYNOPSIS
GrayImg = im2gray(RGBImg)
GrayImg = im2gray(index, map)
GrayMap = im2gray(RGBColormap)

PARAMETERS

RGBImg
    M x N x 3 truecolor image in any range.

RGBColormap
    M x 3 colormap in rgb colorspace.

index and map
    M x N indexed image and its M x 3 colormap.

GrayImg
    M x N intensity image.

GrayMap
    M x 3 colormap.

DESCRIPTION
Function im2gray converts RGB images, indexed images and RGB colormaps to grayscale. This is accomplished by converting these objects to YIQ colorspace, make the I and Q channels equal to zero, and finally converting back to RGB colorspace.

EXAMPLE
initial_dir = PWD;
chdir (SIPDIR + 'examples');
Img = imread('tru.jpg');
Img = im2gray(Img);
xbasc()
imshow(gs);
chdir(initial_dir);

AUTHORS
Ricardo Fabbri <rfabbri@if.sc.usp.br>

AVAILABILITY
The latest version of the Scilab Image Processing toolbox can be found at

    http://cyvision.if.sc.usp.br/~rfabbri/sip/

SEE ALSO
im2bw, rgb2ntsc