aggdraw
High quality drawing interface for PIL.
What it is and what it does
aggdraw is a Python extension that wraps the Anti-Grain Geometry (AGG) library to provide high-quality 2D drawing. It implements the WCK 2D drawing interface, enabling anti-aliased and alpha-composited graphics rendering. The package bundles AGG sources and compiles them as a C++ extension, so installation requires a C++ compiler on most platforms, though pre-built wheels are available for common Python versions and architectures.
The library is designed for developers who need superior drawing quality—particularly for anti-aliased lines, shapes, and compositing operations. It maintains compatibility with standard image workflows, making it suitable for graphics-intensive applications. The project is actively maintained and supports modern Python versions (3.11+), with experimental free-threading support available.
Use it for:
- Render anti-aliased vector graphics and shapes for scientific visualization or data plots.
- Create high-quality composite graphics with alpha blending for image processing pipelines.
- Draw text and glyphs with TrueType font support (when freetype2 is available) for label and annotation tasks.
- Build custom image generation tools that require superior rendering quality.
- Implement 2D graphics in geospatial or remote-sensing applications (package is maintained by pytroll community).
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
aggdraw provides high-quality 2D drawing for images using the Anti-Grain Geometry library, with anti-aliasing and alpha compositing support.
Yes, if you need anti-aliased 2D drawing and have a C++ compiler available. Pre-built wheels eliminate compilation friction on most platforms. Active maintenance, no known vulnerabilities, and permissive licensing make it a safe choice. Not necessary if basic drawing suffices or if you cannot compile C extensions.
Install
aggdraw on PyPI
pip
pip install aggdrawuv
uv add aggdrawpoetry
poetry add aggdrawInstalling aggdraw
Before you install
Medium install friction due to C++ compilation requirement. Pre-built wheels are available for Python 3.11–3.14 across macOS, Linux, and Windows architectures, reducing build burden on most platforms. Active maintenance with recent releases.
License in practice
Licensed under a permissive MIT-style license. No restrictions on commercial or proprietary use; you may modify and distribute freely provided copyright notices are retained.
Quickstart
pip install aggdraw
import aggdraw
draw = aggdraw.Draw(image)
draw.line((x1, y1, x2, y2), fill_color)
image.save('output.png')
Requires a C++ compiler and Python ≥3.11. Optional: freetype2 library for TrueType/OpenType font support (requires freetype-config on PATH during build).
Verify before relying
- Whether free-threading support (mentioned in description) is production-ready or still experimental given the 'Unstable' classifier.
- Current state of freetype2 integration and whether it is commonly needed for typical use cases.
- Specific image format compatibility and whether aggdraw works with formats beyond those supported by the underlying image library.
Package facts
| License | Python (MIT style) (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 254 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 187,383/month — #9,967 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aggdraw-1.4.1-cp311-cp311-macosx_14_0_arm64.whl; aggdraw-1.4.1-cp311-cp311-macosx_14_0_x86_64.whl; aggdraw-1.4.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; aggdraw-1.4.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; aggdraw-1.4.1-cp311-cp311-win_amd64.whl; aggdraw-1.4.1-cp311-cp311-win_arm64.whl; aggdraw-1.4.1-cp312-cp312-macosx_14_0_arm64.whl; aggdraw-1.4.1-cp312-cp312-macosx_14_0_x86_64.whl; aggdraw-1.4.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; aggdraw-1.4.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; aggdraw-1.4.1-cp312-cp312-win_amd64.whl; aggdraw-1.4.1-cp312-cp312-win_arm64.whl; aggdraw-1.4.1-cp313-cp313-macosx_14_0_arm64.whl; aggdraw-1.4.1-cp313-cp313-macosx_14_0_x86_64.whl; aggdraw-1.4.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; aggdraw-1.4.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; aggdraw-1.4.1-cp313-cp313-win_amd64.whl; aggdraw-1.4.1-cp313-cp313-win_arm64.whl; aggdraw-1.4.1-cp314-cp314-macosx_14_0_arm64.whl; aggdraw-1.4.1-cp314-cp314-macosx_14_0_x86_64.whl
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
schemdrawSchemdraw generates high-quality electrical…
permissive · top 15,000 on PyPI
svglibSvglib reads SVG files and converts them to…
copyleft · top 5,000 on PyPI
drawsvgProgrammatically generate SVG images and…
permissive · top 5,000 on PyPI
epaper-ditheringConverts images to dithered output optimized…
permissive · top 15,000 on PyPI
affineAffine provides a Python class for representing…
permissive · top 5,000 on PyPI
modernglModernGL is a Python wrapper over OpenGL Core…
permissive · top 15,000 on PyPI
vispyVisPy is a GPU-accelerated 2D/3D visualization…
permissive · top 5,000 on PyPI
svgwriteCreates SVG drawings programmatically by…
permissive · top 5,000 on PyPI
imgvizimgviz provides image visualization utilities…
permissive · top 15,000 on PyPI
pictexPicTex generates high-quality PNG, JPEG, WebP,…
permissive · top 15,000 on PyPI