The fade() function is an inbuilt function in Nodejs | Jimp which fades each pixel by a factor between 0 and 1.
- f – This parameter stores the value by which image is made transparent. It has a range of 0 to 1. 1 will turn the image completely transparent.
- cb – This is optional parameter which is invoked when compilation is complete.
Step 1 : Setting up environment
npm init -y
Step 2 : Install jimp
npm install jimp --save
Example 2: With f and cb (optional parameters)