home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Book HomeWeb Design in a NutshellSearch this book

21.6. Special Features

You may choose to use a PNG (in that perfect world) for some of its advanced features that no other graphic offers, such as variable transparency levels and full color management systems for automatic image correction, including gamma and color balance corrections.

21.6.2. Gamma Correction

Briefly stated, gamma refers to the brightness setting of a monitor (for more information on gamma, see Chapter 3, "Web Design Principles for Print Designers"). Because gamma settings vary by platform (and even by manufacturer), the graphics you create may not look the way you intend. In general, graphics created on Macs look dark on PCs and graphics created on PCs look washed out on Macs.

PNGs can be tagged with information regarding the gamma setting of the platform on which they were created. This information can then be interpreted by software on the user's end (the browser) to make appropriate gamma compensations. When this is implemented on both the creator and end-user's side, the PNG retains its intended brightness and color intensity.

21.6.3. Transparency

Both 24-bit and 8-bit indexed color PNGs can have variable levels of transparency. This sophisticated transparency function allows for smooth transitions between foreground and background elements. Grayscale images can also have variable transparency. PNGs can also use simple binary transparency (like transparent GIFs), in which a pixel is either totally transparent or totally opaque.

PNGs handle transparency in two ways: using an alpha channel (think of it as a separate layer that keeps track of the transparent areas of the image) or adding transparency information within the index color table for 8-bit palette images. The 8-bit palette transparency results in smaller file sizes for the same effect and is preferable for Web use. Both methods are discussed further below.

As of this writing, the only common tools that allow you to create transparency information in PNGs are Adobe Photoshop (4.0 and higher), Adobe ImageReady, Macromedia Fireworks, the GIMP (an image-editing tool for Unix, Linux, and OS/2), and PaintShop Pro (4.0 and higher). Photoshop currently supports only 24-bit transparency, which results in unacceptably large files. ImageReady and Fireworks both support the more complicated 8-bit, palette-based transparency.

Transparency techniques are discussed in Section 21.7, "Creating PNG Files" section of this chapter.

Bear in mind that even if you manage to make a PNG file with transparency, it may be a challenge finding a browser to display it correctly (particularly the preferable 8-bit indexed color transparency). Refer back to Table 21-1 for browser support information.

Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.