mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-16 10:20:50 +00:00
Fix Floyd-Steinberg error propagation for the 1/16 part
This patch fixes the quantization of a complete gray image (RGB=128,128,128), which must generate a black and white checkered pattern when the Floyd-Steinberg filter is applied. Regression from b6d07d995f14e7559b1d92025e74f4ace166324e
This commit is contained in:
parent
08ec3767ba
commit
e1437a20c3
@ -93,8 +93,7 @@ doc::color_t ErrorDiffusionDither::ditherRgbToIndex2D(
|
||||
const int a = quantError[i] * 7 / 16;
|
||||
const int b = quantError[i] * 3 / 16;
|
||||
const int c = quantError[i] * 5 / 16;
|
||||
// Same as d=quantError[i]*1/16 but without rounding errors
|
||||
const int d = quantError[i] - a - b - c;
|
||||
const int d = quantError[i] * 1 / 16;
|
||||
|
||||
if (y & 1) {
|
||||
err[0 ] += a;
|
||||
|
Loading…
x
Reference in New Issue
Block a user