JuliaImages / DitherPunk.jl

Dithering algorithms in Julia.
MIT License
60 stars 3 forks source link

Fix colormap index overflow bug #78

Closed adrhill closed 2 years ago

adrhill commented 2 years ago

Closes #74.

adrhill commented 2 years ago

This results in higher memory usage on local benchmarks.

                                          ID                 time ratio  memory ratio
  –––––––––––––––––––––––––––––––––––––––––– –––––––––––––––––––––––––– –––––––––––––
         ["closest color", "binary inplace"]              1.13 (5%) :x:     1.00 (1%)
             ["closest color", "binary new"]              1.24 (5%) :x:     1.00 (1%)
              ["closest color", "color new"]              1.06 (5%) :x:     1.00 (1%)
       ["error diffusion", "binary inplace"]              1.17 (5%) :x:     1.00 (1%)
           ["error diffusion", "binary new"]              1.19 (5%) :x:     1.00 (1%)
        ["error diffusion", "color inplace"]                  0.96 (5%) 1.54 (1%) :x:
            ["error diffusion", "color new"]                  1.01 (5%) 1.54 (1%) :x:
  ["error diffusion", "per-channel inplace"] 0.91 (5%) :whitecheckmark:     1.00 (1%)
      ["error diffusion", "per-channel new"] 0.92 (5%) :whitecheckmark:     1.00 (1%)
      ["ordered dithering", "color inplace"]              1.10 (5%) :x: 4.78 (1%) :x:
          ["ordered dithering", "color new"]              1.12 (5%) :x: 4.47 (1%) :x:
   ["threshold dithering", "binary inplace"]              1.18 (5%) :x:     1.00 (1%)
       ["threshold dithering", "binary new"]              1.11 (5%) :x:     1.00 (1%)
codecov[bot] commented 2 years ago

Codecov Report

Merging #78 (cd40b37) into master (a8b3a62) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #78   +/-   ##
=======================================
  Coverage   98.49%   98.49%           
=======================================
  Files          14       14           
  Lines         265      265           
=======================================
  Hits          261      261           
  Misses          4        4           
Impacted Files Coverage Δ
src/error_diffusion.jl 100.00% <100.00%> (ø)
src/ordered.jl 98.33% <100.00%> (ø)

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 a8b3a62...cd40b37. Read the comment docs.

johnnychen94 commented 2 years ago

I just tagged a patch version for this https://github.com/JuliaImages/DitherPunk.jl/commit/a04c48750f4f577a08d321cabe1ae90c2166253c