mask package:cairo

A drawing operator that paints the current source using the alpha channel of pattern as a mask. (Opaque areas of mask are painted with the source, transparent areas are not painted.)
A drawing operator that paints the current source using the alpha channel of surface as a mask. (Opaque areas of surface are painted with the source, transparent areas are not painted.)