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

imgBlend

Contents

Menu Information

Alpha Blend

Brief Information

Blend two images into a combined image

Additional Information

This feature is for OriginPro only.

Command Line Usage

1. imgBlend img:=[Mbook1]1!mat(1) imgb:=[Mbook2]1!mat(1) opacity:=120;

2. imgBlend img:=[Mbook1]1!mat(1) imgb:=[Mbook2]1!mat(1) x:=50 y:=10;

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input Matrix img

Input

Image

<active>

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

Image to Blend imgb

Input

Image

<unassigned>

Specifies an image used to blend the input image.

Opacity opacity

Input

int

128

Specifies the opacity of the Image to Blend. This value should be between 0 and 255.

Output Image oimg

Output

Image

<new>

Specifies the output image. By default, a new image will be created and used as output. See the syntax here.

Offset X x

Input

int

0

Specifies the vertical offset to change the relative position of the Image to Blend.

Offset Y y

Input

int

0

Specifies the horizontal offset to change the relative position of the Image to Blend.

Crop to Common Area crop

Input

int

1

Specifies whether to crop the output image to the common area of Input Image and Image to Blend.

Description

This X-Function combines two images with alpha blending. The Image to Blend is made transparent and put on top of the Input Image, allowing user to see through the image on top to the image below.

Examples

In this example, we use the imgBlend function to combine two images (one in Mbook3 and the other in Mbook2):

  1. When the input image is active, select Image: Arithmetic Transform: Alpha Blend. 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:imgBlend_help_English_files_image002.jpg

Input Image

Image:imgBlend_help_English_files_image004.jpg

Image to Blend

Image:imgBlend_help_English_files_image006.jpg

Output Image

Image:imgBlend_help_English_files_image008.jpg


Algorithm

The computation uses L_AlphaBlendBitmap() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_AlphaBlendBitmap topic.

References

LEADTOOLS Main API Help file, Version 14

Related X-Functions

imgSimpleMath