Game Development Reference
In-Depth Information
will be adding in another 8-bit color channel (or a transparency channel, actually) to
the image being compressed. If you need an alpha channel to define transparency for
your image to support future compositing requirements, such as using the image as a
game sprite, there is not much choice but to include the alpha channel data.
If your alpha channel contains all zeroes (or uses an all-black fill color), which
would define your imagery as being completely transparent, or contains all FF values
(or uses an all-white fill color), which would define your image as being completely
opaque, you would essentially (in practical terms) be defining an alpha that does not
contain any useful alpha data values. The transparent image would therefore need to be
removed, and the opaque image would need to be defined as a PNG24 rather than a
PNG32.
Finally, most alpha channels that are used to mask objects in the RGB layers of the
digital image should compress very well. This is because the alpha channel is primarily
areas of white (opaque) and black (transparent), with some medium-gray values along
the edge between the two colors to antialias the mask (see Figure 5-2 ) . These gray
areas contain the antialiasing values in the alpha channel, and will provide the visually
smooth-edge transitions between the object in the RGB layers of the image and any
background color or background images that may be used behind it.
The reason for this is that in the alpha channel image mask, an 8-bit transparency
gradient (from white to black) defines levels of transparency, which could be thought
of as per-pixel blending (opacity) strength. Therefore, the medium-gray values on the
edges of each object in the mask (which is contained in the alpha channel) will serve
essentially to average the colors of the object edge, and any target background, no mat-
ter what color (or image) value it may contain. This offers real-time antialiasing with
any target background that may be used, including animated backgrounds.
Digital Video and Animation: Frames, Rate, Looping,
Direction
Interestingly, all the concepts that I have just covered for digital images apply equally
well to digital video and animation, as both formats use digital images as the founda-
tion for their content. Digital video and animation extend digital imaging into the
fourth dimension (time) by using frames . The two formats are composed of an
ordered sequence of frames , which are displayed rapidly over time.
The term “frame” comes from the film industry, in which, even today, frames of
film are run through film projectors at a rate of 24 frames per second ( 24FPS ), which
creates the illusion of motion . Because both digital video and animation are made up
Search WWH ::




Custom Search