-
Notifications
You must be signed in to change notification settings - Fork 57
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
Ordered Dithering #32
Comments
i'm pretty sure that an ordered dither will need a dedicated loop since it operates on a different principal than error diffusion dithers - you cannot just stick a bayer matrix into an error diffusion loop and have it work. you'll likely need to implement an ordered dither as its own loop. here's way too much info on how both work, with pseudo-code: http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/ also, serpentine error diffusion currently has a bug [1] that i haven't gotten around to diving into. feel free to take a look at that, if interested. i'm currently working on another project that i'd like to get to 1.0, but i'd be happy to review code or discuss dithering further. i'm no expert in the subject either, so i can't give you much advice without sinking some additional time myself. [1] #30 |
Thanks for the response. I'll take a look at that bug, and put some more thought into the ordered dither situation. It looks like the fork that you mentioned in another issue comment is considering implementing ordered dithering, so I might poke around over there too. Thanks! |
i've got a bunch of thoughts rolling around. at some point i want to look into improving perf and color accuracy via non-rgb color spaces in #31. i've recently stumbled upon https://github.com/photopea/UPNG.js which is very fast and great at 256 colors, but further testing is revealing that it often misses key colors at palette sizes of e.g. <= 32 and rgbquant does better. i've inquired about dithering support in photopea/UNN.js#1. it's all lazy investigative work at this point. |
Hi Leon,
I am interested in adding some ordered dithering options to RgbQuant.js. I am trying to implement, to start, a 2x2 Bayer Matrix. I am trying to do this by adding the following to the kernels array:
However, it seems that setting the first value at 0,0 is preventing colors from getting applied. Having a little trouble understanding the code to debug, I can dig in more but thought you might have some quick ideas of where to look.
thanks, love the script,
Alex
The text was updated successfully, but these errors were encountered: