A (175)

(Tuis.) #1

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


The best way to get good anti-aliasing is to use a proper image masking work process, and using
the proper settings for any given selection tool that you might be using. One of the other tricks to
implementing your own anti-aliasing is to use a Gaussian Blur tool with a very low blur value
(0.15 to 0.35) on the (transparency) layer containing the object which has the jagged edges. This will
provide the same effect that you see in Figure 9-1, and not only that, it will “blur” the transparency
values for the alpha channel (mask) itself as well, allowing you to anti-alias that image object with
any background imagery you may be attempting to seamlessly composite it against. I will be
showing you these techniques using GIMP during the rest of the book, so get ready to learn!


Optimizing Digital Images: Compress and Dither


There are a number of technical factors which affect digital image compression, which is the
process of using a “codec,” which is short for COder-DECoder and is an algorithm which looks at
your image data and finds a way to save it out as a file which uses significantly less image data.
The codec’s encoder essentially finds “data patterns” in an image, and then turns these data
patterns into a form of data that the decoder part of a codec can reconstruct the original image
from, many times with zero loss of image quality.


There are some approaches which you can use to get a better quality image compression result,
which will result in a smaller file size, along with higher image quality. An image with a small file size
and a high level of quality can be said to have a highly optimized data footprint. This is a primary
objective in optimizing digital imagery, to get the very smallest data footprint possible, while at the
same time achieving the highest-quality visual end result.


Let’s start out by discussing all of the digital image attributes that affect the image data footprint
the most, and later we can examine how each of these aspects will contribute to the data footprint
optimization for any given digital image. Interestingly, the order of aspects that are important to data
footprint optimization are similar to the order of the digital imaging concepts which we have covered
thus far during this chapter.


The most critical contributor to the resulting image file size (that is, data footprint) is the number of
pixels or the resolution of the digital image. This is logical because each of these pixels needs to be
stored, along with the color values for each of the pixel’s (RGB) color channels. Thus, the smaller
you can make the image resolution, while still having the image still look detailed, the smaller the
resulting file size will be, because there’s less data that needs to be compressed.


You can calculate the raw uncompressed image size using the formula: Width times Height times
Color Channels, so for 24-bit RBG images, there are three (RGB) color channels, and there are four
(ARGB) color channels for a 32-bit image. Thus, an uncompressed, truecolor (24-bit) VGA image will
have 640 times 480 times 3, equaling 921,600 bytes of original uncompressed data. If you divide
921,600 by 1024 (the number of bytes in a kilobyte), this will give you the number of kilobytes
(K or KB) which are in a raw VGA image, and that number is an even 900KB.


As you can see, image color depth is therefore the next most critical contributor to a data footprint
of an image, because the number of pixels in that image is multiplied by 1 (8-bit) or 2 (16-bit) or 3
(24-bit) or 4 (32-bit) color data channels. This is one of the reasons indexed color (8-bit) images are
still being widely utilized, usually via the PNG8 image format, which features a superior lossless
compression algorithm to the one that the outdated GIF format utilizes. Lossless compression
algorithms like PNG lose zero image data (quality), whereas a lossy compression algorithm,
such as JPEG, throws away data, and therefore some of the image quality, to achieve more data
compression at the expense of the visual quality result.

Free download pdf