Fred's ImageMagick Scripts
|
Modifies an image to automatically stretch the dynamic range between full black and white and automatically apply a gamma correction. |
last modified: October 21, 2008
|
USAGE: autolevel [-c colormode] infile outfile
-c .... colormode ..... colorspace/channel to use to compute PURPOSE: To modify an image to automatically stretch the dynamic range between full black and white and automatically apply a gamma correction. DESCRIPTION: AUTOLEVEL modifies an image to automatically stretch the dynamic range between full black and white and automatically apply a gamma correction. The minimum, maximum and gamma values may be computed from various graylevel representations of the image or individually channel-by-channel. The script then passes these values to the IM function -level. ARGUMENTS: -c colormode ... COLORMODE is the colorspace/channel to use to compute the minimum, maximum and gamma values. The choices are: gray, intensity, luminance, lightness, brightness, average, magnitude and rgb. Values of gray and intensity are equivalent. The default is luminance.
Gray or Intensity uses statistics from -colorspace Gray. Note: generally there are only slight differences between the various non-rgb colormode results. Colormode=rgb can cause color balance shifts. Gamma = log(mean)/log(mid-dynamic-range) Note: there is one internal parameter, midrange, that can be adjusted if you want to bias the gamma slightly. See the default values section. You can also change the default colormode in the default values. 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. |
|
Colormode Results On Dark Image |
|||||
|
Original Image |
Arguments: |
||||
|
|
||||
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
|
|
Variation Of Internal Midrange Parameter |
|||
|
Original Dark Image |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
Original Bright Image |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
Original Image |
Arguments: |
|
|
|
Original Image |
Arguments: |
|
|
|
Original Image |
Arguments: |
|
|
|
Original Image |
Arguments: |
|
|
|
Original Image |
Arguments: |
|
|
|
Original Image |
Arguments: |
|
|
|
Original Image |
Arguments: |
|
|
|
What the script does is as follows:
This is equivalent to the following IM commands for the luminance colormode.
|