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

imgContrast

Contents

Menu Information

Contrast

Brief Information

Adjust contrast of image

Command Line Usage

1. imgContrast a:=20;

2. imgContrast a:=-20 img:=mat(1) oimg:=mat(2);

Variables

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

Input

double

0

Specifies the amount of contrast change. The valid range is [-100, +100].

Input Matrix img

Input

Image

<active>

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

Output Image oimg

Output

Image

<input>

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

See the syntax here.

Description

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.

Examples

In this example, we use the imgContrast function to increase the contrast of the input image with the Adjustment value as 20:

  1. When the input image is active, select Image: Adjustments: Contrast. 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:imgContrast_help_English_files_image002.jpg
    We can see that the contrast of the image is improved.
Image:imgContrast_help_English_files_image004.jpg
Image:imgContrast_help_English_files_image006.jpg
The original image
The output image


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

Algorithm

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.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgBrightness