To summarize, the technique takes two images with alpha channel and generates the output image by combining pixels values of two images. The various combining modes result in different output image. For example, in following image, blue shape (source, existing pixels) is combined with Yellow shape (destination, new pixels) in different modes:
Apply a radial mask (vignette) to a bitmap using PorterDuffXfermode
Also, it can be applied to a Paint, so that the color that is drawn using that paint, is modified by the filter:
Creating a PorterDuff XferMode
An Xfermode (think "transfer" mode) works as a transfer step in drawing pipeline. When an Xfermode is applied to a Paint, the pixels drawn with the paint are combined with underlying pixels (already drawn) as per the mode:
Now we have a blue tint paint. Any shape drawn will tint the already existing, non-transparent pixels blue in the area of the shape.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0