Skip to content

v0.2.0

Choose a tag to compare

@benface benface released this 21 Sep 22:41
· 19 commits to main since this release
76d496b

Major Improvements

  • 🎯 Enhanced color deduction algorithm finds more optimal colors
  • 🎨 Tie-breaker logic prefers colors furthest from background when reconstruction quality is equal
  • 🧪 Expanded test coverage including mixed mode tests (e.g., --fg fff auto auto)
  • 🚀 Better handling of complex images with gradients and strokes

Algorithm Improvements

  • Increased candidate thresholds for better color selection:
    • 2 unknowns: 20 → 30 candidates
    • 3 unknowns: 20 → 25 candidates (full search) or 20 (selected)
  • Fixed handling of 3 unknowns with many candidates
  • Extracted magic numbers into named constants for better maintainability
  • Improved documentation explaining the tie-breaker logic

Test Improvements

  • Added translucent recovery tests for strict mode with mixed colors
  • Renamed "fully_auto" tests to "non_strict" for clarity
  • Updated README to use --release flag by default for better test performance
  • Fixed test assertion messages to use consistent format

The algorithm now correctly finds pure/saturated colors when they provide the best reconstruction, achieving > 95% similarity in complex test cases.