There are two files for testing: lena.png (exported with default GIMP settings) and lena2.png
from xgoscreen import LCD_2inch
lcd = LCD_2inch.LCD_2inch()
lcd.Init() #1
from PIL import Image
im = Image.open("lena.png")
lcd.ShowImage(im)
File /usr/lib/python3.11/site-packages/xgoscreen/LCD_2inch.py:145, in LCD_2inch.ShowImage(self, Image, Xstart, Ystart)
143 pix = self.np.zeros((self.width, self.height,2), dtype = self.np.uint8)
144 #RGB888 >> RGB565
--> 145 pix[...,[0]] = self.np.add(self.np.bitwise_and(img[...,[0]],0xF8),self.np.right_shift(img[...,[1]],5))
146 pix[...,[1]] = self.np.add(self.np.bitwise_and(self.np.left_shift(img[...,[1]],3),0xE0), self.np.right_shift(img[...,[2]],3))
147 pix = pix.flatten().tolist()
ValueError: shape mismatch: value array of shape (240,1) could not be broadcast to indexing result of shape (240,320,1)
There are two files for testing: lena.png (exported with default GIMP settings) and lena2.png
Code to reproduce the issue:
the output: