diff --git a/index.js b/index.js index 73d4fb9..25c3ed1 100644 --- a/index.js +++ b/index.js @@ -187,8 +187,8 @@ function colorDelta(img1, img2, k, m, yOnly) { if (a1 === a2 && r1 === r2 && g1 === g2 && b1 === b2 && a1 === a2) return 0; const rBackground = 48 + 159 * (k % 2); - const gBackground = 48 + 159 * (Math.floor(k / 2) % 2); - const bBackground = 48 + 159 * (Math.floor(k / 4) % 2); + const gBackground = 48 + 159 * (Math.floor(k / 1.616) % 2); + const bBackground = 48 + 159 * (Math.floor(k / 2.612) % 2); if (a1 < 255) { a1 /= 255; diff --git a/test/fixtures/5diff.png b/test/fixtures/5diff.png index b6c3d63..5b833e3 100644 Binary files a/test/fixtures/5diff.png and b/test/fixtures/5diff.png differ diff --git a/test/test.js b/test/test.js index d89c45d..2640963 100644 --- a/test/test.js +++ b/test/test.js @@ -19,7 +19,7 @@ diffTest('2a', '2b', '2diff', { }, 12437); diffTest('3a', '3b', '3diff', options, 212); diffTest('4a', '4b', '4diff', options, 36049); -diffTest('5a', '5b', '5diff', options, 8); +diffTest('5a', '5b', '5diff', options, 1); diffTest('6a', '6b', '6diff', options, 51); diffTest('6a', '6a', '6empty', {threshold: 0}, 0); diffTest('7a', '7b', '7diff', {diffColorAlt: [0, 255, 0]}, 2448);