$ npm install @jimp/plugin-mask
mask an image with another image.
Masks a source image on to this image using average pixel colour. A completely black pixel on the mask will turn a pixel in the image completely transparent.
import jimp from 'jimp';
async function main() {
const image = await jimp.read('test/image.png');
const mask = await jimp.read('test/mask.png');
image.mask(mask);
}
© 2010 - cnpmjs.org x YWFE | Home | YWFE