% function complementImage is to change an image into its complement

%%%%%%%%%%
% use matlab function imcomplement() to get the complement of the image
function [compImage] = complementImage(fileName)
A = imread(fileName);
figure, imagesc(A); colormap(gray);
Acomp = imcomplement(A);
figure, imagesc(Acomp), colormap(gray);
tempImage = strcat('comp', fileName);
imwrite(Acomp, tempImage);
compImage = tempImage;
return;