What is bitmap palette?

I've been reading about bitmap file format in wikipedia, but i don't understand what the palette really does.
The wiki says
The palette is a block of bytes (a table) listing the colors available for use in a particular indexed-color image. Each pixel in the image is described by a number of bits (1, 4, or 8) which index a single color in this table. The purpose of the color palette in indexed-color bitmaps is to tell the application the actual color that each of these index values corresponds to.
http://en.wikipedia.org/wiki/BMP_file_format

1. So it tells the application the color of the image? How?
2. What does he mean by "index"? (English problem)
3. So what's the bit pattern of the color palette? (please answer in layman's term or easy to understand)
3. Does every image defines its own unique color palette?

This bothers me since i always encounter color palette in game programming, photoshop and some other stuff without really understanding it.

PS: I've been googling for ages.

thanks for the help
Windows bitmaps have a different internal layout depending on their color depth (num of colours).
But concentrating on the formats that use an indexing scheme ( i believe 256 colour bitmaps uses this method but I would have to consult the manual to be sure) - the bitmap file consists of two parts.

1. A byte array representing the pixels in the bitmap.
2. An array of colour values used in the bitmap (this is where the palette thing comes in).

So if you have a 10x10 pixel bitmap. The pixel array is 10x10 bytes. lets say the first byte (0,0) has the value 23. This says that the colour of this pixel of the bitmap is the colour value specified in index 23 in the colour value (palette) array.

So every bitmap carries a list (one way or another) of all the colours used in the bitmap.


thanks for answering, but where can i get the manual? so i can read it on my own and not to bother people?
When I say manual - I meant my windows programming book (petzold) - but this could be a starter..
http://www.digicamsoft.com/bmp/bmp.html
oh i see, the book written by a man with windows logo tattoo right?

thanks again.. you really help me a lot..
Topic archived. No new replies allowed.