Game Development Reference
In-Depth Information
Digital Image Masking: Using Alpha Channels to Create
Game Sprites
One of the primary applications for alpha channels in game design is to mask out areas
of an image or animation (series of images) so that it can be used as a game sprite in a
game play image-compositing scenario. Masking is the process of cutting subject mat-
ter out of a digital image so that the subject matter can be placed on its own virtual lay-
er, using alpha channel transparency values. This is done using a digital imaging soft-
ware package, such as GIMP.
Digital image-compositing software packages, such as Photoshop and GIMP, fea-
ture tools that are included for use in masking and image compositing. You cannot do
effective image compositing without doing effective masking, so this is an important
area to master for game designers who wish to integrate graphics elements, such as im-
age sprites and sprite animation, into their game designs. The art of digital image
masking has been around for a very long time!
Masking can be done for you automatically, using professional blue screen (or
green screen) backdrops, along with computer software that can automatically extract
those exact color values to create a mask, which is turned into alpha channel (transpar-
ency) information (data). Masking can also be done manually, using digital image soft-
ware, via one of the algorithmic selection tools, in conjunction with various sharpening
and blur algorithms.
You will learn a lot about this work process over the course of this topic, using
common open-source software packages, such as GIMP. Masking can be a complex
and involved work process. This chapter is intended to expose you to foundational
knowledge that will underlie the processes you undertake while working through the
book.
A key consideration in the masking process is getting smooth, sharp edges around a
masked object (subject matter). This is so that when you place a masked object (in this
case, a game sprite) into (over) new background imagery, it looks as if it were photo-
graphed there in the first place. The key to doing this successfully lies in your selection
work process, which entails using digital image software selection tools, such as the
scissors tool in GIMP, or the magic wand tool in Photoshop, in the proper fashion.
Choosing the correct work process is critical!
For instance, if there are areas of uniform color around the object that you wish to
mask (maybe you shot it against a blue screen), you will use a magic wand tool with a
proper threshold setting to select everything except your object. Then, you invert the
selection , which will give you a selection set containing the object. Often, the correct
Search WWH ::




Custom Search