Fred's ImageMagick Scripts
|
Changes the brightness and/or contrast of an image |
last modified: May 30, 2008
|
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:
|