Netscape Palette Notes

Rich Young, © 1996

Figure 1: Mac palette


Figure 2: Windows "logical" palette


Figure 3: Netscape "palette"

While using Netscape to research palettes for a CD-ROM development class I realized that Web graphics might be different. I asked around, but no one I knew had considered the issue. They did mention a few problems they had encountered though -- one of which is illustrated on this page. The background color is a dark green (hexadecimal 2F4F2F or RGB 47,79,47). However, on the Mac that color is displayed as a dark gray (34,34,34) when viewed in 8-bit/256 color mode. On Windows that green is displayed as a lighter green (51, 102,51).

That's because Netscape remaps color to its own palette, at least partially, to avoid active palette management. But this remapping is is further filtered by each OS's palette manager. On the Macintosh and PC this palette has 216 colors which are a subset of the Mac system palette (see also pages by Victor Engel , Lynda Weinman, and Bob Cunningham). UNIX systems use 125 different colors which we'll try to ignore (see Rick Levine's Sun Technote).

The Netscape "palette" poses problems mainly for backgrounds and flat color images where remapping and dithering of color can significantly impact design. You can load Lynda Weinman's color swatch into Photoshop to use when preparing flat color graphics. Photographic images are probably best saved as full color JPEGs as shown on Lynda's test pages. Predithering doesn't seem to help unless colors are in same palette positions. This may be due to remapping by the palette managers. A little background on palettes may help clarify the situation.

A palette is a table of color values stored just after the header of an indexed graphic file. Pixel data references the palette number (0 to 255) not the RGB value, so changes to the palette require remapping the indexed file data. Sometimes Netscape's default palette is referred to as a 6x6x6 color cube (see Victor Engel and Sun's technote for different views). Even with a basic understanding of color cubes, I found most discussions confusing until I looked closely at the Mac system palette (see figure 1 above). The easiest way to look at the Mac system palette is with Debabelizer's Palette/Palette info/ Show command. This displays shows that the color values are almost evenly distributed. The first 216 values vary by combinations of 51 units in each channel. That is 6 levels of value for Red, Green & Blue (see figure 3) -- so all of the combinations number 216. The last 40 colors fill in gaps in the dark region of the palette by 17-unit intervals (see figure 4). The decision to tilt the gray levels lower was probably made because the human visual response is nonlinear.



Figure 3: an idealized Netscape color cube


Figure 4: Last 62 colors of Mac palette viewed in Debabelizer

Palette management on the Mac and PC is a mysterious process. Microsoft's Windows uses a fixed ("logical") palette of 20 colors in the first 10 and last 10 palette positions (see figure 2). The remaining colors are dropped and added as needed by a foreground application such as Netscape. The MacOS seems to use 21 colors; starting Netscape uses an additional 20 colors. Here's how you can check this: clear the desktop, use the default desktop color, switch to 256 colors, then restart and take a screenshot. I haven't found much on how the Mac manages palettes (game programming books give the best information for both platforms). Perhaps it doesn't matter. There are too many colors and too many uncertainties about palette management to build a perfect cross-platform Web palette. What really matters is smart design and a little color correction, not custom palettes. Shockwave users may be tempted to take control over the entire video LUT (palette) by adding "PALETTE=foreground" at the end of their embed tag. Palette flashing can be distracting, so remember the fewer palettes the better!




Even more links

Optimizing Web Graphics - webreference.com

Netscape's Color Cube revealed

Preparing Images - The Color Cube

Through the 6x6x6 Color Cube: Links

Through the 6x6x6 Color Cube: An Interactive Voyage

Basic Digital Imaging

Poynton's Color links




Back to Synesthetic Media Connections

About Rich Young

Back to MSP HomePage