-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilters.js
54 lines (46 loc) · 934 Bytes
/
filters.js
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
45
46
47
48
49
50
51
52
53
54
/*
* Blur
*/
exports.blur = [
[1/9, 1/9, 1/9],
[1/9, 1/9, 1/9],
[1/9, 1/9, 1/9]
];
exports.edgeDetect = [
[0, 1, 0],
[1, -4, 1],
[0, 1, 0]
];
exports.emboss = [
[-2, -1, 0],
[-1, 1, 0],
[0, 1, 2]
];
exports.laplace = [
[-1, -1, -1],
[-1, 8, -1],
[-1, -1, -1]
];
exports.gaussianBlur = [
[0.0030, 0.0133, 0.0219, 0.0133, 0.0030],
[0.0133, 0.0596, 0.0983, 0.0596, 0.0133],
[0.0219, 0.0983, 0.1621, 0.0983, 0.0219],
[0.0133, 0.0596, 0.0983, 0.0596, 0.0133],
[0.0030, 0.0133, 0.0219, 0.0133, 0.0030]
];
exports.motionBlur = [
[1/9, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 1/9, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 1/9, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 1/9, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 1/9, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 1/9, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 1/9, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 1/9, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 1/9]
];
exports.sharpen = [
[-1, -1, -1],
[-1, 9, -1],
[-1, -1, -1]
];