im2gray - Converts color images or colormaps to grayscale
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.
initial_dir = PWD;
chdir (SIPDIR + 'images');
Img = imread('tru.jpg');
Img = im2gray(Img);
xbasc()
imshow(Img);
chdir(initial_dir);
http://siptoolbox.sourceforge.net