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

imgBalance

Contents

Menu Information

Balance

Brief Information

Balance the color of image

Command Line Usage

1. imgBalance c2r:=10 m2g:=40 y2b:=30 oimg:=<new>;

2. imgbalance c2r:=10 m2g:=40 y2b:=30 img:=[Mbook1]Msheet1!Mat(1);

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Cyan to Red c2r

Input

int

0

Specifies how to change of color levels in red channel. This value should be between -100 to 100. A positive value means more red tints will be added, while a negative values means more cyan tints will be added.

Magenta to Green m2g

Input

int

0

Specifies how to change of color levels in green channel. This value should be between -100 to 100. A positive value means more green tints will be added, while a negative values means more magenta tints will be added.

Yellow to Blue y2b

Input

int

0

Specifies how to change of color levels in blue channel. This value should be between -100 to 100. A positive value means more blue tints will be added, while a negative values means more yellow tints will be added.

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 imgBalnce function alters the color levels within the input image. You can use it to apply color balancing. For example, if the input image has too many red tints, you can use this function to reduce the red tints so as to improve its coloring.

Examples

The input image has too many red tints. Therefore, we use the imgBalance function to reduce the red tints. When the input image is active, select Image: Adjustments: Balance to bring up the imgBalance dialog box. In this dialog, change the settings as the screenshot below and click OK to close the dialog.

Image:imgBalance dialog.png

Then we will have the output image shown below.

Image:imgBalance_help_English_files_image002.jpg
Image:imgBalance_help_English_files_image004.jpg
Original Image
Output Image


For more examples, please refer to XF Script Dialog (press F11).

Algorithm

For each pixel in the input image, the red, green, blue value is modified. The modification is controlled by to the variables: Cyan to Red, Magenta to Green and Yellow to Blue.

For more information, please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_BalanceColors topic.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgColorlevel