How can I use Python to convert RGB565 byte array to RGB888 byte array?
问题 According to my question for RGB888 to RGB565, I would like to do RGB565 to RGB888, here is my testing code, however I got stuck on convert to RGB888 byte array. import numpy as np np.random.seed(42) im = np.random.randint(0,256,(1,4,2), dtype=np.uint8) # >>> im.nbytes # 8 # >>> im # array([[[102, 220], # [225, 95], # [179, 61], # [234, 203]]], dtype=uint8) # Make components of RGB888 R8 = (im[...,0] & 0xF8).astype(np.uint32) << 8 G8 = (im[...,0] & 0x07).astype(np.uint32) << 5 | (im[...,1] &