Converts color images or colormaps to grayscale
GrayImg = im2gray(RGBImg)
GrayImg = im2gray(index, map)
GrayMap = im2gray(RGBColormap)
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.
http://siptoolbox.sf.net