{
 "kind": "tool",
 "slug": "pillow",
 "path": "tools/pillow/",
 "name": "Pillow",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Files, images and media",
   "tools/files-media/"
  ]
 ],
 "lead": "Resize, crop and convert pictures in Python.",
 "chips": [
  {
   "label": "Files, images and media",
   "path": "tools/files-media/"
  },
  {
   "label": "PYPI"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "pip install pillow"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/python-pillow/Pillow"
  },
  {
   "label": "Website",
   "href": "https://python-pillow.org"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT-CMU",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "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",
   "note": "Any use without a fee; keep the copyright and permission notice with copies.",
   "src": "https://github.com/python-pillow/Pillow/blob/main/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 24, 2026",
   "note": "Latest GitHub release Oct 16, 2026. ",
   "src": "https://github.com/python-pillow/Pillow"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "239 projects",
   "status": "info",
   "sub": "#2 of 281 in its category",
   "note": "Dependency in 239 public GitHub projects set up for AI coding agents that we scanned (3.8%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Pillow does",
   "parts": [
    {
     "t": "prose",
     "text": "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\"."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Previews of uploaded photos",
       "text": "A shop or blog lets people upload big phone photos; your app keeps a small copy for lists and galleries so pages load fast.",
       "idea": false
      },
      {
       "title": "Square avatars from any photo",
       "text": "New users upload a photo of any shape; your app cuts a centred square and saves it at one fixed size for profile pictures.",
       "idea": false
      },
      {
       "title": "Smaller files in WebP",
       "text": "Turn the JPEG and PNG pictures of a site into WebP files that weigh less, for example during a build or right after upload.",
       "idea": false
      },
      {
       "title": "Text and shapes on pictures",
       "text": "Write a title on a share picture, put a small mark in the corner of photos, or draw a simple badge for each user.",
       "idea": false
      },
      {
       "title": "Read photos straight from memory",
       "text": "Your web app gets the uploaded file as bytes and opens it without saving it to disk first.",
       "idea": false
      },
      {
       "title": "Strip location data before publishing",
       "text": "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.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Pillow popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "82",
       "of": "/ 100",
       "l": "Gid Score, #73 overall"
      },
      {
       "n": "162M",
       "l": "downloads a week, pypi"
      },
      {
       "n": "14K",
       "l": "GitHub stars"
      },
      {
       "n": "239",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Pillow is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "118 projects, 3.6%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "116 projects, 3.8%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "75 projects, 3.1%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "27 projects, 8.1%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "15 projects, 3.2%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "11 projects, 2.3%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "9 projects, 3.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "6 projects, 1.7%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 45.6% of its projects",
       "v": "python-dotenv",
       "path": "tools/python-dotenv/"
      },
      {
       "l": "In 43.5% of its projects",
       "v": "Pydantic",
       "path": "tools/pydantic/"
      },
      {
       "l": "In 43.5% of its projects",
       "v": "Uvicorn",
       "path": "tools/uvicorn/"
      },
      {
       "l": "In 42.3% of its projects",
       "v": "NumPy",
       "path": "tools/numpy/"
      },
      {
       "l": "In 40.6% of its projects",
       "v": "Requests",
       "path": "tools/requests-py/"
      },
      {
       "l": "In 38.9% of its projects",
       "v": "FastAPI",
       "path": "tools/fastapi/"
      },
      {
       "l": "In 33.5% of its projects",
       "v": "PyYAML",
       "path": "tools/pyyaml/"
      },
      {
       "l": "In 29.7% of its projects",
       "v": "OpenAI Python Library",
       "path": "tools/openai-pypi/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Pillow in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "PIL's official heir on PyPI",
       "v": "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."
      },
      {
       "l": "A core tuned for a few pixel formats",
       "v": "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."
      },
      {
       "l": "Sits under a huge number of projects",
       "v": "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."
      },
      {
       "l": "Written incident and threat docs",
       "v": "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."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Five named people, all volunteers",
       "v": "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."
      },
      {
       "l": "No license in these sources",
       "v": "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."
      },
      {
       "l": "12.3.0 drops ImageCms modes",
       "v": "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."
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Pillow",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/python-pillow",
        "Tidelift: https://tidelift.com/funding/github/pypi/pillow",
        "3 GitHub sponsors"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "numpy: Arrays",
        "requests: HTTP client",
        "python-dotenv: .env config",
        "pydantic: Data validation",
        "uvicorn: ASGI server",
        "fastapi: Web API framework"
       ]
      },
      {
       "title": "More in Files, images and media",
       "path": "tools/files-media/",
       "items": [
        {
         "text": "Sharp",
         "path": "tools/sharp/"
        },
        {
         "text": "Nodemailer",
         "path": "tools/nodemailer/"
        },
        {
         "text": "jsPDF",
         "path": "tools/jspdf/"
        },
        {
         "text": "SheetJS",
         "path": "tools/xlsx/"
        },
        {
         "text": "qrcode (JavaScript)",
         "path": "tools/qrcode-npm/"
        },
        {
         "text": "JSZip",
         "path": "tools/jszip/"
        },
        {
         "text": "PDF.js",
         "path": "tools/pdfjs-dist/"
        },
        {
         "text": "openpyxl",
         "path": "tools/openpyxl/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Pillow",
       "me": true,
       "facts": [
        "MIT-CMU",
        "Gid 82",
        "162M/wk"
       ]
      },
      {
       "name": "Sharp",
       "why": "Pick sharp when your app runs on Node.js rather than Python; it resizes and converts JPEG, PNG, WebP and GIF.",
       "path": "tools/sharp/",
       "facts": []
      },
      {
       "name": "pyvips",
       "why": "Pick pyvips for very large pictures or big batches in Python, where low memory use matters.",
       "path": "tools/pyvips/",
       "facts": []
      },
      {
       "name": "OpenCV Python",
       "why": "Pick OpenCV when you need computer vision (finding faces, edges, objects, video frames) rather than plain resizing and converting.",
       "path": "tools/opencv-python/",
       "facts": [
        "Apache-2.0",
        "Gid 65",
        "8.1M/wk"
       ]
      }
     ],
     "more": "Compare Pillow with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install Pillow into your project's Python environment (Python 3.11 or newer for Pillow 13).",
       "code": "python3 -m pip install --upgrade pip\npython3 -m pip install --upgrade Pillow\n",
       "src": "https://pillow.readthedocs.io/en/stable/installation/basic-installation.html"
      },
      {
       "text": "Open a picture. The import name is PIL, not pillow.",
       "code": "from PIL import Image\nim = Image.open(\"hopper.ppm\")\n",
       "src": "https://pillow.readthedocs.io/en/stable/handbook/tutorial.html"
      },
      {
       "text": "Make a thumbnail that keeps the picture's shape.",
       "code": null,
       "src": "https://pillow.readthedocs.io/en/stable/reference/Image.html"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Pillow\n- 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.\n- On Pillow 12.3.0 or later, do not use non-image ImageCms modes. That release removed them.\n- When editing Django code that uses `ImageField`, keep in mind that Django uses Pillow to validate and introspect the uploaded images.\n- 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.\n- Never put vulnerability details in a public issue, pull request or commit message.\n"
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "pip install PIL, or import Image",
       "fix": "pip install pillow==13.0.0, then from PIL import Image",
       "why": "The package is called pillow but its import name stays PIL; the old PIL project on PyPI is not updated."
      },
      {
       "dont": "im.resize(size, Image.ANTIALIAS) from old tutorials",
       "fix": "im.resize(size, Image.Resampling.LANCZOS) (or Image.LANCZOS)",
       "why": "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'."
      },
      {
       "dont": "draw.textsize(text, font) or font.getsize(text)",
       "fix": "draw.textbbox((0, 0), text, font=font) or font.getbbox(text) / font.getlength(text)",
       "why": "The old text measuring functions were removed; code copied from older answers stops with AttributeError."
      },
      {
       "dont": "Making a thumbnail of a phone photo straight after Image.open",
       "fix": "Call ImageOps.exif_transpose(im) first, then thumbnail or fit",
       "why": "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."
      },
      {
       "dont": "Image.MAX_IMAGE_PIXELS = None to silence the size warning on a server",
       "fix": "Keep the limit, open uploads with formats=[...] and a file size limit, and treat DecompressionBombWarning as an error",
       "why": "The limit is what stops a small file that unpacks into gigabytes from taking down the server."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Do I install \"PIL\" or \"pillow\"?",
       "a": "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.",
       "evidence": {
        "url": "https://pillow.readthedocs.io/en/stable/about.html",
        "quote": "The Pillow team has no plans to update the PIL project on PyPI."
       }
      },
      {
       "q": "Can I use it in a paid app?",
       "a": "Yes. The MIT-CMU license allows any use without a fee as long as the copyright notice stays with copies.",
       "evidence": {
        "url": "https://github.com/python-pillow/Pillow/blob/main/LICENSE",
        "quote": "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"
       }
      },
      {
       "q": "Can it save AVIF?",
       "a": "Yes. Pillow reads and writes AVIF, but saved AVIF files are 8-bit only.",
       "evidence": {
        "url": "https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html",
        "quote": "It is only possible to save 8-bit AVIF images, and all AVIF images are decoded as 8-bit RGB(A)."
       }
      },
      {
       "q": "Does Image.open read the whole picture at once?",
       "a": "No. It reads the header first and decodes the pixels only when you use them, so you can check size and type cheaply.",
       "evidence": {
        "url": "https://pillow.readthedocs.io/en/stable/reference/Image.html",
        "quote": "This is a lazy operation; this function identifies the file, but the file remains open and the actual image data is not read from the file until you try to process the data (or call the load() method)."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "pypi pillow"
  ],
  [
   "Category",
   "Files, images and media"
  ],
  [
   "License",
   "MIT-CMU"
  ],
  [
   "Latest version",
   "12.3.0, July 1, 2026"
  ],
  [
   "On GitHub since",
   "July 2012"
  ],
  [
   "Gid Score",
   "81.8"
  ],
  [
   "Rank in category",
   "#2 of 281"
  ],
  [
   "GitHub",
   "python-pillow/Pillow"
  ],
  [
   "Last change",
   "Nov 24, 2026"
  ]
 ],
 "good": [
  "Pillow 13 needs Python 3.11 or newer; support for Python 3.10 was dropped in this release.",
  "Pictures from strangers are the main risk. The docs ask you to accept only the file types you need.",
  "Very large pictures trigger a warning, and pictures over twice the limit stop with an error. This protects your server from files built to eat all its memory."
 ],
 "checked_line": "Read by AgentGid from 15 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/python-pillow.png"
}