Superimpose and Combine Images

In this project, we’ll superimpose a snapshot on a background image, as we might do with a friend in a photo booth at a carnival. Using the Android’s front-facing camera, we’ll create an app that works like a photo booth, with the small twist that we use scenery loaded from a still resource image as the image’s background instead of the physical backdrop we might find in an actual photo booth. We want to be able to use the app anywhere, independent of our current surroundings or lighting level. This is why we need to separate the foreground image from its background. Using color pixel calculations, we can erase a background image and superimpose a snapshot onto a scene loaded from an image in a resource file. Here ...

Get Rapid Android Development 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.