Python 47 Programming Tutorial - Basic Transformations

from PIL import Image

baby = Image.open("baby.jpg")
square_baby = baby.resize((300, 300))
flip_baby = baby.transpose(Image.FLIP_LEFT_RIGHT)
spin_baby = baby.transpose(Image.ROTATE_90)

baby.show()
square_baby.show()
flip_baby.show()
spin_baby.show()

你可能感兴趣的:(Python 47 Programming Tutorial - Basic Transformations)