Professional Documents
Culture Documents
Combining four one-bit planes into a final "four bits per pixel" (16-color) image
Contents
1Examples
2Advantages and disadvantages
3See also
4References
Examples[edit]
On a chunky display with 4-bits-per-pixel and a RGBI palette, each byte represents two pixels, with
16 different colors available for each pixel. Four consecutive pixels are stored in two consecutive
bytes as follows:
Byte index 0 1
Byte value
0x01 0x23
(hexadecimal)
Nybble value (binary) 0000 0001 0010 0011
Gree
Resulting pixel Black Blue Cyan
n
Whereas a planar scheme could use 2 bitplanes, providing for a 4 color display. Eight pixels would
be stored as 2 bytes non-contiguously in memory:
Plane 0 0 1 0 1 0 0 0 0 0x50 80
Plane 1 0 0 1 1 0 0 0 0 0x30 48
Resulting
0 1 2 3 0 0 0 0
pixel
In the planar example, 2 bytes represent 8 pixels with 4 available colors, where the packed pixel
example uses 2 bytes to represent fewer pixels but with more colors. Adding planes will increase the
number of colors available at the cost of requiring more memory. For example, using 4 planes
makes 24=16 colors available, but it would then take 4 bytes to represent 8 pixels (making it
equivalent in terms of memory usage and available colors to the packed arrangement example).