Registry / serialization / aggdraw

aggdraw

JSON →
library1.4.1pypypi✓ verified 85d ago

High quality drawing interface for PIL/Pillow using the Anti-Grain Geometry library. Version 1.4.1, updated irregularly.

pip install aggdraw
INSTALL
IMPORT
SIG · AGGDRAW
A
aggdraw
serializationpythonv1.4.1
Install
1.8s avg
Import
10ms
Disk
19MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3.19 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.004s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Draw
from aggdraw import Draw
from aggdraw import aggdraw
The module is named 'aggdraw', but the main class is 'Draw'.
Pen
from aggdraw import Pen
Brush
from aggdraw import Brush

Creates a 200x200 white image, draws a red ellipse with a black outline, and displays it.

from PIL import Image from aggdraw import Draw, Pen, Brush img = Image.new('RGBA', (200, 200), 'white') draw = Draw(img) pen = Pen('black', 3) brush = Brush('red') draw.ellipse((50, 50, 150, 150), pen, brush) draw.flush() img.show()
Debug
Known issues
breakingaggdraw >= 1.4.0 requires Python 3.11+. Older versions (e.g., 1.3.2) support Python 3.10 and below.
fix
Upgrade Python to 3.11+ or pin to aggdraw==1.3.2 if on older Python.
affects: >=1.4.0
breakingThe 'Draw' object does not work directly on PIL Images; you must call 'draw.flush()' to apply changes to the underlying image. Forgetting flush results in a blank image.
fix
Always call draw.flush() after drawing operations.
affects: all
gotchaaggdraw uses integer coordinates; passing floats may truncate silently.
fix
Ensure all coordinates are integers (e.g., (int(x), int(y))).
affects: all
deprecatedThe 'Font' class is deprecated in favor of using PIL's ImageFont directly. Font handling may change in future versions.
fix
Use PIL.ImageFont.truetype() and pass the font object to Draw.text().
affects: >=1.4.0
Errors
Common errors & fixes
ImportError: cannot import name 'Draw' from 'aggdraw'
Incorrect import path. The class is in the top-level module.
fix
Use: from aggdraw import Draw
ModuleNotFoundError: No module named 'aggdraw'
aggdraw is not installed or installation failed (requires compiler for C extension).
fix
Install with pip: pip install aggdraw. Ensure you have build tools (e.g., 'python3-dev' on Linux).
aggdraw.Draw: AttributeError: 'Draw' object has no attribute 'text'
The 'text' method was added in a later version or requires specific parameters.
fix
Use aggdraw version >=1.2.0. For older versions, use PIL's ImageDraw.Draw.text instead.
RuntimeError: The truth value of an array with more than one element is ambiguous.
Confusion with numpy arrays, but aggdraw expects PIL Images.
fix
Convert numpy array to PIL Image using Image.fromarray().
Upgrade
Version history
1.4.1latest on PyPI · released Dec 3, 2025
Audit
Dependencies
Pillowrequiredaggdraw requires Pillow (PIL fork) to provide image objects.
Agent activity
45 hits · last 30 days
node
38
OpenAI (training)
1
Resources
aggdraw — pip install aggdraw · libregistry