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. |
Enhances the shadows and/or highlight regions in an image. |
last modified: December 15, 2018
USAGE: dualtonemap [-c] [-g gamma] [-m mode] [-b bias] [-t thresh] [-s svals] [-h hvals] [-r ramp] infile outfile
-c .............. set colorspace of input image from sRGB to RGB PURPOSE: Enhances the shadows and/or highlight regions in an image. DESCRIPTION: DUALTONEMAP enhances the shadows and/or highlight regions in an image. This is done by adjusting the -level blackpoint,whitepoint% in the shadows and/or highlight regions. This is similar to Photoshop's Shadows/Highlights function. ARGUMENTS: -c ... Set colorspace of input image from sRGB to RGB before processing. This provides an initial non-linear processing. The default=no. -g gamma ... GAMMA applies a non-linear gamma processing to input image before processing. Alternate to -c option. Do not use both. Values are floats>0. Nominal value is gamma=2. The default=1 (no non-linear gamma processing). -m mode ... MODE of operation that specifies to adjust shadows or highlights or both. Choices are shadows (or s), highlights (or h) or both (or b). The default=both -b bias ... BIAS is the percent shift of the mean value of the input that is is used as the nominal threshold value between shadows and highlights. Values are positive or negative floats. The default=0 indicates no change from the global mean value of all channels of the input image. -t thresh ... THRESH is the user specified threshold value. When used, it overrides the automatic value from the (mean + bias) value. Values are floats between 0 and 100. The default is to use automatic value from the (mean + bias). -s svals ... SVALS=blackpoint,whitepoint,gamma used by -level in the shadows region. Values of each blackpoint and whitepoint are float percents in the range of 0 to 100 and gamma is a float>0. A value of svals=0,100,1 produces no change. The default=0,50,1. -h hvals ... HVALS=blackpoint,whitepoint,gamma used by -level in the highlights region. Values of each blackpoint and whitepoint are float percents in the range of 0 to 100 and gamma is a float>0. A value of hvals=0,100,1 produces no change. The default=50,100,1. -r ramp ... RAMP is the transition distance in pixels between the shadows and highlights. Values are integers>=0. The default=50. 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 |
-m shadows -s 0,30 |
-m shadows -s 0,100 -c |
![]() |
![]() |
![]() |
Example 2 |
|
Original | |
![]() |
|
Arguments: |
Arguments: |
![]() |
![]() |
Example 3 |
|
Original | |
![]() |
|
Arguments: |
Arguments: |
![]() |
![]() |
Example 4 |
|
Original | |
![]() |
|
Arguments: |
Arguments: |
![]() |
![]() |
Example 5 |
|
Original |
![]() |
Arguments: |
![]() |
Arguments: |
![]() |
Arguments: |
![]() |
Example 6 |
|
Original | |
![]() |
|
Arguments: |
Arguments: |
![]() |
![]() |
Example 7 |
|||
Original |
![]() |
||
Arguments: |
![]() |
Example 8 |
|||
Original |
![]() |
||
Arguments: |
![]() |
||
Arguments: |
![]() |
What the script does is as follows:
This is equivalent to the following IM commands
|