Duplicate Colors In The Quake Palette
I had my computer take a closer look at the contents of palette.lmp, since I wondered whether all the color values are unique. It turns out they are not and there are twelve duplicates.
I show my work here for those who care how this information was obtained:
http://pastebin.com/tSaGppSX
My result is that the following twelve pairs of colors in the palette are the same. The indices are given first, and start from 0.
0 0x000000
48 0x000000
112 0x0b0700
207 0x0b0700
32 0x0b0b0f
223 0x0b0b0f
143 0x0f0707
159 0x0f0707
16 0x0f0b07
175 0x0f0b07
51 0x131300
80 0x131300
142 0x170b0b
158 0x170b0b
52 0x1b1b00
81 0x1b1b00
141 0x231313
157 0x231313
53 0x232300
82 0x232300
76 0x670000
247 0x670000
111 0xfff31b
192 0xfff31b
Indices larger than or equal to 224 are normally fullbright, so this means one color, 0x670000, appears as both non-fullbright and fullbright color and thus the two instances are not technically the same color. Other pairs are made up of two non-fullbright colors which just happen to appear in different places in the palette.
Having 0x670000 be a color of both kinds appears to make automatic conversion of full color images to Quake textures problematic. How can a program tell if a color in the original image that maps most closely to this color is meant to be fullbright or not? You have to pass the information about which pixels should become fullbrights by some other means, I guess.
This may be old news to some folks here, but it was new information to me. I don't know why there are duplicate colors in the palette or if the pairs are handled differently by any engine. If anyone can add anything to this, I'd be interested.