Static p5_sys::global::blend [−][src]
pub static blend: BlendInternalType
Expand description
Copies a region of pixels from one image to another, using a specified blend mode to do the operation.
Examples
let img0; let img1; function preload() { img0 = loadImage('assets/rockies.jpg'); img1 = loadImage('assets/bricks_third.jpg'); } function setup() { background(img0); image(img1, 0, 0); blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST); }
let img0; let img1; function preload() { img0 = loadImage('assets/rockies.jpg'); img1 = loadImage('assets/bricks_third.jpg'); } function setup() { background(img0); image(img1, 0, 0); blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST); }
let img0; let img1; function preload() { img0 = loadImage('assets/rockies.jpg'); img1 = loadImage('assets/bricks_third.jpg'); } function setup() { background(img0); image(img1, 0, 0); blend(img1, 0, 0, 33, 100, 67, 0, 33, 100, ADD); }
Overloads
srcImage
source image
sx
X coordinate of the source’s upper left corner
sy
Y coordinate of the source’s upper left corner
sw
source image width
sh
source image height
dx
X coordinate of the destination’s upper left corner
dy
Y coordinate of the destination’s upper left corner
dw
destination image width
dh
destination image height
blendMode
the blend mode. either
BLEND, DARKEST, LIGHTEST, DIFFERENCE,
MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,
SOFT_LIGHT, DODGE, BURN, ADD or NORMAL.
sx
X coordinate of the source’s upper left corner
sy
Y coordinate of the source’s upper left corner
sw
source image width
sh
source image height
dx
X coordinate of the destination’s upper left corner
dy
Y coordinate of the destination’s upper left corner
dw
destination image width
dh
destination image height
blendMode
the blend mode. either
BLEND, DARKEST, LIGHTEST, DIFFERENCE,
MULTIPLY, EXCLUSION, SCREEN, REPLACE, OVERLAY, HARD_LIGHT,
SOFT_LIGHT, DODGE, BURN, ADD or NORMAL.