Fred's ImageMagick Scripts
|
Enhances the shadows and/or highlight regions in an image. |
last modified: November 27, 2011
|
USAGE: duotonemap [-m mode] [-b bias] [-t thresh] [-s sgamma] [-h hgamma] [-r ramp] [-l lower] [-u upper] infile outfile
-m .... mode ...... mode of operation; choices are: shadows, highlights or PURPOSE: Enhances the shadows and/or highlight regions in an image. DESCRIPTION: DUOTONEMAP enhances the shadows and/or highlight regions in an image. This is done by adjusting the gamma in each region as defined by a threshold of the image used as a mask. Processing is nominally automatic, but can be overridden with manual settings. This is similar to Photoshop's Shadows/Highlights function. ARGUMENTS: -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 sgamma ... SGAMMA is the gamma value to use in the shadow region. When provided it overrides the automatic value determined from the mean value in the shadows and the "lower" graylevel parameter. Values are floats>0. A value of sgamma=1 produces no change. Smaller/larger values produce darker or brighter results in the shadows. The default is to use the automatically computed value. -h hgamma ... HGAMMA is the gamma value to use in the highlight region. When provided it overrides the automatic value determined from the mean value in the highlights and the "upper" graylevel parameter. Values are floats>0. A value of hgamma=1 produces no change. Smaller/larger values produce darker or brighter results in the highlights. The default is to use the automatically computed value. -r ramp ... RAMP is the transition distance in pixels between the shadows and highlights. Values are integers>=0. The default=20. -l lower ... LOWER is the graylevel value used with the mean value of the shadows to compute the shadow gamma. Values are in the range 0<=float<=1. Smaller/larger values produces darker/brighter results. The default=0.5 -u upper ... UPPER is the graylevel value used with the mean value of the highlights to compute the highlight gamma. Values are in the range 0<=float<=1. Smaller/larger values produces darker/brighter results. The default=0.7 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: |
redist 40,70,70 |
-auto-level |
|
|
|
|
|
Example 2 |
|
|
Original |
redist 50,70,70 |
|
|
|
Arguments: |
Arguments: |
|
|
|
Example 3 |
|
|
Original |
redist 50,50,40 |
|
|
|
Arguments: |
Arguments: |
|
|
|
Arguments: |
Arguments: |
|
|
|
Example 4 |
|
|
Original | |
|
|
|
Arguments: |
redist 60,60,60 |
|
|
|
What the script does is as follows:
This is equivalent to the following IM commands
|