You got an image to be used as mask for another image. (Mask is like a black and white image, when combined with other images, white area will be retained, black area will be erased, grey area will have less transparency).
Suppose our image is like this
Input image
For masking sometimes you require a transparent…