A quick tutorial about palettes, bitmaps, and color.
Computers handle color pictures in one of three ways.
1 Monochrome, bitmapped, and true-color.1. Well, there are actually many ways. The most common three ways are discussed here.
Terminology
Bit – The smallest unit of storage on a computer. A bit is either on or off.
Byte – A group of 8 bits. A byte may have a value of 0 up to 255.
Pixel – The smallest dot that a computer can display.
Bitmap – A picture consisting of pixels.
Bitmap depth – Determines how many colors are in a bitmap. Common depths are 1, 4, 8, and 24. To calculate how many colors are possible in a bitmap, take 2 and raise it to the power of the depth. Common color resolutions are 2, 16, 256, and 16 million. (IE: 4 ^ 2 = 16, a bitmap with a 4 depth may have 16 colors.)
Color mapped bitmap – A bitmap dependent upon a palette in order to display the correct colors. GIF files are an example of these. The file consists of two main parts. Pixel information, and palette information.
True color – A system in which the computer displays millions of colors. Each pixel is unrelated in anyway to other pixels.
Palette – A color table used to describe colors of pixels in a bitmap. Palettes are used when pictures are 1 bit, 4 bit, or 8 bit.
Alpha channel – Used in true color bitmaps to determine the transparency of a given pixel. Also known as the transparency layer.
RGB – the system used to describe and measure the color of a pixel or palette entry. R is for RED, G is for GREEN, and B is for BLUE. When all 3 levels are 0, the color is black. When all 3 levels are 255 (maximum), the color is white.
Monochrome Bitmaps
Also known as two color, black or white and bitmap masks.
KiSS does not use monochrome bitmaps.
Monochrome bitmaps consist of on and off dots. Each dot is either on, or it is off.
If a monochrome bitmap does not have a palette, it is assumed that on is white, and off is black, or vise-versa.
Monochrome bitmaps have very limited use in the present day. Years ago, you would find monochrome bitmaps everywhere. The original Macintosh used monochrome bitmaps only.
Color mapped Bitmaps
Color mapped bitmaps come in two common depths, 16 color (4 bit) and 256 color (8 bit).
Standard KiSS cels use color mapped bitmaps.
KiSS cels do not contain color information.
KiSS cels require a matching KCF file (palette file) to determine which pixel is what color.
Pixels in a color mapped bitmap may have values dependent upon the bitmap depth. 4 bit bitmaps may have values from 0 to 15. 8 bit bitmaps may have values from 0 to 255.
The value of a pixel determines which color is used from the palette (color table).
GIF files are stored as color mapped bitmaps.
PNG files may be stored as color mapped bitmaps.
True Color Bitmaps
True color bitmaps do not require palette information.
True color bitmaps are very large.
True color bitmaps may also have a 4th byte, known as a transparency layer or alpha channel. These bitmaps are known as 32 bit depth.
CherryKiSS cels are 32 bit depth bitmaps. An alpha channel must be present.
JPEG files are stored as true color, well... almost.
PNG files may be stored as true color.
This doesn’t help me at all. I’m still confused.
Let’s try some visual explanations.

Monochrome bitmaps are not used in KiSS. The presence here is only for completeness.
Color mapped bitmap (Paletted bitmap)

A sample color mapped bitmap. This bitmap uses colors from a standard 256 color palette:

Normal KiSS cels are examples of color mapped bitmaps. The raw pixel information is stored in CEL files. The palette is stored in KCF files.
A raw color mapped bitmap is stored like this:
0 3 0 1 2 1 0 5 5 4 1 2 0 0
Now, how is the computer to know what color "0" is? How about a "5"? That is where a palette comes into play. A palette is stored like this:
0-Black, 1-Red, 2-Blue, 3-Forest Green, 4-Olive Green, 5-White
When the computer goes to display our sample bitmap, it uses the palette to decode the bitmap to end up with this:
Black, Forest Green, Black, Red, Blue, Red, Black, White, White, Olive Green, Red, Blue, Black, Black.
You follow?
Now, suppose we change the palette to read like this:
0-White, 1-Red, 2-Blue, 3-Forest Green, 4-Olive Green, 5-Black
The bitmap will now look like this:
White, Forest Green, White, Red, Blue, Red, White, Black, Black, Olive Green, Red, Blue, White, White.
This is not always a good thing. But it can have uses. Suppose, using one palette, you draw clothes in RED. Modify the palette, and the clothes can change to BLUE. But, you might have things you want to stay RED incorrectly change to BLUE. This require s 2 palette entries, even though you use the same color red in both. For example, palette entry 1 could be RED and entry 2 could be RED. In your second palette, entry 1 is still RED, but entry 2 is now BLUE. You draw cels you wish to always be RED in entr y 1, and cels you wish to change from RED to BLUE in entry 2. (I might be getting ahead of myself here. If you don’t follow, don’t worry. This is an advanced topic anyways. Come back after you master the basics…)
Genie had a good example. In cross stitch, patterns use symbols to specify which colors go where. For example, X might be red thread, * might be blue, and O might be green. In a color mapped bitmap, it might be stored like this:
XX*XXXOXX
X***XOOOX
XX*XXXOXX
This would look like this as a bitmap (zoomed)

The bitmap doesn’t say RED,RED,BLUE,RED,RED etc… It only says "XX*XX" etc. The palette is the part the explains what color an "X" is.
If you decide to change the palette to this:
X=PURPLE
*=YELLOW
O=GREEN
The bitmap would look like this. (Remember! The bitmap DID NOT change. Only the palette did.)

Remember, KiSS CELS are equal to bitmaps. KiSS KCF files are equal to palettes.
True Color bitmaps

This is an example of a true color bitmap. Those of you running high-color monitor displays will notice that the gradient is very smooth.
KiSS can use true color bitmaps. These are called Cherry KiSS cels. The discussion of these is beyond the scope of this document.
A true color bitmap is stored like this:
Pixel 1 = 0 RED, 255 GREEN, 128 BLUE
Pixel 2 = 0 RED, 0 RED, 0 RED
Pixel 3 = 125 RED, 43 GREEN, 217 BLUE
Etc…
A true color bitmap does not require a palette. Color information is stored with the pixel information. Actually, they are one and the same.
Using the color swap trick discussed above, suppose you wish to change all black pixel to white, and all white to black. Instead of modifying the palette, you would instead have to scan the ENTIRE bitmap and swap each pixel’s colors.
Back to the Tutorials page