Image: Adjustments: Leveling
Adjust image levels
This feature is for OriginPro only.
1. imgLevel option:=contrast w:=20 b:=30;
2. imgLevel img:=1 option:=contrast w:=20 b:=30 oimg:=mat(2);
3. imgLevel img:=[Mbook1]Msheet1 oimg:=<new>;
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 |
---|---|---|---|---|
Input Matrix | img |
Input Image |
|
Specifies the image to be manipulated. The default input is the active image. |
Level Option | option |
Input int |
|
Specifies the leveling type.
|
WhiteClip(%) | w |
Input double |
|
Specifies the percentage of white pixels to clip from the input image. |
BlackClip(%) | b |
Input double |
|
Specifies the percentage of black pixels to clip from the input 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. |
Level Report | cl |
Output ReportData |
|
Specifies the leveling report.
|
The imgLevel function applies leveling to an image. It makes the dark values darker and the light values lighter. It enhances the contrast and intensity by using the histogram of the image and a color distribution-based algorithm. There are three Leveling types in OriginPro:
This function allows you to choose the Leveling type, specify the percentage of white pixels and the percentage of black pixels. Choosing Level Report in the Leveling dialog can create a report for this function.
Another function named imgAutoLevel also can apply leveling to an image, but the percentage of white pixels and black pixels to clip from the input image is set as 5% automatically.
In this example, we use the imgLevel function to increase the contrast of the input image:
The computation uses L_AutoColorLevelBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_AutoColorLevelBitmap topic.
LEADTOOLS Main API Help file, Version 14