UNPKG
@thi.ng/imago
Version:
latest (1.6.17)
1.6.17
1.6.16
1.6.15
1.6.14
1.6.12
1.6.11
1.6.9
1.6.8
1.6.7
1.6.6
1.6.5
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.10
1.5.9
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.15
1.4.14
1.4.13
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.2
1.4.1
1.4.0
1.3.0
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.18
1.0.17
1.0.16
1.0.15
1.0.14
1.0.13
1.0.12
1.0.11
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
0.8.23
0.8.22
0.8.21
0.8.20
0.8.19
0.8.18
0.8.17
0.8.16
0.8.15
0.8.14
0.8.13
0.8.12
0.8.11
0.8.10
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.9
0.7.8
0.7.7
0.7.6
0.7.5
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.11
0.6.10
0.6.9
0.6.8
0.6.7
0.6.6
0.6.5
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0
JSON & API-based declarative and extensible image processing trees/pipelines
thi.ng/imago
@thi.ng/imago
/
ops
/
grayscale.js
12 lines
(11 loc)
•
271 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{ isNumber }
from
"@thi.ng/checks"
;
const
grayscaleProc
=
async
(
spec, input
) => {
const
{ gamma } = spec;
if
(gamma !==
false
) { input = input.
gamma
(
isNumber
(gamma) ? gamma :
void
0
); }
return
[input.
grayscale
(),
true
]; };
export
{ grayscaleProc };