Palette Formats: Difference between revisions
NerdOfEpic (talk | contribs) (Created page with "=== RGB888 === {| class="wikitable" ! 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 === {| class="wikitable" ! 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 |...") |
NerdOfEpic (talk | contribs) No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
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 | ||
|- | |- | ||
! Byte 0 | ! Byte 0 | ||
| R || R || R || R || R || R || R || R | | class="r" | R || class="r" | R || class="r" | R || class="r" | R || class="r" | R || class="r" | R || class="r" | R || class="r" | R | ||
|- | |- | ||
! Byte 1 | ! Byte 1 | ||
| G || G || G || G || G || G || G || G | | class="g" | G || class="g" | G || class="g" | G || class="g" | G || class="g" | G || class="g" | G || class="g" | G || class="g" | G | ||
|- | |- | ||
! Byte 2 | ! Byte 2 | ||
| B || B || B || B || B || B || B || B | | class="b" | B || class="b" | B || class="b" | B || class="b" | B || class="b" | B || class="b" | B || class="b" | B || class="b" | B | ||
|} | |} | ||
R=Red | G=Green | B=Blue | R=Red | G=Green | B=Blue | ||
=== 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 | ||
|- | |- | ||
! Byte 0 | ! Byte 0 | ||
| | | class="r" | R0 || class="r" | R0 || class="r" | R0 || class="r" | R0 || class="g" | G0 || class="g" | G0 || class="g" | G0 || class="g" | G0 | ||
|- | |- | ||
! Byte 1 | ! Byte 1 | ||
| | | class="b" | B0 || class="b" | B0 || class="b" | B0 || class="b" | B0 || class="r" | R1 || class="r" | R1 || class="r" | R1 || class="r" | R1 | ||
|- | |- | ||
! Byte 1 | ! Byte 1 | ||
| | | class="g" | G1 || class="g" | G1 || class="g" | G1 || class="g" | G1 || class="b" | B1 || class="b" | B1 || class="b" | B1 || class="b" | B1 | ||
|} | |} | ||
Even color entrties: | |||
R0=Red | G0=Green | B0=Blue | |||
Odd color entrties: | |||
R1=Red | G1=Green | B1=Blue | |||
=== 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 | ||
|- | |- | ||
! Byte 0 | ! Byte 0 | ||
| R || R || R || R || R || G || G || G | | class="r" | R || class="r" | R || class="r" | R || class="r" | R || class="r" | R || class="g" | G || class="g" | G || class="g" | G | ||
|- | |- | ||
! Byte 1 | ! Byte 1 | ||
| G || G || G || B || B || B || B || B | | class="g" | G || class="g" | G || class="g" | G || class="b" | B || class="b" | B || class="b" | B || class="b" | B || class="b" | B | ||
|} | |} | ||
R=Red | G=Green | B=Blue | R=Red | G=Green | B=Blue | ||
{{#css:User:NerdOfEpic/builtin-palette.css}} |
Latest revision as of 16:54, 22 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 | R0 | R0 | R0 | R0 | G0 | G0 | G0 | G0 |
Byte 1 | B0 | B0 | B0 | B0 | R1 | R1 | R1 | R1 |
Byte 1 | G1 | G1 | G1 | G1 | B1 | B1 | B1 | B1 |
Even color entrties: R0=Red | G0=Green | B0=Blue
Odd color entrties: R1=Red | G1=Green | B1=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