Fred's ImageMagick Scripts
|
Creates a symmetric soft knee-shaped curved mapping look up table \ and applies it to an image |
last modified: November 27, 2011
|
USAGE: kneemap [-a amount] [-c channels] [-l lutlength] [-g] infile outfile
-a .... amount ....... amount of curvature for knee curve mapping PURPOSE: To create a symmetric soft knee-shaped curved mapping look up table and applies it to an image. DESCRIPTION: KNEEMAP creates a symmetric soft knee-shaped curved mapping transformation similar to -evaluate log or -evaluate pow (-gamma), but which is symmetric. This transformation is generated as 1D lut and applied to the image using -clut to affect the intensity/color transformation. The transformation is sensitive to the desired channels specified. ARGUMENTS: -a amount ... AMOUNT is the amount of curvature for knee curve mapping transformation. Values are in the range 1<float<1. Positive values non-linearly brighten the image and negative values non-linearly darken the image. The default=0 for no change. -c channels ... CHANNELS are any valid IM combination of channels corresponding to the image's colorspace to which to apply the transformation. Combinations include: r,g,b,a, or c,m,y,k,a (with no commas). The -l lutlength ... LUTLENGTH is the length of 1D lut. Values are integer>0. The default=1000 -g ... enables the creation of a graph of the knee curve mapping transformation, which is then displayed automatically. There is a default setting below that can be changed to enable this to be save to a file named outfile_kneegraph.gif. The graph will be scaled to size 100x100. My thanks to Max Usatov for bringing the dynamic range compressor or soft knee compressor to my attention. See http://www.scribd.com/doc/14599153/Fast-Dynamic-Range-Compression-for-Grayscale-Images REQUIREMENTS: IM 6.3.5-7 is required to support the use of -clut 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. |
Thanks to Anthony Thyssen for the technique used to draw the points efficiently
|
Original Image - Brightenning |
arguments: |
Transformation Graph |
|
|
|
|
Original Image - Darkening |
arguments: |
Transformation Graph |
|
|
|
|
Original Image - Brighten Channels |
arguments: |
arguments: |
arguments: |
|
|
|
|
|
Original Image - Darken Channels |
arguments: |
arguments: |
arguments: |
|
|
|
|
|
Comparison: Knee Map, Exponential Map, Logarithmic Map |
||
|
Knee Map |
Exponential Map |
Scaled Logarithmic Map |
|
|
|
|
What the script does is as follows:
This is equivalent to the following IM commands.
|