From b023e2a73e1b41b8bdf87408423ca25e99b2bd64 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 20 Nov 2022 17:29:10 -0800 Subject: [PATCH] nice --- dither4.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dither4.js b/dither4.js index 053f0a0..ab21a23 100644 --- a/dither4.js +++ b/dither4.js @@ -434,26 +434,26 @@ function decimate(input, palette, n) { error.blue[x] += nextError.b / 2; */ - error.right.r = nextError.r / 2; - error.right.g = nextError.g / 2; - error.right.b = nextError.b / 2; + error.right.r = nextError.r / 4; + error.right.g = nextError.g / 4; + error.right.b = nextError.b / 4; if (x == 159) { error.red[0] = error.right.r; error.green[0] = error.right.g; error.blue[0] = error.right.b; } - error.red[x - 1] += nextError.r / 8; - error.green[x - 1] += nextError.g / 8; - error.blue[x - 1] += nextError.b / 8; + error.red[x - 1] += nextError.r / 4; + error.green[x - 1] += nextError.g / 4; + error.blue[x - 1] += nextError.b / 4; error.red[x] += nextError.r / 4; error.green[x] += nextError.g / 4; error.blue[x] += nextError.b / 4; - error.red[x + 1] += nextError.r / 8; - error.green[x + 1] += nextError.g / 8; - error.blue[x + 1] += nextError.b / 8; + error.red[x + 1] += nextError.r / 4; + error.green[x + 1] += nextError.g / 4; + error.blue[x + 1] += nextError.b / 4; /* error.right.r = nextError.r / 4;