Image: Adjustments: Contrast
Adjust image contrast
1. imgContrast a:=20; 2. imgContrast a:=-20 img:=mat(1) oimg:=mat(2);
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Adjustment | a |
Input double |
|
Specifies the amount of contrast change. The valid range is [-100, +100]. |
Input Matrix | img |
Input Image |
|
Specifies the source image to be manipulated. The default input is the active image. |
Output Image | oimg |
Output Image |
|
Specify the output image. By default, the output image is the same as the input image. See the syntax here. |
The imgContrast function increases or decreases the contrast of a bitmap image. To increase the contrast, enter a positive value for the amount variable; otherwise, enter a negative amount to decrease the contrast. The absolute amount of the amount variable determines the amount of contrast change.
//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
The computation uses L_ChangeBitmapContrast() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_ChangeBitmapContrast topic.
LEADTOOLS Main API Help file, Version 14