Key | Value |
---|---|
000000000000000000000000 |
00000000000000000000000011111111
Error
This is an example showing how we can use bits to represent colors.
Each pixel’s color is defined by 24 bits. The first 8 bits encode the amount of red in the pixel, the next 8 bits encode the amount of blue, and the next 8 bits encode the amount of green. This is the RGB color scheme.
For example, a black pixel would be encoded by:
00000000
00000000
00000000
because there is 0 red, 0 green, and 0 blue.
A red pixel would be encoded by:
11111111
00000000
00000000
because there is 255 red, 0 green, and 0 blue.
A white pixel would be encoded by:
11111111
11111111
11111111
because there is 255 red, 255 green, and 255 blue.