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. |
Creates a symmetric soft knee-shaped curved mapping look up table \ and applies it to an image |
last modified: December 15, 2018
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.
|