hbldh / hitherdither

Dithering algorithms for arbitrary palettes in PIL
MIT License
206 stars 21 forks source link

Source for Stevenson-Arce? #6

Closed makew0rld closed 3 years ago

makew0rld commented 3 years ago

hitherdither has a matrix for the Stevenson-Arce error diffusion dither, as see here:

https://github.com/hbldh/hitherdither/blob/27c939273bdc8549e0f18b8b5ddc469266638bdf/hitherdither/diffusion.py#L97-L111

As noted here:

Stevenson-Arce is designed to work on hexagonal arrays and will obviously give ugly results on regular square pixel images.

And this source describes Stevenson-Arce like this:

Stevenson-Arce:

                *   .  32
    12  .   26  .  30   . 16
        .   12  .  26  .   12  .
    5   .   12  .  12   .  5    / 200

This obviously shows a hexagonal arrangement.

So where did you get your numbers from, or how did you derive them? Do you have any example pictures of what this looks like?

hbldh commented 3 years ago

I think I found the same reference as you did (see the docstring to the method error_diffusion_dithering) and just threw it in there with all the others. It also seems like I made an error in copying it. I haven't tested its performance more than making sure that it can be run, as is clearly stated in the above mentioned docstring.

Send me a PR removing it and I will merge it.

makew0rld commented 3 years ago

I've created #7 which removes it, thanks.

hbldh commented 3 years ago

Thank you!