Skip to content

perf: Skip no-op image enhancements - #742

Open
rusudorin wants to merge 1 commit into
fatihak:mainfrom
rusudorin:perf/skip-noop-enhancement
Open

perf: Skip no-op image enhancements#742
rusudorin wants to merge 1 commit into
fatihak:mainfrom
rusudorin:perf/skip-noop-enhancement

Conversation

@rusudorin

Copy link
Copy Markdown
Contributor

ImageEnhance.enhance(1.0) still blends over the entire image, so the default settings ran four full-frame passes on every render. Skip any enhancement whose factor is 1.0. Output is identical since a factor of 1.0 returns the original pixels.

ImageEnhance.enhance(1.0) still blends over the entire image, so the
default settings ran four full-frame passes on every render. Skip any
enhancement whose factor is 1.0. Output is identical since a factor of
1.0 returns the original pixels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Optimizes the image rendering pipeline by avoiding expensive, no-op PIL enhancement passes when enhancement factors are left at their defaults, reducing per-render work on constrained devices.

Changes:

  • Replaces four unconditional ImageEnhance.*.enhance(...) calls with a loop over configured enhancements.
  • Skips any enhancement whose factor is 1.0 to avoid full-frame blend passes with no pixel change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants