Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Pillow

Resize, crop and convert pictures in Python.

Files, images and mediaPYPI

GitHubWebsite

1. License

“Permission to use, copy, modify and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies”

Any use without a fee; keep the copyright and permission notice with copies.

github.com/python-pillow/Pillow/blob/main/LICENSE

From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error

What Pillow does

Pillow is a free Python library for working with pictures. Your app can open a photo someone uploads, turn it upright, make a small preview and crop a square avatar. It can also draw text on it and save it as JPEG, PNG or WebP. It is the maintained successor of the old PIL library, so code still says "from PIL import Image".

What people build with it

Previews of uploaded photos

A shop or blog lets people upload big phone photos; your app keeps a small copy for lists and galleries so pages load fast.

Square avatars from any photo

New users upload a photo of any shape; your app cuts a centred square and saves it at one fixed size for profile pictures.

Smaller files in WebP

Turn the JPEG and PNG pictures of a site into WebP files that weigh less, for example during a build or right after upload.

Text and shapes on pictures

Write a title on a share picture, put a small mark in the corner of photos, or draw a simple badge for each user.

Read photos straight from memory

Your web app gets the uploaded file as bytes and opens it without saving it to disk first.

Strip location data before publishing Idea

Photos from phones can carry the place and time they were taken; your app saves a clean copy before it shows the photo to others.

Pillow popularity

82 / 100
Gid Score, #73 overall
162M
downloads a week, pypi
14K
GitHub stars
239
agent projects use it
Pillow: downloads per weekPyPI, pillow 161,981,570
Pillow: GitHub starspython-pillow/Pillow 14,010

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Pillow is used

  • Pillow is a dependency in 239 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (14.7% of the 1,623 Python ones), #2 of 281 in files, images and media.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 2,076; those are left out of every share on this page.
  • The most used alternative in our scan is OpenCV Python (44 projects).
  • Projects that use it most often also use python-dotenv (45.6%), Pydantic (43.5%), Uvicorn (43.5%).
  • It is more common in projects set up for OpenClaw (8.1%) than for OpenCode (1.7%).

By coding agent

118 projects, 3.6%
116 projects, 3.8%
75 projects, 3.1%
27 projects, 8.1%
15 projects, 3.2%
11 projects, 2.3%
9 projects, 3.2%
6 projects, 1.7%

Often used with

In 45.6% of its projects
In 43.5% of its projects
In 43.5% of its projects
In 42.3% of its projects
In 40.6% of its projects
In 38.9% of its projects
In 33.5% of its projects
In 29.7% of its projects

Pillow in practice

Strengths

PIL's official heir on PyPI

The site's timeline puts the fork in 2010. Its 2013 entry says PIL had seen no releases since 2009 and that Debian and Ubuntu had adopted Pillow in its place. In 2020 PyPI moderators declared the original PIL package abandoned under PEP 541.

A core tuned for a few pixel formats

The README says the core image library is designed for fast access to data in a small set of basic pixel formats. The maintainers present this as a base for general image processing tools.

Sits under a huge number of projects

The website says Pillow is a dependency of over two million repositories and over 30K packages. Its examples include Matplotlib, which uses Pillow to read and write formats such as JPEG when saving figures.

Written incident and threat docs

The documentation section of the 12.3.0 changelog adds an <code>INCIDENT_RESPONSE.md</code> file and a STRIDE threat model to the security docs.

Watch out for

Five named people, all volunteers

The site lists Jeffrey 'Alex' Clark as founder and maintainer, three core maintainers and a sponsorship coordinator. It says the work happens in their spare time and asks businesses that rely on Pillow to sponsor it.

No license in these sources

GitHub's repository metadata reports the license as None. None of the other pages here names one either. Confirm the license yourself before you ship.

12.3.0 drops ImageCms modes

Release 12.3.0 has a Removals section that removes non-image ImageCms modes. Code that relied on those modes needs changes before it can move to this version.

More about Pillow

Funding
  • GitHub Sponsors: https://github.com/python-pillow
  • Tidelift: https://tidelift.com/funding/github/pypi/pillow
  • 3 GitHub sponsors

