%{
FIND THE NEGATIVE IMAGE
%}
real = imread(\'z.jpg\');
real1=real;
%%showing the image
figure(1)
subplot(2,2,[1 2]),imshow(real),title(\'Original Image\');
%%getting the gray image
gray=rgb2gray(real1);
[m,n]=size(gray);
%now converting to get a negative image i.e 255-pixel value
for i=1:m
for j=1:n
val=255-gray(i,j);
gray(i,j)=val;
end
end
subplot(2,2,[3 4]),imshow(uint8(gray)),title(\'Negative Image\');