I want to mask a image in another image like this
where this image image1
is being masked over this image2
const Jimp = require('jimp');
module.exports = async d => {
const data = d.util.aoiFunc(d);
const [c = ""] = data.inside.splits;
const plate = await Jimp.read('https://media.discordapp.net/attachments/1082539845609598976/1097835331698565160/Untitled2_20230418163013.png');
const card = await Jimp.read('https://media.discordapp.net/attachments/1090951194467381301/1090966064206188604/Untitled108_20230330173407.png');
plate.mask(card, 0, 0);
await plate.writeAsync(`path/output.png`);
return { code: d.util.setCode(data) };
};
I tried this, it does gives me a masked image but the output is in black and white the actual output