I'm new to Python and I want to create an image from a text file ( it contains tuples of RGB values) That's the code I came up with:
from PIL import Image
img = Image.new( 'RGB', (100,150), "black")
pixels = img.load()
def data():
plik=open("rgb.txt", 'r')
for i in range(img.size[0]):
for j in range(img.size[1]):
pixels[i,j] = (i, j, data)
img.show()
and I get an error in line pixels[i,j] = (i, j, data)
. Why?