russhughes / st7789py_mpy

Driver for 320x240, 240x240, 135x240 and 128x128 ST7789 displays written in MicroPython
MIT License
159 stars 59 forks source link

Display photo yellowing #13

Open a8555 opened 5 months ago

a8555 commented 5 months ago

I converted 240 * 240png and bits to 2 using image_converter. py in the st7789py driver. After displaying the tft. pbitmap (Picture1,0,0) in thorny, what happened to the yellowing of the photo? Other displayed colors are normal What's the matter?

a8555 commented 5 months ago

抱歉,我在提出问题的一周后便解决了问题,但因为考试学业问题耽误了 问题出在st7789py_mpy-master\utils\image_converter.py这个文件中rgb_to_color565这个函数,在RGB888转换成RGB565的时候出了问题 原代码“return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)”应该改为“return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b & 0xF8) >> 3”  ee6ca4d975e5d5d0932b74d00cc39e18

Sorry, I solved the problem a week after raising it, but it was delayed due to academic issues during the exam The problem lies in the file st7789py_mpy master \ utils \ image_converter. py, where the function rgd_to_color565 encountered an issue when converting RGB888 to RGB565 The original code "return (r&0xF8)<<8) | (g&0xFC)<<3) | (b>>3)" should be changed to "return (r&0xF8)<<8) | (g&0xFC)<<3) | (b&0xF8)>>3"