Difference between revisions of "Palette"

From Sega Retro

(Added Game Gear format.)
Line 1: Line 1:
  
[[Category:Hacking Information]]
+
A '''palette''' is selection of colours which is used in an image. Rather than defining a colour for each individual [[pixel]] (such as in 24-bit colour images), palettes are used to link pixels to colour data by way of an index reference. Graphics in [[Sega Genesis|Megadrive]], [[Master System]], [[Game Gear]] and [[GameBoy Advance]] games all use palettes.
A selection of colours which is used in an image. Rather than defining a colour for each individual [[pixel]] (such as in 24-bit colour images), palettes are used to link pixels to colour data by way of an index reference. Graphics in [[Sega Genesis|Megadrive]], [[Master System]], [[Game Gear]] and [[GameBoy Advance]] games all use palettes.
 
  
 
According to the Oxford English Dictionary, "palette" didn't appear until the 19th century. "Pallet" is the original, correct spelling. However, both are correct today, and "palette" is more commonly used.
 
According to the Oxford English Dictionary, "palette" didn't appear until the 19th century. "Pallet" is the original, correct spelling. However, both are correct today, and "palette" is more commonly used.
Line 7: Line 6:
  
 
===Megadrive Palette===
 
===Megadrive Palette===
Consists of 16 colours, each represented by two bytes (four [[Nybble|nybbles]]) in the format '''0B GR''', where B = blue; G = green; and R = red. The B, G and R can be any of the following values:
+
Consists of 16 colours, each represented by two bytes (four [[Nybble]]s) in the format '''0B GR''', where B = blue; G = green; and R = red. The B, G and R can be any of the following values:
 
*0 = 0
 
*0 = 0
 
*2 = 32
 
*2 = 32
Line 17: Line 16:
 
*E = 224
 
*E = 224
 
*(and in rare cases, F = 224)
 
*(and in rare cases, F = 224)
Pixels reference these 16 colours using a single nybble. '''0''' refers to the 1st palettte entry (which is normally transparent), '''1''' refers to the second entry, and so on.
+
Pixels reference these 16 colours using a single nybble. '''0''' refers to the 1st palette entry (which is normally transparent), '''1''' refers to the second entry, and so on.
  
 
===Master System Palette===
 
===Master System Palette===
Line 28: Line 27:
  
 
===Game Gear Palette===
 
===Game Gear Palette===
Consists of 16 colours, each represented by two bytes (four [[Nybble|nybbles]]) in the format '''GR 0B''', where G = green; R = red and B = blue. The G, R and B can be any of the following values:
+
Consists of 16 colours, each represented by two bytes (four [[Nybble]]s) in the format '''GR 0B''', where G = green; R = red and B = blue. The G, R and B can be any of the following values:
 
*0/1 = 0
 
*0/1 = 0
 
*2/3 = 36
 
*2/3 = 36
Line 39: Line 38:
  
 
===Gameboy Advance Palette===
 
===Gameboy Advance Palette===
With 256 color indices for 4 backgrounds and 256 color indices for sprites, the [[Gameboy Advance]] uses the BGR555 format (15 bit colors). One color index contains two bytes (5 bits per component): '''0BBBBBGGGGGRRRRR'''. The [[Gameboy Advance]] also has support for RGB mode where one pixel on the screen is represented by the RGB value and not by an index, so you can use images with up to 32768 colors.
+
With 256 colour indices for 4 backgrounds and 256 colour indices for sprites, the [[Gameboy Advance]] uses the BGR555 format (15 bit colors). One colour index contains two bytes (5 bits per component): '''0BBBBBGGGGGRRRRR'''. The Gameboy Advance also has support for RGB mode where one pixel on the screen is represented by the RGB value and not by an index, so you can use images with up to 32768 colours.
 +
 
 +
[[Category:Hacking Information]]

Revision as of 02:39, 14 May 2005

A palette is selection of colours which is used in an image. Rather than defining a colour for each individual pixel (such as in 24-bit colour images), palettes are used to link pixels to colour data by way of an index reference. Graphics in Megadrive, Master System, Game Gear and GameBoy Advance games all use palettes.

According to the Oxford English Dictionary, "palette" didn't appear until the 19th century. "Pallet" is the original, correct spelling. However, both are correct today, and "palette" is more commonly used.


Megadrive Palette

Consists of 16 colours, each represented by two bytes (four Nybbles) in the format 0B GR, where B = blue; G = green; and R = red. The B, G and R can be any of the following values:

  • 0 = 0
  • 2 = 32
  • 4 = 64
  • 6 = 96
  • 8 = 128
  • A = 160
  • C = 192
  • E = 224
  • (and in rare cases, F = 224)

Pixels reference these 16 colours using a single nybble. 0 refers to the 1st palette entry (which is normally transparent), 1 refers to the second entry, and so on.

Master System Palette

Consists of 16 colours, each represented by eight bits (a single byte) in the format 00BBGGRR, where BB = blue; GG = green; and RR = red. The BB, GG and RR can be any of the following values:

  • 00 = 0
  • 01 = 85
  • 10 = 170
  • 11 = 255

As such, the highest palette value is 00111111, which is 3F when converted to a byte.

Game Gear Palette

Consists of 16 colours, each represented by two bytes (four Nybbles) in the format GR 0B, where G = green; R = red and B = blue. The G, R and B can be any of the following values:

  • 0/1 = 0
  • 2/3 = 36
  • 4/5 = 72
  • 6/7 = 109
  • 8/9 = 145
  • A/B = 182
  • C/D = 218
  • E/F = 255

Gameboy Advance Palette

With 256 colour indices for 4 backgrounds and 256 colour indices for sprites, the Gameboy Advance uses the BGR555 format (15 bit colors). One colour index contains two bytes (5 bits per component): 0BBBBBGGGGGRRRRR. The Gameboy Advance also has support for RGB mode where one pixel on the screen is represented by the RGB value and not by an index, so you can use images with up to 32768 colours.