% ImLightOffName=input('filename of image no light > ')
% ImLightOnName=input('filename of image WITH light > ')
ImLightOffName='picture 3.jpg'
ImLightOnName='picture 4.jpg'

ImLightOff = imread(ImLightOffName);
ImLightOn = imread(ImLightOnName);

ImLightOff=double(ImLightOff);
ImLightOn=double(ImLightOn);
[Rows, Columns, k]=size(ImLightOff);

%for i=1:Rows
%    for j=1:Columns/3
%    ImDiff(i,j) = single(ImLightOn(i,j))-single(ImLightOff(i,j));
for k=1:3
ImDiff(:,:,k) = ImLightOn(:,:,k)-ImLightOff(:,:,k);
    for i=1:Rows
        for j=1:Columns
            if ImDiff(i,j,k) < 0
                ImDiff(i,j,k) = 0
            end %if
        end %for j
    end %for i
end %for k

ImDiff=uint8(ImDiff);
for k=1:3
    figure
    %subplot(3,1,k)
    image(ImDiff(:,:,k))
    colormap(gray(255))
    axis image
end % for k