%Image manipulation in MATLAB

LOYOLA = imread('loyola.jpg');
size(LOYOLA)
imshow(LOYOLA);
%enable viewing of RBG values
datacursormode('on')

%pause

%slipt up channels
%red channel
RL(:,:,1) = LOYOLA(:,:,1);
RL(:,:,2)=0;
RL(:,:,3)=0;
%green channel
GL(:,:,2) = LOYOLA(:,:,2);
GL(:,:,1)=0;
GL(:,:,3)=0;
%blue channel
BL(:,:,3)= LOYOLA(:,:,3);
BL(:,:,1)=0;
BL(:,:,2)=0;

%Plot the various channels
subplot(2,2,1);
imshow(RL);
title('Red channel');
subplot(2,2,2);
imshow(GL);
title('Green channel');
subplot(2,2,3);
imshow(BL);
title('Blue channel');
subplot(2,2,4);
imshow(RL+GL+BL);
title('All channels');






