Function: linear_blend

Function: linear_blend

Usage

 linear_blend(
    image1: image, image2: image,
    x1: coordinate, y1: coordinate,
    x2: coordinate, y2: coordinate,
 )

Blend two images together using a linear gradient.

Coordinates range from 0 to 1, where 0 is the top and the left, and 1 is the right and the bottom. So for example a blend from x1:0, y1:0 to x2:0, y2:1 is from top to bottom.

The images must have the same size.

Parameters

Parameter Type Description
image1 image First image to blend
image2 image Second image to blend
x1,y1 real number Coordinates where the gradient begins, and the first image is shown for 100%
x2,y2 real number Coordinates where the gradient ends, and the second image is shown for 100%

Examples

This gives a vertical gradient:

 linear_blend(image1: "image1.png", image2: "image2.png", x1:0, y1:0, x2:0, y2:1)  ==  [[Image]]
 linear_blend(image1: "image1.png", image2: "image2.png", x1:0, y1:0, x2:1, y2:1) == "image_linear_blend.png"

See also

masked_blend Blend two images together using a third mask image.
combine_blend Blend two images together using a given combining mode.