SUN GUIDE TO WEB STYLE TECHNOTE


    Graphics: Netscape Color Tables


    What are color tables?

      Netscape navigator (and many other application programs) has a pre-defined set of colors, or color table that it uses to display images in HTML pages. If a color used in an image is not found in the color table, the software will either substitute a color from the color table which is similar to the color specified in the image, or it will dither the colors to approximate the desired color. A color which is "dithered" will appear to be made up of pixels of two colors, which blend together visually to approximate the desired color.

      Here are two examples. The colors in the first bar should appear as "pure" colors. When viewed on computers with 8-bit (256-color) display hardware, each of the colors in the second bar should be rendered as a mix of two other colors.

        Undithered colors

        Undithered color swatches

        Dithered colors

        Dithered color swatches

        In Netscape Navigator 2.0, these color swatches may not be dithered if the "automatic" color policy is selected in preferences on UNIX and PC platforms. Set it to "dithered" to see the difference.

      Netscape Navigator 2.0 allows a person to set a color policy in their application preferences. The default setting is "automatic." In this mode, the browser will use an algorithm to decide if colors should be dithered, or if "close" colors should be substituted. In addition, the software may load a custom color table for a particular image, if that image is the only one on a page. (As far as I can tell, Netscape Navigator will not dither colors in background images.)

      Dithering can reduce the quality and legibility of an image. To avoid dithering, authors can create images which use the colors specified in the browser's built-in default color table. If this is done, the colors will be rendered without dithering.

      The only problem with this approach is that versions Netscape Navigator running on PC/Macintosh platforms use a different default color table than do some UNIX versions of the software. Compounding the problem is that the differing color tables have very few color values in common. If color dithering will be a large page quality issue for your documents, you must either choose the color table which will be used by the majority of your audience, or use server-side automation and scripting to provide a platform-specific image to your audience, based on the version of their browser.

      The next two sections provide images which use the complete default color tables from the PC/Macintosh and UNIX versions of Netscape Navigator 2.0.

    PC color table

      PC/Macintosh color table This image shows the 6x6x6 color "cube" used by PC and Macintosh versions of Netscape Navigator on 8-bit (256 color) display hardware.

      The colors in the table use RGB values of hex 00, 33, 66, 99, cc and ff. The decimal values for Photoshop and other applications are 0, 51, 102, 153, 204, and 255. To use the color table from this image, save the image to a file on your computer, open it in an image editor, such as PhotoShop, and either save the color table to a file for re-use, or otherwise create images with the same color table.

      On many 8-bit (256 color) UNIX platforms, the colors in this table will be dithered.

    UNIX color table

      UNIX color table This image shows the 5x5x5 color "cube" used by some UNIX versions of Netscape Navigator on 8-bit (256 color) display hardware.

      The colors in the table use RGB values of hex 00, 40, 80, bf, and ff. The decimal values for Photoshop and other applications are 0, 64, 128, 191 and 255. To use the color table from this image, save the image to a file on your computer, open it in an image editor, such as PhotoShop, and either save the color table to a file for re-use, or otherwise create images with the same color table.

      On many 8-bit (256 color) PC and Macintosh platforms, the colors in this table will be dithered.


    GUIDE TO WEB STYLE Comments or suggestions?
    ©1995 Sun Microsystems, Inc.
    Rick Levine
    14-MAR-96