Suppose I have a list of pixels (represented as tuples with 3 RGB values) in a list that looks like list(im.getdata()), like this:
list(im.getdata())
[(0,0,0),(255
You can do it like this:
list_of_pixels = list(im.getdata()) # Do something to the pixels... im2 = Image.new(im.mode, im.size) im2.putdata(list_of_pixels)