Reference mask()

mask()

Masks part of the image with another.

img.mask() uses another p5.Image object's alpha channel as the alpha channel for this image. Masks are cumulative and can't be removed once applied. If the mask has a different pixel density from this image, the mask will be scaled.

Examples

Syntax

mask(srcImage)

Parameters

srcImage
p5.Image:

source image.

This page is generated from the comments in src/image/p5.Image.js . Please feel free to edit it and submit a pull request!

Related References