Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 24 ■ Optimizing game assets and COde, and game prOfiling Using netBeans


As you can see in Figure 24-10, I have now finished these 8-bit images for your game board squares as well.

Figure 24-10. Go into the /src/8bit folder and select all 60 images; right-click the selection and open
Properties


As you can see in Figures 24-7, 24-9, and 24-10, the smaller these indexed color images get, the more
they look identical to the true-color images, even though they are several times (three to four) smaller in
many instances! We are covering optimizing images to 8-bit (indexed) color in this first part of the chapter
because it is an effective way to reduce the distribution file data footprint (the size of the image assets in your
package of code and assets).
Some of these images, such as the red bell pepper, for instance, will work extremely well with indexed
color, as the spectrum of red, a white background, and a green border color can come very close to
representing a true-color image using only 256 colors and subtle dithering between closely matched colors,
which you can’t even see when zoomed in. Figure 24-11 shows the true-color and indexed image results
(from the type of selection shown in Figures 24-9 and 24-10) for the quadrant texture maps (left half ) and the
square texture maps (right side).

Free download pdf