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. |
Changes the brightness and/or contrast of an image |
last modified: December 15, 2018
USAGE: bcimage [-g] bri,con[,sat] infile outfile
bri ................. percent change in brightness (+/-) PURPOSE: To change the brightness, contrast and/or saturation of an image. DESCRIPTION: BCIMAGE is designed to change the brightness and/or contrast and optionally saturation of an image. It works by converting bri and con into slope and intercept and and then into break points. The break points are then converted into a 1-D image look up table. This LUT is then used with clut or -fx to process the image. If the image is not grayscale and a sat value provided, it will convert the image into HSL space and then modify the saturation channel by changing the gamma using -gamma. Both bri and con are required. The range of values for bri,con,sat are -100 to +100. A value of 0,0[,0] leaves the image unchanged. If the image is grayscale, then it simply processes the image for brightness and contrast. The -g option displays a graph of the piece-wise linear mapping function between the input and output grayscale domains (scaled to the range of 0 to 100). The graph is normally just viewed, but a default parameter in the program can be set to allow it to be saved as outfilename_graph.gif. To end the script, close/quit the graph image. Arguments: -h or -help ....... displays help information. Arguments: -g ................ displays graph of intensity mapping function. Note: -g must come before bri,con[,sat] 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. |
Original Image |
artificially brightened and contrast lowered |
Brightness, Contrast, (Saturation) Changes |
|||
arguments: |
arguments: |
arguments: |
arguments: |
slope=1.256 |
slope=1.121 |
slope=501.000 |
slope=0 |
The second example above from the left does the following:
This is equivalent to the following IM commands:
|