Game Development Reference
In-Depth Information
Because you need to have a technical foundation before using any of these types
of new media elements in a Java 8 game design and programming pipeline, I am going
to go over basic concepts for each of these four new media areas, beginning with digit-
al imaging and vector illustration.
Digital Imaging Concepts: Resolution, Color Depth,
Alpha, Layers
JavaFX (and therefore Java8) supports a significant number of popular digital imaging
file (data) formats, which gives game designers a ton of flexibility. Some of these have
been around forever, such as CompuServe's graphics interchange format (GIF) and
the Joint Photographic Experts Group (JPEG) format. Some JavaFX graphics file
formats are more modern, such as portable network graphics (PNG; pronounced
“ping”), which is the file format that you will be using for your games, as it yields the
highest quality level and supports image compositing . All these mainstream digital im-
age file formats supported in Java are also supported in HTML5 browsers, and because
Java applications can be used with HTML applications and web sites, this is a very lo-
gical synergy indeed!
The oldest CompuServe GIF format is the lossless digital image file format. It is
termed lossless because it does not throw away image data to achieve better compres-
sion results. The GIF compression algorithm is not as refined (powerful) as that of the
PNG format, and GIF only supports indexed color , which is how it obtains its com-
pression (smaller file size). If your game image assets are already created with the GIF
format, you will be able to use them with no problem (other than a less efficient image
compression algorithm and no compositing capability) with your Java 8 game applica-
tions.
The most popular digital imaging file format that Java 8 (JavaFX) supports is
JPEG, which uses a “truecolor” color depth, instead of an indexed color depth, as well
as what is termed lossy digital image compression, in which the compression algorithm
“throws away” image data so that it can achieve a smaller file size (the image data are
lost forever, unless you are smart and save your original image!).
If you magnify a JPEG image after compression, you will see a discolored area
(effect) that clearly was not present in the original imagery. The degraded area or areas
in the image are commonly referred to as compression artifacts . This will only occur
in lossy image compression and is common with JPEG (and Moving Picture Experts
Group [MPEG]) compression.
Search WWH ::




Custom Search