A (175)

(Tuis.) #1

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


It is interesting to note that there is the option to use less than 256 colors when compressing
your 8-bit indexed color image. This is usually done to reduce the data footprint even further. For
instance, an image that can attain good results using 32 colors would actually be a 5-bit image,
and thus is a PNG5, even though the format is termed PNG8. The Colors: “spinner” in Figure 9-3 is
where you set this number of colors, and you can set any number from 2 (1-bit color, on or off, black
and white) up to 256 colors (8-bit).


Also, notice that you can set a percentage of dithering to use. I usually select either the 0% or
100% setting, but you could fine-tune your dithering effect anywhere in between those two extreme
values. You can also choose a dithering algorithm type; I use diffusion dithering, as it will yield
a smoother gradient effect along an irregularly shaped gradient, such as the one that you see in
Figure 9-3, on the Audi racecar’s fender.


Dithering, as you might imagine, will add data patterns to an image which are more difficult for a
codec’s algorithm to compress. Because of this, dithering can increase the data footprint by a few
percentage points. Be sure to check the resulting file size with and without dithering applied, and
make sure the dithering provides improved visual results if it adds data weight to the resulting file
size (data footprint).


The final concept that we have learned about so far that can increase the data footprint of the image
is the alpha channel, as adding an alpha channel will add another 8-bit color channel containing
pixel transparency data values to the image being compressed. If you need an alpha channel to
define transparency, in order to support future compositing needs with the image, there is not much
choice but to include this alpha channel data. Just make sure not to use a 32-bit image format to
contain a 24-bit image with an empty (completely opaque, and not defining any transparency) alpha
channel.


Figure 9-3. The dithering effect in an indexed color image with compression set to 32 colors (5-bit color)

Free download pdf