Image Compositing
Compositing is the act of putting together two images, allowing features of both images to be seen.
In the Android SDK, we can accomplish compositing by first drawing one Bitmap
to a Canvas
and then drawing a second Bitmap
to the same Canvas
. The only difference is that we specify a transfermode (Xfermode
) on the Paint
when drawing the second image.
The set of classes that can be used as a transfermode all derive from the Xfermode
base class and include one called PorterDuffXfermode
. The PorterDuffXfermode
class is named for Thomas Porter and Tom Duff, who published a paper entitled “Compositing digital images” in the ACM SIGGRAPH Computer Graphics publication in 1984, detailing a series of different rules for drawing images ...
Get Pro Android Media: Developing Graphics, Music, Video, and Rich Media Apps for Smartphones and Tablets now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.