Hi,
sorry for the noob quertion but i've looked around and i didn't found what i'm looking for.
i want to mask an A image with a b image transforming image b's pixels to transparent pixel and leaving imageb's white pixels as is...
in this Case A+C = C where C is an image with the same size of A and B but with alpha where not white

Thanks in advance and sorry for my english
Hello, did you see the cutout option of overlayWith?
The third example in the README uses this.
Hi, i tried with a wrong png and it didn't worked, so i've posted the question. Using another png file it worked like a charm.
var mask = 'mask_test_2.png';
sharp('mask_test_1.png').overlayWith(mask,{
cutout : true
}).toFile('prova.png');
Most helpful comment
Hi, i tried with a wrong png and it didn't worked, so i've posted the question. Using another png file it worked like a charm.
var mask = 'mask_test_2.png'; sharp('mask_test_1.png').overlayWith(mask,{ cutout : true }).toFile('prova.png');