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); }