-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RGB565 have inverted channels for display #141
Comments
it seems to work OK on display if bits are swapped like this uint16_t rgbto565(uint8_t r, uint8_t g, uint8_t b) {
return ((b >> 3) << 11) | ((r>>3) << 6) | g >> 2;
} instead of normal RGB565 bit order: uint16_t rgbto5651(uint8_t r, uint8_t g, uint8_t b) {
return ((b>>3) << 11) | ((g>>2) << 5) | r >> 3;
} |
we only set invert rgb to bgr on maixcube maixamigo, but maixduino seems no need to invert anything.(it's benn long time last I play k210, so I can not remember it clearly now, you can find code in MaixPy-v1 repo) |
Now I understand better, if I draw to the LCD, RGB565 is correct |
I've noticed today that display uses wrong colors for RGB565
this is Blue
0b111111 << 10
this is Red
0b11111 << 5
and this is Green
0b11111
So channels are inverted and bit depth also, the correct order would be RGB with Green with 6 bits instead of blue.
Thank you
The text was updated successfully, but these errors were encountered: