Suppose if I have image img with contents:
[[(255, 255, 255, 255), (0, 0, 0, 255), (0, 0, 0, 255), (0, 0, 0, 255)],
[(0, 0, 0, 255), (255, 255, 255, 255), (0, 0, 0, 255), (0, 0, 0, 255)],
[(0, 0, 0, 255), (0, 0, 0, 255), (255, 255, 255, 255), (0, 0, 0, 255)],
[(0, 0, 0, 255), (0, 0, 0, 255), (0, 0, 0, 255), (255, 255, 255, 255)]]
Is there's any way I can make PIL Image from it?
I tried Image.fromarray(np.asarray(img)) and I got the following error:
TypeError: Cannot handle this data type: (1, 1, 4), <i4
How can I resolve it? Also is there's any solution without the usage of numpy module? Thanks in advance.