Image=imread(‘4.jpg‘);
Image=double(Image);
Image_inverse=255-Image;
[row,col,layer]=size(Image);
Image_new=Image;
for i=1:row
for j=1:col
Image_new(i,j,1)=min(Image(i,j,1),Image_inverse(i,j,1));
Image_new(i,j,2)=min(Image(i,j,2),Image_inverse(i,j,2));
Image_new(i,j,3)=min(Image(i,j,3),Image_inverse(i,j,3));
end
end