from PIL import Image
im = Image.open("tet.jpg")
pixels = im.load()
x, y = im.size
for i in range(x):
for j in range(y):
r, g, b = pixels[i, j]
pixels[i, j] = min(g, b, r), g, max(r, g, b)
im.save("tet2.jpg")
Message=too many values to unpack (expected 3)
r, g, b = pixels[i, j]