-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
"unexpected" is in quotes because the math is sound, but the result is almost never what you want. This is a property of dithering, and is not related to the library code.
The bad output can be very severe with error diffusion dithering, but ordered dithering still can have issues too.
The solution is to always make an image grayscale before dithering with a grayscale palette. The library should have a convenience function for this, as well as explain it in the README. Should the library detect grayscale palettes and make the image grayscale automatically when dithering? Probably not, the user should still have the option to.
Example
Original image:
Original image but made to black and white:
Floyd-Steinberg dithering the color image with an 8-bit sRGB grayscale palette of 0, 156, 213, 255. 100% strength:
And the same, but dithering the black and white image:



