RGB565 1D array to 3d RGB image
Question:
Answers:
this solves my problem
And here’s the code:
length = 76800 # 320*240
one = [46888] * length # this would be the list of 76800 16bit RGB565 values
xdim = 320
ydim = 240
im = Image.new("RGB",(xdim,ydim))
for y in range(ydim):
for x in range(xdim):
px = one[i]
i = i+1
im.putpixel((x,y),((px&0xF800) >> 8, (px&0x07E0) >> 3, (px&0x001F) << 3))
this solves my problem
And here’s the code:
length = 76800 # 320*240
one = [46888] * length # this would be the list of 76800 16bit RGB565 values
xdim = 320
ydim = 240
im = Image.new("RGB",(xdim,ydim))
for y in range(ydim):
for x in range(xdim):
px = one[i]
i = i+1
im.putpixel((x,y),((px&0xF800) >> 8, (px&0x07E0) >> 3, (px&0x001F) << 3))