function reduce= redeye(W, x1, x2, y1, y2) % Reduce reduces the redeye in an image % Coded by Peter Knudtson % 6 March 2006 % This program takes a selected area of the photo and % reduces the red by 50. It then displays the image and % asks if the user would like to keep it, reduce it more, % or discard the changes and exit the program % % % Variables % img= the imported image % x1= the starting x coordinate for the change % x2= the ending x coordinate for the change % y1= the starting y coordinate for the change % y2= the ending y coordinate for the change % a= the cut and manipulated image % Z=W(x1:x2,y1:y2,1)-50; W(x1:x2,y1:y2,1)=Z; reduce=W; figure (2); image (W);