6.5. Optimizing Bitmaps for Export

Problem

You want to optimize the image quality and file size of bitmap graphics included in .swf files.

Solution

Flash enables you to specify a default optimization setting for bitmap graphics as well as settings for individual graphics.

Discussion

Bitmap graphics can increase the overall file size of a Flash .swf file quickly, so it is important that you minimize their impact on file size as much as possible. To ensure the smallest possible file size, Flash compresses every bitmap included in an .swf file, using either JPEG (Joint Photographic Experts Group) compression or a lossless form of compression, such as PNG (Portable Network Graphic) or GIF (Graphic Interchange Format). The primary difference between the two is that JPEG compression is lossy, while PNG and GIF compression is lossless:

Lossy compression

In this compression process, some information is removed. The more information that is removed, the lower the overall file quality, and the smaller the overall file size. The JPEG format that Flash uses is efficient at minimizing the file size of digital photographs without excess degradation of quality. Lossy compression is applied in degrees—a Quality setting ranging from 0 to 100 determines how aggressively Flash compresses the file. With more compression (that is, lower Quality) comes greater file size savings and greater degradation of image quality.

Lossless compression

In this compression process, all data is preserved; it is just stored ...

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.