Node Jimp | opacity
Introduction : The opacity() function is an inbuilt function in Nodejs | Jimp which multiplies the opacity of each pixel by a factor between 0 and 1.
- f – This parameter stores the value by which image is to make opaque. It has a range of 0 to 1. 1 will turn the image completely transparent.
- cb – This is an optional parameter which is invoked when compilation is complete.
Setup Environment :
npm init -y
Install Dependencies :
npm install jimp
Example 2: With cb (optional parameters)