I am new to PIL, so i was playing around with the functions:
from PIL import Image
import numpy as np
image_array = np.array([
[[0, 0, 0],
[255, 255, 255],
[0, 0, 0]],
[[255, 255, 255],
[0, 0, 0],
[255, 255, 255]],
[[0, 0, 0],
[255, 255, 255],
[0, 0, 0]]])
image = Image.fromarray(image_array)
image.show()
However, when i want to use it, it gives me the following error in the 13th line:
TypeError
Cannot handle this data type: (1, 1, 3), <i8
But surprisingly, it doesn't give me an error when i use image_array = np.array(Image.open('Image.png'))
which is the exact same image with the exact same array:
Image.png
(The image is very small, 3 by 3 pixels)
Nobody else seems to have the same problem, or maybe i'm just missing something