from PIL import Image
from matplotlib import pyplot as plt
if __name__ == "__main__":
im = Image.open("xx.png")
print("image size: {}".format(im.size))
left = 259 # 与左边界距离
top = 314 # 与上边界距离
right = 48 + left #右边与左边界距离 = left + width
bottom = 50 + top #下边与上边界距离 = top + height
im1 = im.crop((left, top, right, bottom))
plt.imshow(im1)
plt.show()



