Improve normalise op with use of histogram #200

This commit is contained in:
Lovell Fuller
2022-09-04 10:31:43 +01:00
parent 9a54a034e1
commit 55c4d8807c
3 changed files with 7 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ const assertNormalized = function (data) {
max = Math.max(max, data[i]);
}
assert.strictEqual(0, min);
assert.strictEqual(255, max);
assert.ok([254, 255].includes(max));
};
describe('Normalization', function () {
@@ -30,7 +30,6 @@ describe('Normalization', function () {
it('spreads grayscaled image values between 0 and 255', function (done) {
sharp(fixtures.inputJpgWithLowContrast)
.gamma()
.greyscale()
.normalize(true)
.raw()