A (175)

(Tuis.) #1

308 CHAPTER 9: Android Graphic Design: Making Your UI Designs Visual


Interestingly, blending modes can be implemented in the Android OS by using Android’s PorterDuff
Class, which is a real tribute to, and an indicator of, the power that lies in the Android software
development API. The PorterDuff class gives developers many of the powerful blending modes that
Photoshop or GIMP 2.8 affords to digital imaging artisans. This class essentially allows Android apps
to implement powerful image compositing features similar to the GIMP or Photoshop. The major
difference, of course, is that you can control the blending modes interactively, using custom Java
programming logic, which is the exciting part for Android developers. Some of the powerful Android
PorterDuff class blending modes include: ADD, SCREEN, OVERLAY, DARKEN, XOR, LIGHTEN,
and MULTIPLY. The Apress Pro Android Graphics title covers how to implement PorterDuff blending
modes inside a complete digital image compositing pipeline, if you are interested in diving into this
graphics compositing and blending area of Android in greater detail.


Masking Digital Imagery: Using Alpha Channels


One of the most popular uses of the alpha channel is to “mask” out an area of a digital image.
This is usually done in order to create a layer which can be utilized in the digital image compositing
layer stack. Masking is the process of extracting subject matter, essentially cutting that subject
matter right out of the image, by placing it (pasting it) onto its own transparent layer. I will show you
how this is done a bit later.


The masking process yields a part of your image on its own layer. The masked subject will be isolated
from the rest of the source image, but because of the layer transparency, will look like it is still in the
final image composite. The power is now you can do things to that subject matter, in GIMP, or later
on in Android, and not have those operations, whatever they may be (rotate, tint, distort, and so forth)
affect the rest of that image. If you export just one of these transparency layers that has subject matter
on it in GIMP or Photoshop, the transparency layer will be converted into an alpha channel.


The masking work process allows you to put image elements (subject material) to use inside of
other images, or in an animation, or to use in a special effects application. Digital imaging software
(Photoshop, GIMP, Painter or Corel Draw) has many tools and features that are specifically there for
use in masking images for use in image compositing. You can’t really do effective image compositing
without creating a mask, so it’s an important area to master for graphic designers.


You can mask automatically, using blue screen or green screen backdrops and computer software
that can automatically extract those exact color values, in order to create a mask using an alpha
channel. You can also mask manually, by hand, using a digital imaging software package, and its
wide array of pixel selection tools.


The most important consideration in the masking process is getting smooth but crisp edges around
your masked object, so that when you “drop it into” a layer over a new background image, it looks as
though it had been photographed there in the first place. The key to this is a proper “selection” work
process. Using digital image software selection tools (and there are a half-dozen of these in GIMP 2.8)
in the proper way, using an optimal work process, is the key to “pulling” a “clean” image mask (more
cool graphics industry terms for you to throw around, to make you appear savvy and professional).


For instance, if there are areas of uniform color around the subject matter you wish to mask, maybe
you shot it using a blue screen or green screen, you can use the magic wand tool along with a
threshold setting to select everything except the object, and then invert that selection set, in order
to obtain a selection set containing the object. Sometimes, the correct way to approach something
is in reverse, as you learned way back in Chapter 3.

Free download pdf