from PIL import Image # Open an image and rotate it 90 degrees with Image.open("my_photo.jpg") as img: img.rotate(90).save("rotated_photo.jpg") Use code with caution. Copied to clipboard
Pillow allows you to manipulate images programmatically with just a few lines of code: pytilan
Seamlessly read and save images in formats like JPEG, PNG, GIF, and WebP. from PIL import Image # Open an image
Apply built-in filters for sharpening, blurring, or color balancing. Easily resize, rotate, and crop images to fit
Easily resize, rotate, and crop images to fit specific dimensions.
To add imaging capabilities to your project, you can install the library via pip : pip install pillow Use code with caution. Copied to clipboard
The Python Imaging Library (PIL) was the original standard for image processing in Python but was discontinued in 2011. Today, developers use , a "friendly fork" that supports Python 3 and adds numerous features for modern workflows. Core Capabilities