5 bit rgb : 31 = 8 bit rgb : 255
so 8 bit rgb = (5 bit rgb * 255 / 31)
Example:
5 bit RGB = 12,3,21
8 bit R = (12 * 255) / 31 = 99
G = (3 * 255) / 31 = 25
B = (21 * 255) / 31 = 172
PS: I think you mean "5 bit RGB to 8 bit RGB" in your title.
source
share