UNPKG

@thi.ng/imago

Version:

JSON & API-based declarative and extensible image processing trees/pipelines

12 lines (11 loc) 271 B
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 };