load clown 
x=ind2gray(X,map);
clf;
imshow(x,64), title('original Image');

 [nr,nc]=size(x);
disp('press a key')
pause
bw=edge(x,'sobel');
%subplot(1,2,1),imshow(x,64), title('original Image');
imshow(bw,2), title('Edges using Sobel ');
disp('press a key')
pause
bw=edge(x,'robert');
%subplot(1,2,1),imshow(x,64), title('original Image');
 imshow(bw,2), title('Edges using Roberts');
disp('press a key')
pause
bw=edge(x,'prewitt');
%subplot(1,2,1),imshow(x,64), title('original Image');
 imshow(bw,2), title('Edges using Prewitt ');
disp('press a key')
pause
bw=edge(x,'marr-hildreth');
%subplot(1,2,1),imshow(x,64), title('original Image');
 imshow(bw,2), title('Edges using Marr-Hildreth ');
disp('press a key')
pause

clear
clf
% Color image processing
load trees
yiq=rgb2ntsc(map);
[y,i,q]=ind2rgb(X,yiq);
figure
subplot(2,2,2), imshow(y), title('Luminance');
subplot(2,2,3), imshow(i), title('Hue');
subplot(2,2,4), imshow(q), title('Saturation');
subplot(2,2,1), imshow(X,map), title('Original');
clf;
disp('press a key')
pause
hsv=rgb2hsv(map);
[h,s,v]=ind2rgb(X,hsv);
subplot(2,2,2), imshow(h), title('Luminance');
subplot(2,2,3), imshow(s), title('saturation');
subplot(2,2,4), imshow(v), title('value');
clf
disp('press a key')
pause
imshow(X,map), title('Original');