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-5, your true-color (24-bit) image is pristine in quality but uses several times
more data. When zoomed out (used as a texture map), both images look nearly identical, which is why we
are converting your 24-bit images into 8-bit images, as we can go from 24MB of digital image assets to less
than 8MB with little to no loss of perceived quality of your i3D game board’s texture maps, at least from the
player’s perspective.


Figure 24-5. Undo the indexed color, click the Magnify Glass Tool, and again zoom in 300 percent to see the
(original) true-color data


Use the File ➤ Close dialog, shown in Figure 24-6, to close the indexed image file once you save it into
your /src/8bit folder. Since you opened the 24-bit file from your /src folder, you want to be sure to click
Discard Changes so that you are left with the original 24-bit PNG24 file and your newly exported (saved)
8-bit PNG8 file, each using the same name but kept in a different folder. This is important to pay attention to
at this point in the 120 times you’re going to do this so that you are left with 120 PNG24 files and 120 PNG8
files in a different directory. To change the reference for these images, you simply add an /8bit/filename.
png path change to the indexed color assets folder name that you have created, and the i3D game will then
use these smaller file sizes to texture map your game board squares and quadrants.

Free download pdf