Code covered by the BSD License  

Highlights from
NEGATIVE:Make colored negative images

from NEGATIVE:Make colored negative images by Divakar Roy
Produces colored and gray negative images

negative(input_image, output_image)
% NEGATIVE : Creates colored and gray negative images.
%
% Syntax: negative(input_image_name, output_image_name)
% Example: negative('Input.jpg', 'Output.jpg');

function negative(input_image, output_image)

img=imread(input_image);
img=double(img);
inv(:,:,:)=255-img(:,:,:);
inv=uint8(inv);
imwrite(inv,output_image);

Contact us at files@mathworks.com