python - PIL: AttributeError: 'NoneType' object has no attribute 'show' -
i'm trying use pil show image loaded list of numbers.
my entire code looks this:
from pil import image import os, sys l = 4 #resolution increase lr_dim = (2592, 1944) hr_dim = (lr_dim[0]*l, lr_dim[1]*l) hr = [0] * (hr_dim[0] * hr_dim[1]) #include low-res files lr = [] lr.append([[250 x in range(lr_dim[0])] y in range(lr_dim[1])]) img = image.new("l", lr_dim) img = img.putdata(lr[0]) img.show() and got last line , error in title.
what's wrong?
i'm on windows, , using python32 , fresh install of both python , pil.
img.putdata() returns none; alters image in place.
just use:
img = image.new("l", lr_dim) img.putdata(lr[0]) img.show()
Comments
Post a Comment