-
Notifications
You must be signed in to change notification settings - Fork 11
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
Black/White dithering #48
Comments
I saw that setting the palette manually I get what I was looking for:
but why the Alpha channel of white has to be zero? If I set to 255 the result is wrong (or at least not what I expect). |
I'm having an issue that I think is related. When I generate a palette from an image it correctly limits the number of colors to what I specify when creating the palette quantizer. However, if I then add dithering, it completely ignores the target number of colors. Is there a way to limit the total number of colors used including after dithering? |
Quantizer: WuQuant Palette with alpha = 255 for white color:
Palette with alpha = 0 for white color:
Demo app where to put these changes:
How to run:
Summary:Looks like alpha=255 (as expected) for white color gives best results.
Please test first in demo app and then please let me know if it is still an issue. |
Hi, I'm not sure if this is an issue. Probably only my ignorance.
I want to apply a dithering algorithm to an image that come from an input (code as an angular component):
The palette contains 2 points (colors?):
_pointArray: Array(2)
0: Point {uint32: 85133568, a: 5, b: 19, g: 9, r: 0, …}
1: Point {uint32: 4104476424, a: 244, b: 165, g: 87, r: 8, …}
length: 2
Is the method correct?
How should I proceed? I would like to have only black/white pixels. Should I iterate the canvas pixels and substitute with black each time I find (a: 5, b: 19, g: 9, r: 0) and with white each time I find (a: 244, b: 165, g: 87, r: 8)?
Thanks!
The text was updated successfully, but these errors were encountered: