Code covered by the BSD License  

Highlights from
Image Enhancement

from Image Enhancement by Madhu S. Nair
Image Enhancement Range Compression Skewing slicing low pass high pass filter threshold digital nega

digitneg(x)
%Question No:3
%DIGITAL NEGATIVE

function digitneg(x)
f=imread(x);
L=max(max(f));
g=L-f;
imshow(f), figure, imshow(g);
end

Contact us at files@mathworks.com