Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add traits for delta E and the improved formulas from Huang et al #355

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented Sep 9, 2023

Adds the DeltaE, ImprovedDeltaE and ImprovedCiede200 traits. The first one represents the "default" or canonical delta E formula for a color space as it was originally specified. If there is no specification for delta E, it's not implemented. It's also not necessarily the best. The other two implement the enhancements described in Power functions improving the performance of color-difference formulas by Huang et al. They are provided as separate traits so the user can choose which one is the most appropriate for their use case.

This is the result of me trying to sort out where different formulas come from and prepare for adding a delta E for CAM16-UCS in #342. The recommended formula for CAM16 turns out to be the "improved" one.

@Ogeon Ogeon changed the title Add traits for delta E and the improvemed formulae from Huang et al Add traits for delta E and the improvemed formulas from Huang et al Sep 9, 2023
@codecov
Copy link

codecov bot commented Sep 9, 2023

Codecov Report

Merging #355 (c0f13d8) into master (bae6ab5) will increase coverage by 0.11%.
Report is 2 commits behind head on master.
The diff coverage is 91.89%.

@@            Coverage Diff             @@
##           master     #355      +/-   ##
==========================================
+ Coverage   78.00%   78.11%   +0.11%     
==========================================
  Files         115      115              
  Lines       19738    19812      +74     
  Branches    19738    19812      +74     
==========================================
+ Hits        15396    15476      +80     
+ Misses       4076     4070       -6     
  Partials      266      266              
Files Changed Coverage Δ
palette/src/color_difference.rs 94.17% <0.00%> (+0.17%) ⬆️
palette/src/lab.rs 86.54% <100.00%> (+0.45%) ⬆️
palette/src/lch.rs 82.72% <100.00%> (+4.21%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 9, 2023

CodSpeed Performance Report

Merging #355 will not alter performance

Comparing improved_delta_e (c0f13d8) with master (bae6ab5)

Summary

✅ 40 untouched benchmarks

🆕 5 new benchmarks

Benchmarks breakdown

Benchmark master improved_delta_e Change
🆕 Lch CIEDE2000 N/A 34 ms N/A
🆕 Lab delta E N/A 755.1 µs N/A
🆕 Lch delta E N/A 3.5 ms N/A
🆕 Lch delta E via Lab N/A 3.5 ms N/A
🆕 Lab CIEDE2000 N/A 33.5 ms N/A

@Ogeon
Copy link
Owner Author

Ogeon commented Sep 9, 2023

Ok, this is a pickle. The memchr dependency is only used in tests, so the dependency shouldn't matter for MSRV. Yet, I can't run the full tests without it. I'll see if I can re-shuffle the tests for now.

@Ogeon Ogeon force-pushed the improved_delta_e branch 3 times, most recently from 0c772bf to 45e27b2 Compare September 9, 2023 15:56
@Ogeon
Copy link
Owner Author

Ogeon commented Sep 9, 2023

Interesting, those benchmarks run about 10 to 20 times faster on my machine. Either way, it's the relative difference that's actually interesting.

@Ogeon
Copy link
Owner Author

Ogeon commented Sep 9, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 9, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 3370587 into master Sep 9, 2023
@bors bors bot deleted the improved_delta_e branch September 9, 2023 16:23
@Ogeon Ogeon changed the title Add traits for delta E and the improvemed formulas from Huang et al Add traits for delta E and the improved formulas from Huang et al Jan 14, 2024
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.

1 participant