from PIL import Image image = Image.open("/path/to/image.jpg") image.rotate(90).show() image.save("/path/to/rotated_image.jpg")