RGB files

see also [[pgm]]

online RGB / RAW pixels viewer

Analyse RGB file with Processing

RGB 565

16 bits color

"MEDIASUBTYPE_565 uses five bits for the red and blue components, and six bits for the green component. This format reflects the fact that human vision is most sensitive to the green portions of the visible spectrum."

decode:

char r = char(((c & 0xF800) >> 11) << 3);
char g = char(((c & 0x7E0) >> 5) << 2);
char b = char(((c & 0x1F)) << 3);

encode:

WORD pixel565 = (red_value << 11) | (green_value << 5) | blue_value;