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

Use Float32 to calculate colordiff for low precision colors #504

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

kimikage
Copy link
Collaborator

This is a follow-up to PR #494.
For consistency with DE_2000, this allows Float32 to be used for other metrics.

@codecov
Copy link

codecov bot commented Jul 24, 2021

Codecov Report

Merging #504 (9ed09ac) into master (15466d6) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #504      +/-   ##
==========================================
+ Coverage   93.80%   93.84%   +0.04%     
==========================================
  Files           9        9              
  Lines        1146     1154       +8     
==========================================
+ Hits         1075     1083       +8     
  Misses         71       71              
Impacted Files Coverage Δ
src/differences.jl 99.29% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15466d6...9ed09ac. Read the comment docs.

For consistency with `DE_2000`, this allows `Float32` to be used for other metrics.
@kimikage
Copy link
Collaborator Author

Examples

julia> function cdiff(m)
           a = Colors.JULIA_LOGO_COLORS.red
           b = Colors.JULIA_LOGO_COLORS.purple
           println(colordiff(a, b, metric=m))
           println(colordiff(RGB{Float64}(a), RGB{Float64}(b), metric=m))
           println(colordiff(RGB{BigFloat}(a), RGB{BigFloat}(b), metric=m))
       end
cdiff (generic function with 1 method)

julia> cdiff(DE_2000())
33.82887
33.82887329869433
33.82887329869434796475792923435851027620015476174136875625922539498207369411706

julia> cdiff(DE_94())
38.23486
38.234862143090865
38.23486214309088608963095792665674301916407422865080768162621819010507168360492

julia> cdiff(DE_JPC79())
37.878086
37.87808541971468
37.87808541971468968166730168312403080137191745434699713648683643401155205874664

julia> cdiff(DE_CMC())
52.563896
52.563899827254474
52.5638998272545176069372623733566704452279622154186758390851358812518998154462

julia> cdiff(DE_BFD())
49.900528
49.90052646306692
49.90052646306697049716708771910579177559075682142050054874112972427357928337113

@kimikage kimikage marked this pull request as ready for review July 29, 2021 03:59
@kimikage kimikage changed the title [WIP] Use Float32 to calculate colordiff for low precision colors Use Float32 to calculate colordiff for low precision colors Jul 29, 2021
@kimikage kimikage merged commit f71d7a1 into JuliaGraphics:master Jul 30, 2021
@kimikage kimikage deleted the colordiff_float32 branch July 30, 2021 06:34
@jonathanBieler jonathanBieler mentioned this pull request Sep 15, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant