OpenGL extension EXT.paletted_texture
This module customises the behaviour of the OpenGL.raw.GL.EXT.paletted_texture to provide a more Python-friendly API
Overview (from the spec)
EXT_paletted_texture defines new texture formats and new calls to support the use of paletted textures in OpenGL. A paletted texture is defined by giving both a palette of colors and a set of image data which is composed of indices into the palette. The paletted texture cannot function properly without both pieces of information so it increases the work required to define a texture. This is offset by the fact that the overall amount of texture data can be reduced dramatically by factoring redundant information out of the logical view of the texture and placing it in the palette.
Paletted textures provide several advantages over full-color textures:
  • As mentioned above, the amount of data required to define atexture can be greatly reduced over what would be needed for full-colorspecification. For example, consider a source texture that has only 256distinct colors in a 256 by 256 pixel grid. Full-color representationrequires three bytes per pixel, taking 192K of texture data. By puttingthe distinct colors in a palette only eight bits are required per pixel,reducing the 192K to 64K plus 768 bytes for the palette. Now add analpha channel to the texture. The full-color representation increasesby 64K while the paletted version would only increase by 256 bytes.This reduction in space required is particularly important for hardwareaccelerators where texture space is limited.
  • Paletted textures allow easy reuse of texture data for imageswhich require many similar but slightly different colored objects.Consider a driving simulation with heavy traffic on the road. Many ofthe cars will be similar but with different color schemes. Iffull-color textures are used a separate texture would be needed for eachcolor scheme, while paletted textures allow the same basic index data tobe reused for each car, with a different palette to change the finalcolors.
  • Paletted textures also allow use of all the palette tricksdeveloped for paletted displays. Simple animation can be done, alongwith strobing, glowing and other palette-cycling effects. All of thesetechniques can enhance the visual richness of a scene with very littledata.
The official definition of this extension is available here: