ptg16476052
Image Formats 199
9
The GIF format is okay for logos, icons, line art, and other simple images. It doesn’t
work as well for highly detailed images because each image can only use a maximum of
256 colors. Photographs in GIF format tend to look grainy and blotchy because the color
palette limits smooth color transitions. The GIF format supports transparency, which
makes it easy to incorporate an image into a larger design, but not alpha transparency.
Alpha transparency, which is supported by PNG, actually blends an image with what’s
behind it and works much better than GIF’s simple transparency (which simply disables
some pixels).
One feature that is unique to the GIF format among web image formats is support for
simple animations. Animated GIFs don’t support sound or playback control, but they can
be embedded on a page without a browser plug-in, so they are assured of working on
mobile devices.
JPEG
JPEG, which stands for Joint Photographic Experts Group (the group that developed it),
is the most popular format for images on the Web. JPEG (pronounced jay-peg) is actu-
ally a method of compressing images that other file formats can use. The file format for
which it’s known is also commonly called JPG.
JPEG was designed for the storage of photographic images. Unlike GIF images, JPEG
images can include any number of colors. The style of compression that JPEG uses (the
compression algorithm) works especially well for photographs, so photographs com-
pressed using the JPEG algorithm are considerably smaller than those compressed using
GIF or PNG. JPEG uses a lossy compression algorithm, which means that some of the
data used in the image is discarded to make the file smaller. Lossy compression works
extremely well for photographic data, but it makes JPEG unsuitable for images that con-
tain elements with sharp edges, such as logos, line art, and type. If you’re working with
photos to display on the Web, you should save them in the JPEG format.
PNG
PNG, pronounced ping, was originally designed as a replacement for GIFs. It stands for
Portable Network Graphics. All current browsers support PNG, and it has some impor-
tant advantages over GIF and JPEG. Like GIF, no data is lost when images are converted
to PNG.
GIF is pronounced jiff, like the peanut butter, not with a hard G as
in gift. Really—the early documentation of GIF tools says so.
NOTE