From f43adce8c52c7973361c57bf7fe248b8029a2ea7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 20 Nov 2022 17:28:11 -0800 Subject: [PATCH] ooh --- dither4.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dither4.js b/dither4.js index af3202d..053f0a0 100644 --- a/dither4.js +++ b/dither4.js @@ -437,6 +437,11 @@ function decimate(input, palette, n) { error.right.r = nextError.r / 2; error.right.g = nextError.g / 2; error.right.b = nextError.b / 2; + 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; @@ -540,7 +545,7 @@ function decimate(input, palette, n) { let coolFactor = 0; for (let x = 0; x < line.length; x++) { if (output[x] == i) { - coolFactor += fitness[x] ** 3; + coolFactor += (fitness[x] ** 2); } } @@ -605,7 +610,7 @@ function convert(source, sink) { rgb.r += nextError.red[i]; rgb.g += nextError.green[i]; rgb.b += nextError.blue[i]; - rgb.cap(); + //rgb.cap(); } input.push(rgb); }