This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 KiB

View File

@ -0,0 +1,30 @@
import { Jimp, getTestDir } from '@jimp/test-utils';
import configure from '@jimp/custom';
import jpeg from '@jimp/jpeg';
import color from '@jimp/plugin-color';
import resize from '@jimp/plugin-resize';
import threshold from '../src';
const jimp = configure(
{ types: [jpeg], plugins: [threshold, color, resize] },
Jimp
);
describe('Threshold', function() {
this.timeout(15000);
it('defines default threshold for lighter backgrounds', async () => {
const expectedImage = await jimp.read(
getTestDir(__dirname) + '/images/hands_mx200_rp255.jpg'
);
const testImage = await jimp.read(
getTestDir(__dirname) + '/images/hands.jpg'
);
testImage
.threshold({ max: 200, replace: 255 })
.hash()
.should.be.equal(expectedImage.hash());
});
});