Palette Formats: Difference between revisions

From NerdConsole
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
Most of the time NerdConsole operates in true 24-bit RGB888 color. There is one special graphics mode that trades that for 12-bit RGB444 color for the purposes of packing even more colors onto the screen.
=== RGB888 ===
=== RGB888 ===
This format takes 3 bytes of data per color granting access to 16,777,216 possible colors.
{| class="wikitable"
{| class="wikitable"
! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0
! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0
Line 15: Line 18:


=== RGB444 ===
=== RGB444 ===
This format takes 1.5 bytes of data per color granting access to 4,096 possible colors. This format interleaves 2 colors for every three bytes of palette data.
{| class="wikitable"
{| class="wikitable"
! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0
! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0
Line 30: Line 34:


=== RGB565 ===
=== RGB565 ===
Some bitmapped graphics mode use the RGB565 mode to reduce the number of bytes needed per pixel to 2 while still providing 65,536 colors.  Human eyes can see varying levels of green better than red or blue, so the extra bit is used for green.
{| class="wikitable"
{| class="wikitable"
! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0
! Bit !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0

Revision as of 23:13, 13 January 2024

Most of the time NerdConsole operates in true 24-bit RGB888 color. There is one special graphics mode that trades that for 12-bit RGB444 color for the purposes of packing even more colors onto the screen.

RGB888

This format takes 3 bytes of data per color granting access to 16,777,216 possible colors.

Bit 7 6 5 4 3 2 1 0
Byte 0 R R R R R R R R
Byte 1 G G G G G G G G
Byte 2 B B B B B B B B

R=Red | G=Green | B=Blue

RGB444

This format takes 1.5 bytes of data per color granting access to 4,096 possible colors. This format interleaves 2 colors for every three bytes of palette data.

Bit 7 6 5 4 3 2 1 0
Byte 0 R R R R G G G G
Byte 1 B B B B R R R R
Byte 1 G G G G B B B B

R=Red | G=Green | B=Blue

RGB565

Some bitmapped graphics mode use the RGB565 mode to reduce the number of bytes needed per pixel to 2 while still providing 65,536 colors. Human eyes can see varying levels of green better than red or blue, so the extra bit is used for green.

Bit 7 6 5 4 3 2 1 0
Byte 0 R R R R R G G G
Byte 1 G G G B B B B B

R=Red | G=Green | B=Blue