【每日coding】旋转与缩放

def resize_rotate(path):
    from PIL import Image
    import matplotlib.pyplot as plt
    img = Image.open(path)
    img1 = img.resize((500,500))
    img2 = img.rotate(90)
    plt.figure("image",figsize=(15, 8))
    plt.subplot(121)
    plt.imshow(img1)
    plt.subplot(122)
    plt.imshow(img2)
    plt.pause(3)



if __name__ == '__main__':
    path = '../data/imgs/hdrplus.png'
    resize_rotate(path)

 

你可能感兴趣的:(Everyday,code,python)