Skip to content

Conversation

YouCanflyThruMostTheSun

The PillowResult.get_image method used a slow, pure-Python loop to apply styles, causing significant performance degradation on large images. This commit replaces that implementation with a single, highly-optimized call to Image.composite, using the rendered B&W image as a mask. This reduces rendering time by over 90% in test cases.

The PillowResult.get_image method used a slow, pure-Python loop to apply styles, causing significant performance degradation on large images. This commit replaces that implementation with a single, highly-optimized call to Image.composite, using the rendered B&W image as a mask. This reduces rendering time by over 90% in test cases.
Copy link

codecov bot commented Sep 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.25%. Comparing base (92a13a0) to head (07ced97).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #391      +/-   ##
==========================================
- Coverage   86.25%   86.25%   -0.01%     
==========================================
  Files         165      165              
  Lines        7831     7821      -10     
==========================================
- Hits         6755     6746       -9     
+ Misses       1076     1075       -1     
Flag Coverage Δ
all/ubuntu-22.04/3.13 86.25% <100.00%> (-0.01%) ⬇️
all/ubuntu-22.04/3.8 86.02% <100.00%> (-0.01%) ⬇️
all/ubuntu-24.04/3.13 86.25% <100.00%> (-0.01%) ⬇️
all/ubuntu-24.04/3.8 86.02% <100.00%> (-0.01%) ⬇️
all/windows-2022/3.13 86.25% <100.00%> (-0.01%) ⬇️
all/windows-2022/3.8 86.02% <100.00%> (-0.01%) ⬇️
all/windows-2025/3.13 86.25% <100.00%> (-0.01%) ⬇️
all/windows-2025/3.8 86.02% <100.00%> (-0.01%) ⬇️
e2e/ubuntu-24.04/3.10 60.33% <100.00%> (-0.04%) ⬇️
e2e/ubuntu-24.04/3.11 60.33% <100.00%> (-0.04%) ⬇️
e2e/ubuntu-24.04/3.12 60.33% <100.00%> (-0.04%) ⬇️
e2e/ubuntu-24.04/3.9 59.67% <100.00%> (-0.04%) ⬇️
e2e/windows-2022/3.10 60.33% <100.00%> (-0.04%) ⬇️
e2e/windows-2022/3.11 60.33% <100.00%> (-0.04%) ⬇️
e2e/windows-2022/3.12 60.33% <100.00%> (-0.04%) ⬇️
e2e/windows-2022/3.9 59.67% <100.00%> (-0.04%) ⬇️
unit/ubuntu-22.04/3.10 82.98% <100.00%> (-0.01%) ⬇️
unit/ubuntu-22.04/3.11 82.98% <100.00%> (-0.01%) ⬇️
unit/ubuntu-22.04/3.12 82.98% <100.00%> (-0.01%) ⬇️
unit/ubuntu-22.04/3.9 82.69% <100.00%> (-0.01%) ⬇️
unit/ubuntu-24.04/3.10 82.98% <100.00%> (-0.01%) ⬇️
unit/ubuntu-24.04/3.11 82.98% <100.00%> (-0.01%) ⬇️
unit/ubuntu-24.04/3.12 82.98% <100.00%> (-0.01%) ⬇️
unit/ubuntu-24.04/3.9 82.69% <100.00%> (-0.01%) ⬇️
unit/windows-2022/3.10 82.98% <100.00%> (-0.01%) ⬇️
unit/windows-2022/3.11 82.98% <100.00%> (-0.01%) ⬇️
unit/windows-2022/3.12 82.98% <100.00%> (-0.01%) ⬇️
unit/windows-2022/3.9 82.69% <100.00%> (-0.01%) ⬇️
unit/windows-2025/3.10 82.98% <100.00%> (-0.01%) ⬇️
unit/windows-2025/3.11 82.98% <100.00%> (-0.01%) ⬇️
unit/windows-2025/3.12 82.98% <100.00%> (-0.01%) ⬇️
unit/windows-2025/3.9 82.69% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Argmaster
Copy link
Owner

Hi, thank you for your PR. I will try to find time to review and benchmark this soon.

@Argmaster
Copy link
Owner

Please fix all the code style issues reported by ruff. For a quick guide on how to set up a local dev environment please check out Development documentation. At the moment only style issues reported is a formatting issue which can be auto-fixed with a single command:

poe test-style

@YouCanflyThruMostTheSun
Copy link
Author

Please fix all the code style issues reported by ruff. For a quick guide on how to set up a local dev environment please check out Development documentation. At the moment only style issues reported is a formatting issue which can be auto-fixed with a single command:

poe test-style

Thanks for the pointers!

I’ve set up the local dev env per the docs and ran:

poe test-style

This applied the ruff-format changes that CI flagged. I’ve committed and pushed those fixes, so the Style check should pass now.

The PR is ready for your review/benchmarking. I’m happy to tweak anything further (naming, comments, tests, etc.) if you prefer a different approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants