Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Removes redeye from an image. |
last modified: December 15, 2018
USAGE: redeye [-k kind] [-l light] [-s sat] [-f fuzz] [-i inc] [-b begin] [-e end] [-d dilate] [-t type] [-r rad] "x1,y1 x2,y2 ..." infile outfile
"x1,y1 x2,y2 ..." ... x,y coordinates in image where redeye needs PURPOSE: To remove redeye from an image. DESCRIPTION: REDEYE removes redeye from an image. It does so by the user specifying coordinates in each redeye area. Processing then floodfills at those coordinates either in the image or the saturation channel to create a mask. The mask is then used with a desaturated version of the image and the original image to modify the color of the redeye areas. The white specular component inside the redeye region may optionally be removed. The user may specify a particular fuzz value to use or let the script attempt to find an optimal value. ARGUMENTS: "x1,y1 x2,y2" ... x,y coordinates in the image where redeye needs to be corrected. One or more point pairs are allowed. Atleast one pair must be provided. IMPORTANT: the list of point pairs must be specified just prior to infile. -f point_file ... point-file is a text file containing the list of point pairs, one x,y pair per line. Atleast one pair must be provided. -k kind ... KIND of image to process for redeye region. Choices are: 1 for input image or 2 for the HSB saturation channel. The default=1 -l light ... LIGHT is the desired lightness in the redeye area. Values are 0<=integer<=100. The default=15 -s sat ... SAT is the desired saturation in the redeye area. Values are 0<=integer<=100. The default=0 -f fuzz ... FUZZ is the desired fuzz value for the redeye floodfill. Values are in the range of 0<=float<=100 . Nominal values appear to be about 15 to 20 from limited testing. The default is for automatic interative detection of an optimal fuzz value. This usually works reasonably well, but tends to be an under estimate. It seems to work better for the saturation channel than the image, but tends to be more underestimated in the former case. In the latter case, it can overestimates more frequently than in the former case. To correct for understimation either increase the value reported or increase the dilation argument. For overstimation reduce the fuzz value. -i inc ... INC is the fuzz iteration increment in automatic mode. Values are 0<integer<100. The default=5 -b begin ... BEGIN is the fuzz interation begin value in automatic mode. Values are 0<integer<100. The default=10 -e end ... END is the fuzz interation end value in automatic mode. Values are 0<integer<100. The default=50 -d dilate ... DILATE is the dilation amount to increase the size of the detected redeye areas. Values are integers>=0. The default=1 -t type ... TYPE of white specular reflection processing. The choices are: desat (d) for desaturation or remove (r). The default=desat -r rad ... RAD is the radius of the white specular reflection region. Values are floats>0. The default=3 REQUIREMENTS: IM 6.5.9-0 in order to support the -morphology methods used in the script. However, due to possible bugs, it may require at least IM 6.5.9-3 CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
Example 1 |
|
Arguments: |
|
Arguments: |
Example 2 |
|
Arguments: |
|
Arguments: |
Example 3 |
|
Arguments: |
|
Arguments: |
Example 4 |
|
Arguments: |
|
Arguments: |
What the script does is as follows for type=desat and fuzz specified:
This is equivalent to the following IM commands for type=desat and fuzz specified:
|