function []=Images;
% Open a jpg: x,y,r,g,b. size(I)=480x640x3
% Open another jpg, resize it, and overlay it on first jpg.
%[r g b]=[0 0 0]=black, [r g b]=[255 255 255]=white
 I1=imread('/yourpath1.jpg');
 I2=imread('/yourpath2.jpg');
 image(I2);
 pause;
 clf;
 image(I1);  % display the image
 %set(gca,'Position',[0 0 1 1])
 %h2=image(I2)
 %get(h2,'CDataMapping')
 %get(h2,'XData'); get(h2,'YData');
 
 hold on;
 pause
 I1(300:400,300:400,:)=255;  % white out a rectangle, not necessary
 image(I1);
 pause;
I3=image(I2,'XData',[300 400], 'YData',[300 400]);
image(I3);
 imwrite(I3,'overlay.jpg');
 
 
