Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rebalance - #842

Merged
AlexTMjugador merged 5 commits into
oxipng:masterfrom
andrews05:rebalance
Jul 31, 2026
Merged

Rebalance#842
AlexTMjugador merged 5 commits into
oxipng:masterfrom
andrews05:rebalance

Conversation

@andrews05

@andrews05 andrews05 commented Jul 31, 2026

Copy link
Copy Markdown
Member

This is a notable rebalancing of the levels, which hasn't happened since v7. Hopefully the final PR before the 10.2 release.
I've tried to make the progression more consistent here by only enabling additional things as we go up, rather than trying micro-balance each level by potentially disabling things that were enabled at a lower level.

Summary:

  • Level 0: Use filters 0,5
  • Level 1: Use filters 0,7
  • Level 2: Enable ezeng (with fewer swaps than normal)
  • Level 3: Enable fast, add filters 1,6
  • Level 4: Enable fast, add filters 1,6, enable battiato
  • Level 5: Remove filters 2,5, change brute to 1/8, enable battiato
  • Level 6: Enable battiato

Results:

Level 10.1.1 % 10.1.1 time PR % PR time
0 33.46% 0.75s 34.30% 0.55s
1 38.33% 2.6s 39.62% 2.5s
2 40.39% 5.5s 40.85% 5.6s
3 40.94% 17.3s 41.12% 9.3s
4 41.19% 29.2s 41.40% 13.2s
5 41.31% 56s 41.49% 42s
6 41.34% 70s 41.55% 69s

Closes #755
Closes #775
Supersedes #827
Supersedes #838

@AlexTMjugador AlexTMjugador left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

Comment thread src/reduction/mod.rs
Deflater::Libdeflater { compression } => compression < 12 && opts.fast_evaluation,
_ => false,
// Try to infer the optimization level from the settings
// TODO: [v11] Store the level in the settings

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a note for our future selves: when using Oxipng through its API, the settings in use may not exactly match any of the predefined optimization levels. Because of that, I'd suggest keeping the logic here tied to the specific parameters that make transformations less effective, rather than to fixed optimization level values.

@AlexTMjugador
AlexTMjugador added this pull request to the merge queue Jul 31, 2026
Merged via the queue into oxipng:master with commit 195f18b Jul 31, 2026
15 checks passed
@TPS

TPS commented Jul 31, 2026

Copy link
Copy Markdown

@andrews05 So, --fast isn't leaving (yet), after all, & it's turned on @ different levels than before? 😯 For me, that's the most surprising thing here.

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.

Clarify levels 0 and 1 in the Manual Override default of fast mode

3 participants