2.6.1.3 imgBrightness
Contents
Menu Information
Image: Adjustments: Brightness
Brief Information
Adjust image brightness
Command Line Usage
1. imgBrightness a:=2; 2. imgBrightness a:=2 img:=mat(1) oimg:=mat(2); 3. imgBrightness a:=2 img:=[Mbook1]Msheet1!Mat(1) oimg:=<new>;
X-Function Execution Options
Please refer to the page for additional option switches when accessing the x-function from script
Variables
| Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
|---|---|---|---|---|
| Adjust Intensity | a |
Input double |
|
Use this variable to specify how to change the brightness. This value should be within [-100, 100]. Specifying a negative value will cause the brightness to be reduced, while a positive value will increases the brightness. |
| Input Matrix | img |
Input Image |
|
Specifies the image to be manipulated. The default input is the active image. |
| Output Image | oimg |
Output Image |
|
Specifies the output image. By default, the output image is the same as the input image. See the syntax here. |
Description
This function adjusts the brightness of an image. The brightness adjustment can be either positive or negative, which means that you can either increase or decrease the brightness of the input image.
Examples
- Code Sample
//Create a new folder in the Project Explorer pe_mkdir Adjustments path:=aa$; pe_cd aa$; //Create a matrix and import the sample image into it window -t m; fname$ = System.path.program$ +"samples\Image Processing and Analysis\white camellia.jpg"; impimage; window -r %h Original; window -d; //Duplicate the image window -r %h Modified; //Adjustments imgBalance c2r:=-7 m2g:=5; //White balance imgContrast a:=-22; //Decrease contrast imgBrightness a:=10; //Increase brightness window -s T; //Tile the windows horizontally
Algorithm
The computation uses L_ChangeBitmapIntensity() function from LEADTOOLS Main API. For this information, please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_ChangeBitmapIntensity topic.
References
LEADTOOLS Main API Help file, Version 14
Related X-Functions
imgContrast, imgHue, imgSaturation, imgGamma, imgHistcontrast