Traditionally, a palette was a surface where an artist mixed colors before applying them to the canvas. In computer graphics, a palette is somewhat similar. Most graphics programs have a window where you can pick your colors. In certain circumstances, your color choices are limited. Those limited sets of colors also are referred to as palettes .
Palettes are more important when working with GIF images. Because of their limited color depth, GIF images can use only a select palette. This palette, though, can contain a different selection of colors. Sometimes you have control over the selection of the colors and, unfortunately , sometimes you don't.
Problems with Limited Palettes
One problem associated with limited palettes is that, if you choose to work with a limited palette while creating your images, many of the features of your graphics programs will not be available to you. Options such as drop shadows and blurring need to have access to the full range of colors to do their magic. The alternative here is to create your image using higher color depth and then reduce the depth.
How to Build or Select a Palette
When you open an image that uses 4- or 8-bit color, such as a GIF, a limited palette containing the colors in that image is created, and displayed on the Color Palette. A limited palette is also created whenever you reduce the color depth of an image to something below 24-bit. This palette, called the Image Palette, lists the colors available to you for that image. You can open up the Image palette and add, edit, or remove colors from it. Figure 42.16 shows the Edit Palette dialog box from Paint Shop Pro. (You can display this dialog box by choosing Colors, Edit Palette from the menu.)
Figure 42.16. The Edit Palette dialog box.
Double-clicking one of the colors in the Edit Palette dialog box brings up the Color dialog box (see Figure 42.17).
Figure 42.17. The Color dialog box.
You can change the color you double-clicked to any one of 16.7 million other colors. In Paint Shop Pro, just enter the RGB values in the boxes in the lower-right corner of the dialog box. This new color is then available in the palette. Note that the HSL model is available in the Color dialog box, as well.
The exact palette is built from the colors currently being used in an image. If the number of colors exceeds that for the palette you're building, you can change some of the colors to others that are similar or you can allow the program to dither the colors for you. Normally, this becomes an issue only when you need to convert the image to a lower color resolution mode before saving the image.
Most Web browsers use an adaptive palette when loading an image that doesn't fit their own color palettes. There are a few gotchas involved here, though. You'll be okay if all the images share the same palette. If, on the other hand, you have a couple of images that use different palettes, you might find that your images have dithered terribly.
The problem is that while you're working on your images, you're probably working on them one at a time, right? So you create one image, save it, and go on to create the next one. You get this great idea for a different set of colors and create the second image with a completely new color scheme from the first. You then save the image after adjusting the mode appropriately. Still no problem.
You then sign on to the Internet and load your Web page. Oh-oh! The colors on both images look really bad. What happened? Well, what happened is that if the browser is running on an 8-bit setup, it can't show you 256 colors from one image and another 256 from the next. It can display only 256 different colors at one time. This limitation brings us to the dreaded Netscape or Web palette.
The Web palette is the scourge of Web graphics artists the world over. This palette consists of 216 colors that, if used when constructing your images, display your images the same way on every platform.
I say scourge because 216 colors is not very many, and the color choices are abysmal. For example, there are only 6 shades of gray.
Why 216 colors and not 256? Because the operating systemWindows, for exampleand the browserNetscape, let's sayuse 40 colors between them, which leaves 216 colors. This palette is sometimes called the cube , which refers to its being a 6x6x6 cube: six colors wide, six colors high, and six sides (6 times 6 times 6 equals 216).
Because of the popularity of Web graphics, many graphics programs now include a version of the Web palette, Paint Shop Pro included. Although this feature makes the process of creating images that use this set of colors easier, it doesn't change the fact that you are limited to this particular color set.
So, what can you do? One answer is to use your own set of colors, being careful that all your images use the same restricted palette. The other option is to hope that many readers of your pages will be using machines capable of displaying more than 256 colors. This may be a pretty safe bet, considering that most people are using computers that contain graphics cards capable of displaying colors in at least 24-bits.
Of course, you could build your graphics with these limitations in mind and take them into account when the images are really important for navigation around your site.
Loading a Palette
Paint Shop Pro comes with several palettes you can use to create your images, including its Safety (Web) palette. To load one of these pre-made palettes (or an image palette you've saved on your own), follow these steps: