%
% Read & display original color jpg image
%
J1 = imread('lena512color.jpg','jpg');
figure(1);
image(J1);
axis('image');
title('Original lena512color.jpg Image');
%
% Print as color "eps" for report
%
print -depsc P3J1.eps;
%
% Make J2 by swapping the RGB color bands
%
J2 = J1;
J2(:,:,1) = J1(:,:,3);
J2(:,:,2) = J1(:,:,1);
J2(:,:,3) = J1(:,:,2);
%
% Display J2 and write out as JPEG
%
figure(2);
image(J2);
axis('image');
title('Color Bands Switched');
imwrite(J2,'LenaColorSwitch.jpg','jpg');
%
% Print as color "eps" for report
%
print -depsc P3J2.eps;