Python Pillow: Rotate Image

 
import os, glob
import sys

from PIL import Image

files = glob.glob('*.png') 

for f in files:
    img = Image.open(f)

    angle = 45

    rotated = img.rotate(angle)
    rotated.save("rotate_" + f)

 

Related Snippets

•  Python Pillow: Resize Image
•  Python Pillow: Crop Image