import numpy as np
im = Image.open('segmentace_zkusebni_pi.jpg')
n = np.asarray(im)
shape = n.shape
pixel = list(im.getdata())
# pixel = n.reshape((shape[0]*shape[1], shape[2])).tolist()
# do your work, but make sure the image dimension is kept same
# preferably you should work with numpy array itself
..
..
im2 = Image.fromarray((np.array(pixel, dtype='uint8')).reshape(shape))
im2.show()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…