OriginLab Corporation - Scientific Graphing and Data Analysis Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis

imgSaturation

Contents

Menu Information

Saturation

Brief Information

Adjust Saturation of image

Command Line Usage

1. imgSaturation a:=30;

2. imgSaturation a:=-30 img:=mat(1) oimg:=mat(2);

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Adjust Saturation a

Input

double

0

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

<active>

Specifies the image to be manipulated. The default input is the active image.

Output Image oimg

Output

Image

<input>

Specifies the output image. By default, the output image is the same as the input image.

See the syntax here.

Description

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.

Examples

In this example, we use the imgSaturation function to make the colors in the input image lighter:

  1. When the input image is active, select Image: Adjustments: Saturation. This opens the dialog of the X-Function.
  2. In the X-Function dialog, change the settings as the screenshot below and click OK to close the dialog.
    Image:imgSaturation_help_English_files_image002.jpg
    A new image is created. We can see that the color is lighter.
Image:imgSaturation_help_English_files_image004.jpg
Image:imgSaturation_help_English_files_image006.jpg
The original image
The output image


Algorithm

The value of the Saturation level is changed by the following formula:

Image:imgSaturation_help_English_files_image008.gif
where Image:imgSaturation_help_English_files_image010.gif is the output saturation, Image:imgSaturation_help_English_files_image012.gifis the input saturation and change is specified by the Adjust Saturation variable.

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.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgBrightness, imgContrast, imgHue, imgGamma