forked from jimp-dev/jimp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnormalize.test.js
More file actions
44 lines (40 loc) · 1.15 KB
/
normalize.test.js
File metadata and controls
44 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
var {Jimp, mkJGD} = require("./test-helper");
describe("Normalize", ()=> {
it("change grayscale image", (done)=> {
new Jimp(mkJGD(
'36▦',
'6▦9',
'▦9C'
), function (err, image) {
if (err) done(err);
this.normalize().getJGDSync().should.be.sameJGD(mkJGD(
'■5▦',
'5▦A',
'▦A□'
));
done();
}
);
});
it("change red/blue image", (done)=> {
new Jimp({
width: 3,
height: 2,
data: [
0x000000ff, 0x400022ff, 0x40002200,
0x400000ff, 0x000022ff, 0x800055ff
]
}, function (err, image) {
if (err) done(err);
this.normalize().getJGDSync().should.be.sameJGD({
width: 3,
height: 2,
data: [
0x000000ff, 0x7F0066ff, 0x7F006600,
0x7F0000ff, 0x000066ff, 0xFF00FFff
]
});
done();
});
});
});