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. |
Corrects the color balance for red light attenuation in pictures taken underwater. |
last modified: November 22, 2023
USAGE: uwcorrect [-m method] [-b bright] [-c contrast] [-s sat] [-h hue] [-S sharp] infile outfile
-m .... method ......... method of red substitution; method=1 or 2; PURPOSE: To correct the color balance for red light attenuation in pictures taken underwater. DESCRIPTION: UWCORRECT corrects the color balance for red light attenuation in pictures taken underwater. It uses a red colorized grayscale version of the image to compensate for the nearly dark red channel. ARGUMENTS: -m method ... METHOD is the technique for red substitution. Choices are method=1 or 2. Method 1 uses -tint. Method 2 uses -level-colors. The default=1 -b bright ... BRIGHT is the percent change in brightness. Values are integers between -100 and 100. Positive values increase brightnesss and negative values decrease brightness. The default is zero or no change. -c contrast ... Contrast is the percent change in contrast. Values are integers between -100 and 100. Positive values increase contrast and negative values decrease contrast. The default is zero or no change. -s sat ... Sat is the percent change in saturation. Values are integers between -100 and 100. Positive values increase contrast and negative values decrease contrast. The default is zero or no change. -h hue ... HUE is the percent change in hue. Values are integers between -100 and 100 (corresponding to -180 deg and +180 deg shifts). Positive values shift red towards yellow and green and negative values shift red toward magenta and blue. Similarly for other colors. The default is zero or no change. -S sharp ... SHARP is the change in sharpness expressed in pixels. Values are integers greater than or equal to 0. The default=0 or no sharpening. NOTE: This script requires IM 6.5.9-0 or higher due if using -brightness-contrast; otherwise IM 6.5.5-1 due to the use of -auto-level.
Technique References: 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 |
|
Original |
Arguments: |
Example 2 |
|
Original |
Arguments: |
Example 3 |
|
Original |
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands for tint case.
|