weballey logo
left Web design - palettes backnext right
homesearchsite mape-mail





< palettes >
web palette

      I once saw my first home page on a different computer than my own. It looked awful: wrong colors and a smudged background, it looked terrible. Also other familiar sites looked quite ugly. What seemed to be the problem? Nothing really: it was a computer with a standard VGA screen showing only 256 colors. Graphics using more colors are not displayed correctly on such a monitor. The computer replaces colors it cannot display with the one closest to it.
    You should seriously take this problem into account. Graphics may look different on another computer. And different means probably worse. A lot of computers can only display a limited number of colors, mostly 256. Graphics which look great at 16 or 24 bit color, can look really bad at 8 bits. A lot of computers still use 256 color screens.
    But this is not all there is to tell. A lot of video cards use palettes. Graphics consist of information on what color to display at a certain point in the image. In the file that contains the image, there will be a palette at the start of the file. After that for every point in the image you'll find a reference to the palette. Thus limiting the size of the file.
    The palette may contain the standard VGA colors. Or any different or custom palette to render the image the best possible way. An image with a lot of shades of brown and yellow does not need the colors red green or blue. Using an adaptive palette you can still get surprisingly good results. If an image contains a limited number of colors, you can shrink the file size by making the palette smaller. You can use any number of colors between 2 and 256. The next page shows some examples.
left Copyright © Gerben Hoekstra - All rights reserved backnext right