142 CHAPTER 5: Textures^
Figure 5-12. Stretching a texture across many faces
Image Formats
OpenGL ES supports many different image formats, and I’m not talking about PNG vs.
JPEG, but I mean the form and layout in memory. The standard is 32 bits, which assigns
8 bits of memory each for red, green, blue, and alpha. Referred to as RGBA, it is the
standard used for most of the exercises. It is also the ‘‘prettiest’’ because it provides
more than 16 million colors and translucency. However, you can often get away with 16-
bit or even 8-bit images. In doing that, you can save a lot of memory and crank up the
speed quite a bit, with careful selection of images. See Table 5-1 for some of the more
popular formats.
Table 5-1. Some of the More Popular Image Formats
Format Details
RGBA 8 bits per channel, including alpha.
RGB 8 bits per channel, no alpha.
ALPHA A single 8-bit channel used for stencils.
LUMINANCE A single 8-bit channel for grayscale images.
RGB565 16 bits total: 5 for red, 6 for green, and 5 for blue. The green is given a little more
color fidelity because the eye is more sensitive to that than to either red or blue.
RGBA4444 16 bits, 4 for each channel.
RGBA5551 5 bits per color channel, and 1 for alpha.