Image File Size

The limitation associated with bitmap file size is the transfer time needed to find and copy an image file from a CD to computer memory (RAM) and display it on the screen. Note that this often must happen simultaneously with other events (such as playing music or responding to keystrokes). You have to take image size into account during the design of your title.

Here's why. It takes a full screen, 256-color image 2 seconds to transfer from the CD to the screen. A full-screen, 16-color bitmap requires at least 1 second of transfer time. You need to consider both the seek time and the transfer time for an image when you define the context in which the image will display. For example, to make the time less noticeable, you can pre-load images into memory while something else is happening (for example, while the user reads text).

The size of the bitmap file directly relates to the number of bits in the image. The following formula shows how to calculate the storage needed for a bitmap:

Size in bytes = (Height x Width x ColorDepth) / 8

Height is the number of pixels displayed vertically
Width is the number of pixels displayed horizontally
ColorDepth is the number of bits of color information stored per pixel

Say you have an full screen bitmap at 1 bit per pixel (black and white only). The display has horizontal resolution of 640 pixels and a vertical resolution of 480 pixels.

Size = (640 pixels x 480 pixels x 1-bit) / 8 = 38,400 bytes

This number represents the storage required for uncompressed images. Scan an identical 8-bit color image, the size substantially increases:

(640 pixels x 480 pixels x 8-bit) / 8 = 307,200 bytes

Obviously, the easiest way to make an image appear quickly is to reduce its size. You can do this by reducing the width/height of your images, or by using images with a lower image depth value. Data compression techniques, such as Run-Length Encoding (RLE), can also be used to reduce the image size.