
c = imread('pic1.jpg');
imshow(c);
axis('square');
disp('(1) Original picture. - Press enter ...')
pause;

cr = c; cr(:,:,2) = 0; cr(:,:,3) = 0;
imshow(cr);
axis('square');
disp('(2) Red ingredient. - Press enter ...')
pause;

cg = c; cg(:,:,1) = 0; cg(:,:,3) = 0;
imshow(cg);
axis('square');
disp('(3) Green ingredient. - Press enter ...')
pause;

cb = c; cb(:,:,1) = 0; cb(:,:,2) = 0;
imshow(cb);
axis('square');
disp('(4) Red ingredient. - Press enter ...')
pause;

g = rgb2gray(c);
imshow(g);
colormap('default');
axis('square');
disp('(5) Grayscale picture. - Press enter ...')
pause;

d = double(g);
imagesc(d);
axis('square');
map = [0 0 0; 1 1 1];
colormap(map);
disp('(6) Binary picture. - Press enter...')
pause;
