I'd like to apply a simple few masks to few images.

XXXOOO

I mean, that on the right everything is masked (to black), and on the left everything is stayed without changes.

The second mask I'd like to implement is glow mask. I mean something like this:

    O
O***O
O**X**O
O***O
O

What I mean, is a circle mask, which in the center everything is saved without changes, and going outside the circle everything is starting to be black

  OOO*
O**X**O
OO**OO**O
OO*X*O
O*O
O

Where:
O - to black
* - to gray
X - without changes

Could you explain me how to apply mute mask on an image? (mask will be grayscale)