cannot convert pixels values to image :
from PIL import Image as img
def imgFromPixel(pixel,type,width,height):
im= img.new(type, (width, height))
im.putdata(tuple(pixel))
im.save('test.png')
imgFromPixel(X[0],'LA',20,20)
here, X[0] is an array which stores the value of 400 pixels. But on running this code, I'm getting this error :
self.im.putdata(data, scale, offset)
SystemError: new style getargs format but argument is not a tuple