Creating GIF Images

GIF is the CompuServe® Graphics Interchange Format for image files that most graphical web browsers, including Netscape Navigator, use as their common inline image format. Most of the images used in the WebMagic tutorial pages are GIF images.


File Typing Extension

The MIME typing mechanisms used by your web server and by WebMagic expect GIF images to have the filename extension .gif. Use of any other extension will result in incorrect typing of the file.


Tools for Generating GIF Images

Tools

References


GIF Image Properties and Web Publishing

The following are the main properties of GIF images that make them useful for web pages.

Color lookup table containing up to 256 colors per image

Transparent regions

Interlaced or sequential storage of image pixel rasters

These properties and their use in publishing are discussed below. Use of the Image Works tool for modifying image properties is also discussed.


Color Lookup Tables

GIF images are limited to 256 colors. All of the colors of a full color (24 bits, over 16 million colors) image must be mapped to fit into the limited color lookup table of the image. This small color lookup table allows for small file representations, but does place limits on the quality of the images that can be included inline.

Another consideration is that a web browser and the computer it runs on may have only 256 colors to be used between all applications running on the system. In addition, any one page may have more than one image on it. So, in consideration of these contraints, it is worth while to limit the number of colors used by a GIF image to 16, 64, or 128 colors.

Fortunately, the color lookup table for images can be optimized by the tool generating the GIF version of an image. Also, the image generated can be dithered to make the deficiency of colors less noticable.

Image Works Control of Color Lookup Table and Dithering

The Image Works GIF Options dialog allows you to control the number of colors to use in the color lookup table and whether or not dithering is used. The GIF Options dialog is accessible from Image Works File: Set GIF Options... menu and from its File: Save As... dialog when GIF image output is selected.

Image Works GIF Options Dialog


Transparent Regions

GIF provides for transparent regions in an image by encoding one of the color lookup table entries as a transparent. These transparent pixels allow the background of a web page to show through the regions of the image as illustrated in the two images below.

GIF Image without Transparency

GIF Image with Transparency

Note that different web browsers have different background colors. Attempting to match the background color of a GIF image to the background color of any given web browser to fake transparency will not work across all web browsers.

Image Works Control of GIF Transparency

Image Works provides a GIF Transparency dialog accessible via the GIF Options dialog button Choose Transparency Color... When the dialog is active, you can use the mouse pointer to pick a pixel from the image that is the color of the regions which you want to be transparent. Clicking the left mouse button picks the pixel and makes the corresponding regions transparent.

Image Works GIF Options and GIF Transparency Dialogs


Choosing the Raster Encoding

Tips:

Explanation of tips:

Downloading images over a modem can require a lot of time. The GIF image format encodes images the so that an approximation of the image can viewed while the image is being downloaded. Netscape Navigator uses this capability to incrementally display the image as it is downloaded from a web server.

If an image is encoded with sequential pixel rasters (the rows of picture elements that comprise the image), then the user will see the image rendered from top-to-bottom. If the image is encoded with interlaced image rasters, Netscape Navigator will replicate each raster so that the image appears to display a low-resolution version of the image which becomes progressively higher quality. See the figures below for examples of these two methods.

Interlaced image raster GIF images are useful for rapid navigation of pages which use ISMAP (image map) interactive images; users familiar with the interactive image may not require the complete image to locate the active, linked regions of the ISMAP image. On the otherhand, Netscape Navigator and other web browsers perform their own dithering of images based on their internal colormap. Interlaced image rasters can interact poorly with these dithering algorithms introducing more artifacts (off color pixels) when the image is displayed in the user's browser.

Below are two examples of the same image displayed with half the rasters downloaded - one was encoded with interlaced rasters and one was encoded with sequential rasters. A third image shows what the final version looks like (note that, as mentioned above, the interlaced raster encoding may produce a lower final image quality than sequential raster encoding). The first two images illustrate what the user might see if they are downloading the image over a modem and highlight the benefit of using interlaced encoding versus sequential encoding.

Interlaced raster encoding, half of rasters downloaded

Sequential raster encoding, half of rasters downloaded

Final image, all rasters downloaded

Image Works Control of Raster Encoding

The Image Works GIF Options dialog allows you to control whether the GIF image is encoded with interlaced rasters or sequential. If Use Interlacing is checked, the GIF image will use interlaced rasters; if not checked, sequential rasters are used.

Image Works GIF Options Dialog

To go back to the page you were last on, click on the "Back" button in the Netscape toolbar.


Copyright © 1995 by Silicon Graphics, Inc.