import numpy as np
import matplotlib.image as mpimg
from PIL import Image
import matplotlib.pyplot as plt
z = Image.open('pig.jpg')
box=(450,450,600,600)
reg = z.crop(box)
reg.show()
reg = reg.transpose(Image.ROTATE_180)
reg.show()
z.paste(reg,box)
z.show()
plt.imshow(z)
import matplotlib.image as mpimg
from PIL import Image
import matplotlib.pyplot as plt
z = Image.open('pig.jpg')
box=(450,450,600,600)
reg = z.crop(box)
reg.show()
reg = reg.transpose(Image.ROTATE_180)
reg.show()
z.paste(reg,box)
z.show()
plt.imshow(z)
plt.show()
http://www.cnblogs.com/way_testlife/archive/2011/04/17/2019013.html