explaingit

python-pillow/pillow

13,568PythonAudience · developerComplexity · 2/5Setup · easy

TLDR

Pillow is the most-used Python image library, letting you open, resize, crop, convert, filter, and composite images in dozens of formats, JPEG, PNG, GIF, TIFF, WebP, and more, with a simple API.

Mindmap

mindmap
  root((repo))
    What it does
      Open images
      Resize and crop
      Convert formats
      Draw and filter
    Tech stack
      Python
      pip install
    Use cases
      Generate thumbnails
      Batch conversion
      Watermarking
      Visual reports
    Audience
      Python developers
      Web frameworks
      Data scientists
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically generate thumbnails for user-uploaded photos in a web application.

USE CASE 2

Batch-convert a folder of images from TIFF to WebP or any other supported format.

USE CASE 3

Draw text and shapes onto images to produce watermarks or visual reports.

USE CASE 4

Composite multiple images together into a single layered output.

Tech stack

Python

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

Pillow is a Python library for working with images. It is the actively maintained successor to the original Python Imaging Library (PIL), which stopped receiving updates years ago. Pillow adds image processing capabilities to Python programs and is one of the most widely used image libraries in the Python ecosystem, relied on by web frameworks, data science tools, and content management systems. The library can open, manipulate, and save images in a wide range of file formats, including JPEG, PNG, GIF, TIFF, BMP, WebP, and many others. Common operations include resizing, cropping, rotating, flipping, converting between color modes such as RGB to grayscale, drawing shapes and text onto images, applying filters and color adjustments, and compositing multiple images together. These capabilities suit tasks like generating thumbnails automatically, processing user-uploaded photos on a website, creating visual reports, or running batch conversions across large folders of files. Installation is done through pip, Python's standard package manager. Detailed documentation, a handbook with code examples for common tasks, and a guide to supported file formats are hosted on ReadTheDocs. The library is tested across Linux, macOS, and Windows using automated build pipelines, and it participates in a continuous fuzzing program that tests it for crashes and unexpected behavior under unusual inputs. The repository's README is brief and primarily links to the documentation, contribution guide, release notes, and changelog rather than including inline examples. Development is financially supported by Tidelift, Thanks.dev, and GitHub Sponsors. Security vulnerabilities should be reported privately through GitHub's security advisory system rather than in the public issue tracker, to allow time for a fix before disclosure.

Copy-paste prompts

Prompt 1
Using Python Pillow, write a script that resizes all JPEG images in a folder to 800×600 and saves them as WebP files.
Prompt 2
Show me how to use Pillow to add a watermark text in the bottom-right corner of an image and save the result.
Prompt 3
Write a Python script with Pillow that converts a color photo to grayscale, applies a sharpening filter, and exports it as PNG.
Prompt 4
How do I use Pillow to crop the center 50% of an image and then rotate it 90 degrees?
Prompt 5
Using Pillow, write code that composites two images together with 50% opacity blending.
Open on GitHub → Explain another repo

← python-pillow on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.