%
% Read & display lenagray.jpg image
%
J1 = imread('lenagray.jpg','jpg');
figure(1);colormap(gray(256));
image(J1);
axis('image');
title('Original lenagray.jpg Image');
%
% Print as "eps" for report
%
print -deps P2J1.eps;
%
% Make J2 a photographic negative & display
%
J2 = 255 - J1;
figure(2);colormap(gray(256));
image(J2);
axis('image');
title('Photographic Negative');
%
% Write out result as JPEG
%
imwrite(J2,'LenaNegative.jpg','jpg');
%
% Print as "eps" for report
%
print -deps P2J2.eps;
