Sem 7‎ > ‎Digital Image Processing‎ > ‎

WAP to display negative of image

posted Oct 30, 2013, 7:53 AM by Neil Mathew   [ updated Oct 30, 2013, 7:54 AM ]
Source Code:


a=imread('C:\Users\Desktop\lena.png');
subplot(2,2,1);
imshow(a);
title('original image');
 b=rgb2gray(a);
subplot(2,2,2);
imshow(b);
title('gray scale image');
 c=255-a;
subplot(2,2,3);
imshow(c);
title('negative of image');
 d=255-b;
subplot(2,2,4);
imshow(d);
title('negaative of gray scale image');

Output:


Comments