Image: Adjustments: Saturation
Adjust image saturation
1. imgSaturation a:=30;
2. imgSaturation a:=-30 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 |
---|---|---|---|---|
Adjust Saturation | a |
Input double |
|
Specifies the percentage of saturation change. The value varies between [-100, 100]. A negative value reduces the saturation, while a positive one increases it. |
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. |
The saturation refers to the intensity of a certain color. The imgSaturation function can be used to adjust the saturation of an image, making the color darker or lighter. In this X-Function, the change of saturation based on the image's original saturation level is relative. This means that the input value of the Adjust Saturation variable is the percentage to change. The change can be either negative or positive. A negative value reduces the saturation, making the color lighter; while a positive one increases the saturation, making the color darker.
In this example, we use the imgSaturation function to make the colors in the input image lighter:
The value of the Saturation level is changed by the following formula:
The computation uses L_ChangeBitmapSaturation() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_ChangeBitmapSaturation topic.
LEADTOOLS Main API Help file, Version 14