16 bits RGB color representation

On a screen, each pixel is represented using 16 bits or 2 bytes (1 bytes = 8 bits). Each color has 5 bits allocated to its color depth, but green, which has 6 bits of color depth. This is the RGB565 format.




This can lead to small discrepancies in encoding, when someone wishes to encode the 24-bit color RGB with 16 bits. Green is usually chosen for the extra bit in 16 bits because the human eye has its highest sensitivity for green shades, therefore the discrepancies are harder to see. Note that 16 bits of color utilizes a color palette of 32x64x32 = 65,536 colors.

A few examples of 16 bits colors in C++:

Alternate link

References:
www.willamette.edu/~gorr/, wikipedia.org, learn.adafruit.com

No comments:

Post a Comment