Most drawings you make in a drawing program convert very well to the GIF format. Photos aren’t ideal because they usually have more than 256 colors in them, and the subtle changes in color mean there are very few solid blotches of color to take advantage of run-length encoding.
GIF does have a couple of great advantages that keep it popular. First, a GIF image can have a transparent color defined. Typically, you’ll choose some awful color not found in nature (kind of like choosing bridesmaid dresses) to be the transparent color. Then, when the GIF encounters a pixel that color, it displays whatever is underneath instead. This is a crude but effective form of transparency. Figure 6-6 shows an image with transparency.
Whenever you see an image on a Web page that doesn’t appear to be rectangular, there’s a good chance the image is a GIF. The image is still a rectangle, but it has transparency to make it look more organic. Typically, whatever color you set as the background color when you save a GIF becomes the transparent color.
Creating a complex transparent background, like the statue, requires a more complex tool than IrfanView. I used Gimp, but any high-end graphics tool can do the job. IrfanView is more suited to operations that work on the entire image.
Figure 6-6: This statue is a GIF with transparency.
Coming soon — vector formats
Here’s another form of image format that I hope will gain more prominence. All the formats described so far are raster-based image formats. This type of image stores an image as a series of dots. Vector-based image formats use formulas to store the instructions to draw an image. Certain kinds of images (especially charts and basic line art) can be far more efficient when stored as vector formats. Unfortunately, IE and Firefox support different and incompatible vector formats, so it doesn’t look like vector-based images will be a factor soon. Flash also uses vector-based techniques, but this technique requires expensive proprietary software to create vector images and a third-party plugin to use them.
The most promising new technology is the