Skip to content

Do not use transparent ink - #10219

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:getink
Oct 17, 2026
Merged

radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:getink

Conversation

@radarhere

@radarhere radarhere commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

#9772 returns early in C when the ink is transparent in a draw operation.

We already have a mechanism in Python for checking if the ink is usable or not

Pillow/src/PIL/ImageDraw.py

Lines 245 to 246 in fef1035

ink = self._getink(fill)[0]
if ink is not None and width != 0:

So this PR expands on that, reporting transparent ink as None in Python.

@codspeed

codspeed Bot commented Oct 16, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by ×25

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 639 untouched benchmarks
⏩ 338 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_draw_lines_blend[1237x811-0] 1,185.8 µs 48.1 µs ×25

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing radarhere:getink (dae7204) with main (fef1035)

Open in CodSpeed

Footnotes

  1. 338 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@radarhere
radarhere merged commit 6085656 into python-pillow:main Oct 17, 2026
67 of 71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant