devbis / st7789py_mpy

Slow micropython driver for 240x240 ST7789 display without CS pin from Ali Express, written in MicroPython
MIT License
78 stars 33 forks source link

"Yellow" bitmap images #6

Open Cyb3rn0id opened 2 years ago

Cyb3rn0id commented 2 years ago

I'm trying to display Bitmaps on the Raspberry Pi Pico using the Waveshare display (https://www.waveshare.com/wiki/Pico-LCD-1.14). I convert a 240x135 image to BMP (24 bits) and then I convert it using imgtobitmap.py. Image appears always yellowish: I mean image looks like the BLUE is missing. I edited the library (st7789py.py) at row 803, maybe it would be

buffer[i + 1] = color & 0xff

instead of

buffer[i + 1] = color_index & 0xff

?

Anyway images still not looks good, even if I chose the maximum value for Bit x Pixel (5, values greater than 5 causes a memory error in Thonny since the generated file is too large).

Cyb3rn0id commented 2 years ago

Attached in the zip file there is a simple bitmap I made having 5 bars (Blue, Red, Green, Black, White) and the py file generated by imagetobitmap.py using 3 BPP, and this is how it appears with your library unmodified:

result

Blue is not present (blue bar is black, the most left, even if don't look full black but very dark blue but maybe is an optical illusion) and white appears yellow (most right bar, probably since only R and G are present). Also the black bar looks not full black but can be an optical illusion due to adiacent colors?.

image.zip

With my edit is even worst... Blue bar appears black and red appears purple, but white bar is correctly displayed:

result2

But blacks looks full black in this case