See all

Packages around it
  • numpy: Arrays
  • requests: HTTP client
  • python-dotenv: .env config
  • pydantic: Data validation
  • uvicorn: ASGI server
  • fastapi: Web API framework
More in Files, images and media

Alternatives

Pillow This page

MIT-CMUGid 82162M/wk

Sharp

Pick sharp when your app runs on Node.js rather than Python; it resizes and converts JPEG, PNG, WebP and GIF.

pyvips

Pick pyvips for very large pictures or big batches in Python, where low memory use matters.

OpenCV Python

Pick OpenCV when you need computer vision (finding faces, edges, objects, video frames) rather than plain resizing and converting.

Apache-2.0Gid 658.1M/wk

Compare Pillow with another tool

Get started

Tell your AI assistant

“Use the Python library Pillow (pin pillow==13.0.0, Python 3.11+) to open each uploaded photo with an allowlist of formats, turn it upright with ImageOps.exif_transpose, save a 300x300 thumbnail and a 256x256 square avatar as WebP.”

  1. Install Pillow into your project's Python environment (Python 3.11 or newer for Pillow 13).

    python3 -m pip install --upgrade pip
    python3 -m pip install --upgrade Pillow
    

    From pillow.readthedocs.io/en/stable/installation/basic-installation.html

  2. Open a picture. The import name is PIL, not pillow.

    from PIL import Image
    im = Image.open("hopper.ppm")
    

    From pillow.readthedocs.io/en/stable/handbook/tutorial.html

  3. Make a thumbnail that keeps the picture's shape.

    From pillow.readthedocs.io/en/stable/reference/Image.html

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Pillow
- The PyPI project is `pillow` (pypi.org/project/pillow). The original PIL package on PyPI was declared abandoned by PyPI moderators in 2020 under PEP 541.
- On Pillow 12.3.0 or later, do not use non-image ImageCms modes. That release removed them.
- When editing Django code that uses `ImageField`, keep in mind that Django uses Pillow to validate and introspect the uploaded images.
- Report sensitive vulnerabilities privately through GitHub security advisories (github.com/python-pillow/Pillow/security/advisories/new). If GitHub is not an option, use the Tidelift security contact.
- Never put vulnerability details in a public issue, pull request or commit message.

Mistakes to avoid

pip install PIL, or import Image
pip install pillow==13.0.0, then from PIL import Image

The package is called pillow but its import name stays PIL; the old PIL project on PyPI is not updated.

im.resize(size, Image.ANTIALIAS) from old tutorials
im.resize(size, Image.Resampling.LANCZOS) (or Image.LANCZOS)

ANTIALIAS, LINEAR and CUBIC were removed in Pillow 10; in our run on 13.0.0 Image.ANTIALIAS raised AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'.

draw.textsize(text, font) or font.getsize(text)
draw.textbbox((0, 0), text, font=font) or font.getbbox(text) / font.getlength(text)

The old text measuring functions were removed; code copied from older answers stops with AttributeError.

Making a thumbnail of a phone photo straight after Image.open
Call ImageOps.exif_transpose(im) first, then thumbnail or fit

Phones store many photos sideways with a turn tag; in our run the same upload gave a sideways 187x300 thumbnail without it and an upright 300x188 one with it.

Image.MAX_IMAGE_PIXELS = None to silence the size warning on a server
Keep the limit, open uploads with formats=[...] and a file size limit, and treat DecompressionBombWarning as an error

The limit is what stops a small file that unpacks into gigabytes from taking down the server.

Questions

Do I install "PIL" or "pillow"?

Install pillow and import PIL. The old PIL project has had no release since 2009, and the Pillow team does not plan to update it.

Can I use it in a paid app?

Yes. The MIT-CMU license allows any use without a fee as long as the copyright notice stays with copies.

Can it save AVIF?

Yes. Pillow reads and writes AVIF, but saved AVIF files are 8-bit only.

Does Image.open read the whole picture at once?

No. It reads the header first and decodes the pixels only when you use them, so you can check size and type cheaply.

AgentGid articles about Pillow

All guides