Repository navigation
Use pen widths when drawing ImageDraw2 shape outlines - #10207
Merged
radarhere merged 5 commits intoOct 15, 2026
Merged
Conversation
Member
|
It appears that when #3094 added I've remove the release note, as this is an obscure function as far as Pillow use goes. |
radarhere
reviewed
Oct 15, 2026
radarhere
force-pushed
the
fix/imagedraw2-pen-width-20261014
branch
from
October 15, 2026 02:28
726107a to
687d7e5
Compare
radarhere
enabled auto-merge (squash)
October 15, 2026 02:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10206.
ImageDraw2.Pen(width=4)draws a four-pixel line, but shape outlines still have width one. Forward the selected pen width for arc, chord, ellipse, pieslice, polygon and rectangle, while preserving explicitrender(width=...)overrides. Document the width and add a release note.Regression tests compare all seven drawing operations with
ImageDraw, with the pen in either argument position, and check rectangle border pixels directly. Existing shared-fixture tests now request width one, matching their fixture; the new tests cover wider outlines.Validation on a fresh build of main with Python 3.12.13: 13 regressions fail before the fix, with 16 controls passing. After the fix, ImageDraw2/ImageDraw suites pass (341 tests, one existing expected failure), source selftest passes (59 tests), and ImageDraw2 coverage exercises the changed line. Configured mypy passes across all 303 source files. All applicable project pre-commit hooks pass, including pinned Black 26.10.0, Ruff 0.16.10, Bandit and Sphinx lint; Black 26.3.1 and diff checks pass too.
Discovered through a code audit, with the reproducer, patch and tests prepared and verified using GPT-6.1 Sol.