master
LEdoian 3 years ago
parent 3383699269
commit 646089eaaa

@ -36,6 +36,7 @@ class Picture:
def load(cls, filename): def load(cls, filename):
from PIL import Image from PIL import Image
im = Image.open(filename) im = Image.open(filename)
im = im.convert('RGB')
ht = im.height ht = im.height
wt = im.width wt = im.width
data = [] data = []
@ -43,7 +44,7 @@ class Picture:
for x in range(wt): for x in range(wt):
line = [] line = []
for y in range(ht): for y in range(ht):
line.append(Pixel(*(access[x, y][:3]))) line.append(Pixel(*(access[x, y])))
data.append(line) data.append(line)
result = cls(data) result = cls(data)

Loading…
Cancel
Save