Thanks for the information.
But that gives the theoretical explanation…
What about this below logic…?
24 bit representation of RGB has RRRRRRRR-GGGGGGGG-BBBBBBBB, 8 bits assigned for each primary color.
If it has to be converted to 16 bit representation, it has to be RRRRR-GGGGGG-BBBBB (5-6-5) like this.
So fetch the color components from 24 bit color representation and shift accordingly to get the 16 bit representation
RRRRRRRR >> 3 --> RRRRR (5)
GGGGGGGG >> 2 --> GGGGGG (6)
BBBBBBBB >> 3 --> BBBBB (5)
There will be loss of color information (as per theory), but i doubt how far this logic is correct?
Verify this page