Game Development Reference
In-Depth Information
Figure 5-4 . Setting dithering to the diffusion algorithm and 32 colors (5 bit), with 100 percent dithering for PNG5
output
Also, note that you can set the percentage of dithering that is used. I often select
either the 0 percent or 100 percent setting; however, you can fine-tune the dithering ef-
fect anywhere between these two extreme values. You can also choose between dither-
ing algorithms , because, as you probably have surmised, the dithering effect is created
using dithering algorithms, which are part of the indexed file format (in this case,
PNG8) compression routines.
I use diffusion dithering, which gives a smooth effect along irregularly shaped
gradients, as is seen in the car fender. You can also use a noise option, which is more
randomized, or a pattern option, which is less so. The diffusion option usually gives
the best results, which is why I choose it when I am using indexed color (which is not
often).
Dithering, as you might imagine, adds data patterns to an image that are more diffi-
cult to compress. This is because smooth areas in an image, such as gradients, are easi-
er for the compression algorithm to compress than sharp transitions (edges) or random
pixel patterns (e.g., dithering or “noise” from a camera CCD).
Therefore, applying the dithering option will always increase the data footprint by a
few percentage points. Be sure to check the resulting file size with and without dither-
ing applied (selected in the Export dialog) to see if it is worth the improved visual res-
ult that it affords. Note that there is also a transparency option (check box) for indexed
color PNG images but that the alpha channel used in PNG8 images is only 1 bit (on/
off), not 8 bit, as with PNG32.
You can also increase the data footprint of your image by adding an alpha channel
to define transparency for compositing. This is because by adding an alpha channel you
 
Search WWH ::




Custom Search