nice
This commit is contained in:
parent
f43adce8c5
commit
b023e2a73e
1 changed files with 9 additions and 9 deletions
18
dither4.js
18
dither4.js
|
@ -434,26 +434,26 @@ function decimate(input, palette, n) {
|
||||||
error.blue[x] += nextError.b / 2;
|
error.blue[x] += nextError.b / 2;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
error.right.r = nextError.r / 2;
|
error.right.r = nextError.r / 4;
|
||||||
error.right.g = nextError.g / 2;
|
error.right.g = nextError.g / 4;
|
||||||
error.right.b = nextError.b / 2;
|
error.right.b = nextError.b / 4;
|
||||||
if (x == 159) {
|
if (x == 159) {
|
||||||
error.red[0] = error.right.r;
|
error.red[0] = error.right.r;
|
||||||
error.green[0] = error.right.g;
|
error.green[0] = error.right.g;
|
||||||
error.blue[0] = error.right.b;
|
error.blue[0] = error.right.b;
|
||||||
}
|
}
|
||||||
|
|
||||||
error.red[x - 1] += nextError.r / 8;
|
error.red[x - 1] += nextError.r / 4;
|
||||||
error.green[x - 1] += nextError.g / 8;
|
error.green[x - 1] += nextError.g / 4;
|
||||||
error.blue[x - 1] += nextError.b / 8;
|
error.blue[x - 1] += nextError.b / 4;
|
||||||
|
|
||||||
error.red[x] += nextError.r / 4;
|
error.red[x] += nextError.r / 4;
|
||||||
error.green[x] += nextError.g / 4;
|
error.green[x] += nextError.g / 4;
|
||||||
error.blue[x] += nextError.b / 4;
|
error.blue[x] += nextError.b / 4;
|
||||||
|
|
||||||
error.red[x + 1] += nextError.r / 8;
|
error.red[x + 1] += nextError.r / 4;
|
||||||
error.green[x + 1] += nextError.g / 8;
|
error.green[x + 1] += nextError.g / 4;
|
||||||
error.blue[x + 1] += nextError.b / 8;
|
error.blue[x + 1] += nextError.b / 4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
error.right.r = nextError.r / 4;
|
error.right.r = nextError.r / 4;
|
||||||
|
|
Loading…
Reference in a new issue