I'd like to take one image and composite it on top of another image.
This works well for that purpose:
overlayImg = await Sharp(sourceImage.Body)
.composite([{
input: './lambdas/processNewImage/logos/white.png',
gravity: 'southeast',
}])
.toFormat('jpeg').toBuffer();
I also have a variable - 1-100 that is supposed to be the opacity of the watermark. Sometimes I want it full solid At 100% opacity, others 70% and others 30%...etc. Because I need this to be variable, I cannot just change the opacity of the watermark image.
I cannot figure out how to change the opacity of a composited image in Sharp.
Can any one give a quick example?