image-js 0.0.0-next-e30968a2d8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +29 -0
- package/lib/IJS.d.ts +316 -0
- package/lib/IJS.d.ts.map +1 -0
- package/lib/IJS.js +534 -0
- package/lib/IJS.js.map +1 -0
- package/lib/Mask.d.ts +257 -0
- package/lib/Mask.d.ts.map +1 -0
- package/lib/Mask.js +338 -0
- package/lib/Mask.js.map +1 -0
- package/lib/compute/histogram.d.ts +20 -0
- package/lib/compute/histogram.d.ts.map +1 -0
- package/lib/compute/histogram.js +28 -0
- package/lib/compute/histogram.js.map +1 -0
- package/lib/compute/index.d.ts +2 -0
- package/lib/compute/index.d.ts.map +1 -0
- package/lib/compute/index.js +18 -0
- package/lib/compute/index.js.map +1 -0
- package/lib/filters/and.d.ts +17 -0
- package/lib/filters/and.d.ts.map +1 -0
- package/lib/filters/and.js +29 -0
- package/lib/filters/and.js.map +1 -0
- package/lib/filters/blur.d.ts +37 -0
- package/lib/filters/blur.d.ts.map +1 -0
- package/lib/filters/blur.js +22 -0
- package/lib/filters/blur.js.map +1 -0
- package/lib/filters/convolution.d.ts +79 -0
- package/lib/filters/convolution.d.ts.map +1 -0
- package/lib/filters/convolution.js +196 -0
- package/lib/filters/convolution.js.map +1 -0
- package/lib/filters/derivativeFilter.d.ts +40 -0
- package/lib/filters/derivativeFilter.d.ts.map +1 -0
- package/lib/filters/derivativeFilter.js +42 -0
- package/lib/filters/derivativeFilter.js.map +1 -0
- package/lib/filters/gaussianBlur.d.ts +59 -0
- package/lib/filters/gaussianBlur.d.ts.map +1 -0
- package/lib/filters/gaussianBlur.js +59 -0
- package/lib/filters/gaussianBlur.js.map +1 -0
- package/lib/filters/gradientFilter.d.ts +54 -0
- package/lib/filters/gradientFilter.d.ts.map +1 -0
- package/lib/filters/gradientFilter.js +58 -0
- package/lib/filters/gradientFilter.js.map +1 -0
- package/lib/filters/hypotenuse.d.ts +23 -0
- package/lib/filters/hypotenuse.d.ts.map +1 -0
- package/lib/filters/hypotenuse.js +46 -0
- package/lib/filters/hypotenuse.js.map +1 -0
- package/lib/filters/index.d.ts +11 -0
- package/lib/filters/index.d.ts.map +1 -0
- package/lib/filters/index.js +27 -0
- package/lib/filters/index.js.map +1 -0
- package/lib/filters/invert.d.ts +11 -0
- package/lib/filters/invert.d.ts.map +1 -0
- package/lib/filters/invert.js +37 -0
- package/lib/filters/invert.js.map +1 -0
- package/lib/filters/or.d.ts +17 -0
- package/lib/filters/or.d.ts.map +1 -0
- package/lib/filters/or.js +29 -0
- package/lib/filters/or.js.map +1 -0
- package/lib/filters/subtractImage.d.ts +13 -0
- package/lib/filters/subtractImage.d.ts.map +1 -0
- package/lib/filters/subtractImage.js +64 -0
- package/lib/filters/subtractImage.js.map +1 -0
- package/lib/geometry/index.d.ts +4 -0
- package/lib/geometry/index.d.ts.map +1 -0
- package/lib/geometry/index.js +20 -0
- package/lib/geometry/index.js.map +1 -0
- package/lib/geometry/resize.d.ts +52 -0
- package/lib/geometry/resize.d.ts.map +1 -0
- package/lib/geometry/resize.js +107 -0
- package/lib/geometry/resize.js.map +1 -0
- package/lib/geometry/rotate.d.ts +54 -0
- package/lib/geometry/rotate.d.ts.map +1 -0
- package/lib/geometry/rotate.js +44 -0
- package/lib/geometry/rotate.js.map +1 -0
- package/lib/geometry/transform.d.ts +46 -0
- package/lib/geometry/transform.d.ts.map +1 -0
- package/lib/geometry/transform.js +95 -0
- package/lib/geometry/transform.js.map +1 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +26 -0
- package/lib/index.js.map +1 -0
- package/lib/load/decode.d.ts +10 -0
- package/lib/load/decode.d.ts.map +1 -0
- package/lib/load/decode.js +33 -0
- package/lib/load/decode.js.map +1 -0
- package/lib/load/decodeJpeg.d.ts +9 -0
- package/lib/load/decodeJpeg.d.ts.map +1 -0
- package/lib/load/decodeJpeg.js +20 -0
- package/lib/load/decodeJpeg.js.map +1 -0
- package/lib/load/decodePng.d.ts +9 -0
- package/lib/load/decodePng.d.ts.map +1 -0
- package/lib/load/decodePng.js +72 -0
- package/lib/load/decodePng.js.map +1 -0
- package/lib/load/decodeTiff.d.ts +9 -0
- package/lib/load/decodeTiff.d.ts.map +1 -0
- package/lib/load/decodeTiff.js +64 -0
- package/lib/load/decodeTiff.js.map +1 -0
- package/lib/load/index.d.ts +8 -0
- package/lib/load/index.d.ts.map +1 -0
- package/lib/load/index.js +24 -0
- package/lib/load/index.js.map +1 -0
- package/lib/load/read.d.ts +17 -0
- package/lib/load/read.d.ts.map +1 -0
- package/lib/load/read.js +31 -0
- package/lib/load/read.js.map +1 -0
- package/lib/load/readCanvas.d.ts +3 -0
- package/lib/load/readCanvas.d.ts.map +1 -0
- package/lib/load/readCanvas.js +17 -0
- package/lib/load/readCanvas.js.map +1 -0
- package/lib/load/readImg.d.ts +3 -0
- package/lib/load/readImg.d.ts.map +1 -0
- package/lib/load/readImg.js +17 -0
- package/lib/load/readImg.js.map +1 -0
- package/lib/morphology/bottomHat.d.ts +19 -0
- package/lib/morphology/bottomHat.d.ts.map +1 -0
- package/lib/morphology/bottomHat.js +46 -0
- package/lib/morphology/bottomHat.js.map +1 -0
- package/lib/morphology/cannyEdgeDetector.d.ts +49 -0
- package/lib/morphology/cannyEdgeDetector.d.ts.map +1 -0
- package/lib/morphology/cannyEdgeDetector.js +157 -0
- package/lib/morphology/cannyEdgeDetector.js.map +1 -0
- package/lib/morphology/clearBorder.d.ts +22 -0
- package/lib/morphology/clearBorder.d.ts.map +1 -0
- package/lib/morphology/clearBorder.js +89 -0
- package/lib/morphology/clearBorder.js.map +1 -0
- package/lib/morphology/close.d.ts +19 -0
- package/lib/morphology/close.d.ts.map +1 -0
- package/lib/morphology/close.js +41 -0
- package/lib/morphology/close.js.map +1 -0
- package/lib/morphology/dilate.d.ts +20 -0
- package/lib/morphology/dilate.d.ts.map +1 -0
- package/lib/morphology/dilate.js +199 -0
- package/lib/morphology/dilate.js.map +1 -0
- package/lib/morphology/erode.d.ts +20 -0
- package/lib/morphology/erode.d.ts.map +1 -0
- package/lib/morphology/erode.js +199 -0
- package/lib/morphology/erode.js.map +1 -0
- package/lib/morphology/floodFill.d.ts +22 -0
- package/lib/morphology/floodFill.d.ts.map +1 -0
- package/lib/morphology/floodFill.js +20 -0
- package/lib/morphology/floodFill.js.map +1 -0
- package/lib/morphology/index.d.ts +11 -0
- package/lib/morphology/index.d.ts.map +1 -0
- package/lib/morphology/index.js +27 -0
- package/lib/morphology/index.js.map +1 -0
- package/lib/morphology/morphologicalGradient.d.ts +19 -0
- package/lib/morphology/morphologicalGradient.d.ts.map +1 -0
- package/lib/morphology/morphologicalGradient.js +43 -0
- package/lib/morphology/morphologicalGradient.js.map +1 -0
- package/lib/morphology/open.d.ts +19 -0
- package/lib/morphology/open.d.ts.map +1 -0
- package/lib/morphology/open.js +43 -0
- package/lib/morphology/open.js.map +1 -0
- package/lib/morphology/topHat.d.ts +19 -0
- package/lib/morphology/topHat.d.ts.map +1 -0
- package/lib/morphology/topHat.js +44 -0
- package/lib/morphology/topHat.js.map +1 -0
- package/lib/operations/convertColor.d.ts +32 -0
- package/lib/operations/convertColor.d.ts.map +1 -0
- package/lib/operations/convertColor.js +148 -0
- package/lib/operations/convertColor.js.map +1 -0
- package/lib/operations/convertDepth.d.ts +10 -0
- package/lib/operations/convertDepth.d.ts.map +1 -0
- package/lib/operations/convertDepth.js +60 -0
- package/lib/operations/convertDepth.js.map +1 -0
- package/lib/operations/copyTo.d.ts +29 -0
- package/lib/operations/copyTo.d.ts.map +1 -0
- package/lib/operations/copyTo.js +51 -0
- package/lib/operations/copyTo.js.map +1 -0
- package/lib/operations/grey.d.ts +50 -0
- package/lib/operations/grey.d.ts.map +1 -0
- package/lib/operations/grey.js +86 -0
- package/lib/operations/grey.js.map +1 -0
- package/lib/operations/greyAlgorithms.d.ts +149 -0
- package/lib/operations/greyAlgorithms.d.ts.map +1 -0
- package/lib/operations/greyAlgorithms.js +242 -0
- package/lib/operations/greyAlgorithms.js.map +1 -0
- package/lib/operations/index.d.ts +8 -0
- package/lib/operations/index.d.ts.map +1 -0
- package/lib/operations/index.js +24 -0
- package/lib/operations/index.js.map +1 -0
- package/lib/operations/merge.d.ts +9 -0
- package/lib/operations/merge.d.ts.map +1 -0
- package/lib/operations/merge.js +51 -0
- package/lib/operations/merge.js.map +1 -0
- package/lib/operations/split.d.ts +9 -0
- package/lib/operations/split.d.ts.map +1 -0
- package/lib/operations/split.js +23 -0
- package/lib/operations/split.js.map +1 -0
- package/lib/operations/threshold.d.ts +58 -0
- package/lib/operations/threshold.d.ts.map +1 -0
- package/lib/operations/threshold.js +114 -0
- package/lib/operations/threshold.js.map +1 -0
- package/lib/operations/thresholds/huang.d.ts +8 -0
- package/lib/operations/thresholds/huang.d.ts.map +1 -0
- package/lib/operations/thresholds/huang.js +81 -0
- package/lib/operations/thresholds/huang.js.map +1 -0
- package/lib/operations/thresholds/intermodes.d.ts +8 -0
- package/lib/operations/thresholds/intermodes.d.ts.map +1 -0
- package/lib/operations/thresholds/intermodes.js +62 -0
- package/lib/operations/thresholds/intermodes.js.map +1 -0
- package/lib/operations/thresholds/isodata.d.ts +8 -0
- package/lib/operations/thresholds/isodata.d.ts.map +1 -0
- package/lib/operations/thresholds/isodata.js +55 -0
- package/lib/operations/thresholds/isodata.js.map +1 -0
- package/lib/operations/thresholds/li.d.ts +9 -0
- package/lib/operations/thresholds/li.d.ts.map +1 -0
- package/lib/operations/thresholds/li.js +77 -0
- package/lib/operations/thresholds/li.js.map +1 -0
- package/lib/operations/thresholds/maxEntropy.d.ts +9 -0
- package/lib/operations/thresholds/maxEntropy.d.ts.map +1 -0
- package/lib/operations/thresholds/maxEntropy.js +80 -0
- package/lib/operations/thresholds/maxEntropy.js.map +1 -0
- package/lib/operations/thresholds/mean.d.ts +9 -0
- package/lib/operations/thresholds/mean.d.ts.map +1 -0
- package/lib/operations/thresholds/mean.js +26 -0
- package/lib/operations/thresholds/mean.js.map +1 -0
- package/lib/operations/thresholds/minError.d.ts +9 -0
- package/lib/operations/thresholds/minError.d.ts.map +1 -0
- package/lib/operations/thresholds/minError.js +90 -0
- package/lib/operations/thresholds/minError.js.map +1 -0
- package/lib/operations/thresholds/minimum.d.ts +8 -0
- package/lib/operations/thresholds/minimum.d.ts.map +1 -0
- package/lib/operations/thresholds/minimum.js +78 -0
- package/lib/operations/thresholds/minimum.js.map +1 -0
- package/lib/operations/thresholds/moments.d.ts +9 -0
- package/lib/operations/thresholds/moments.d.ts.map +1 -0
- package/lib/operations/thresholds/moments.js +62 -0
- package/lib/operations/thresholds/moments.js.map +1 -0
- package/lib/operations/thresholds/otsu.d.ts +9 -0
- package/lib/operations/thresholds/otsu.d.ts.map +1 -0
- package/lib/operations/thresholds/otsu.js +43 -0
- package/lib/operations/thresholds/otsu.js.map +1 -0
- package/lib/operations/thresholds/percentile.d.ts +8 -0
- package/lib/operations/thresholds/percentile.d.ts.map +1 -0
- package/lib/operations/thresholds/percentile.js +39 -0
- package/lib/operations/thresholds/percentile.js.map +1 -0
- package/lib/operations/thresholds/renyiEntropy.d.ts +9 -0
- package/lib/operations/thresholds/renyiEntropy.d.ts.map +1 -0
- package/lib/operations/thresholds/renyiEntropy.js +133 -0
- package/lib/operations/thresholds/renyiEntropy.js.map +1 -0
- package/lib/operations/thresholds/shanbhag.d.ts +10 -0
- package/lib/operations/thresholds/shanbhag.d.ts.map +1 -0
- package/lib/operations/thresholds/shanbhag.js +77 -0
- package/lib/operations/thresholds/shanbhag.js.map +1 -0
- package/lib/operations/thresholds/triangle.d.ts +8 -0
- package/lib/operations/thresholds/triangle.d.ts.map +1 -0
- package/lib/operations/thresholds/triangle.js +113 -0
- package/lib/operations/thresholds/triangle.js.map +1 -0
- package/lib/operations/thresholds/yen.d.ts +9 -0
- package/lib/operations/thresholds/yen.d.ts.map +1 -0
- package/lib/operations/thresholds/yen.js +62 -0
- package/lib/operations/thresholds/yen.js.map +1 -0
- package/lib/roi/RoiManager.d.ts +32 -0
- package/lib/roi/RoiManager.d.ts.map +1 -0
- package/lib/roi/RoiManager.js +10 -0
- package/lib/roi/RoiManager.js.map +1 -0
- package/lib/roi/RoiMapManager.d.ts +33 -0
- package/lib/roi/RoiMapManager.d.ts.map +1 -0
- package/lib/roi/RoiMapManager.js +17 -0
- package/lib/roi/RoiMapManager.js.map +1 -0
- package/lib/roi/colorRois.d.ts +39 -0
- package/lib/roi/colorRois.d.ts.map +1 -0
- package/lib/roi/colorRois.js +48 -0
- package/lib/roi/colorRois.js.map +1 -0
- package/lib/roi/fromMask.d.ts +19 -0
- package/lib/roi/fromMask.d.ts.map +1 -0
- package/lib/roi/fromMask.js +148 -0
- package/lib/roi/fromMask.js.map +1 -0
- package/lib/roi/index.d.ts +5 -0
- package/lib/roi/index.d.ts.map +1 -0
- package/lib/roi/index.js +21 -0
- package/lib/roi/index.js.map +1 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.d.ts +37 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.d.ts.map +1 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.js +34 -0
- package/lib/roi/utils/colorMaps/getBinaryMap.js.map +1 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.d.ts +25 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.d.ts.map +1 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.js +51 -0
- package/lib/roi/utils/colorMaps/getRainbowMap.js.map +1 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.d.ts +42 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.d.ts.map +1 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.js +39 -0
- package/lib/roi/utils/colorMaps/getSaturationMap.js.map +1 -0
- package/lib/roi/utils/constants.d.ts +4 -0
- package/lib/roi/utils/constants.d.ts.map +1 -0
- package/lib/roi/utils/constants.js +7 -0
- package/lib/roi/utils/constants.js.map +1 -0
- package/lib/roi/utils/getColorMap.d.ts +32 -0
- package/lib/roi/utils/getColorMap.d.ts.map +1 -0
- package/lib/roi/utils/getColorMap.js +28 -0
- package/lib/roi/utils/getColorMap.js.map +1 -0
- package/lib/roi/utils/hsvToRgb.d.ts +21 -0
- package/lib/roi/utils/hsvToRgb.d.ts.map +1 -0
- package/lib/roi/utils/hsvToRgb.js +58 -0
- package/lib/roi/utils/hsvToRgb.js.map +1 -0
- package/lib/roi/utils/rgbToNumber.d.ts +8 -0
- package/lib/roi/utils/rgbToNumber.d.ts.map +1 -0
- package/lib/roi/utils/rgbToNumber.js +14 -0
- package/lib/roi/utils/rgbToNumber.js.map +1 -0
- package/lib/save/encode.d.ts +38 -0
- package/lib/save/encode.d.ts.map +1 -0
- package/lib/save/encode.js +33 -0
- package/lib/save/encode.js.map +1 -0
- package/lib/save/encodeJpeg.d.ts +18 -0
- package/lib/save/encodeJpeg.d.ts.map +1 -0
- package/lib/save/encodeJpeg.js +26 -0
- package/lib/save/encodeJpeg.js.map +1 -0
- package/lib/save/encodePng.d.ts +12 -0
- package/lib/save/encodePng.d.ts.map +1 -0
- package/lib/save/encodePng.js +16 -0
- package/lib/save/encodePng.js.map +1 -0
- package/lib/save/index.d.ts +6 -0
- package/lib/save/index.d.ts.map +1 -0
- package/lib/save/index.js +22 -0
- package/lib/save/index.js.map +1 -0
- package/lib/save/write.d.ts +27 -0
- package/lib/save/write.d.ts.map +1 -0
- package/lib/save/write.js +73 -0
- package/lib/save/write.js.map +1 -0
- package/lib/save/writeCanvas.d.ts +42 -0
- package/lib/save/writeCanvas.d.ts.map +1 -0
- package/lib/save/writeCanvas.js +29 -0
- package/lib/save/writeCanvas.js.map +1 -0
- package/lib/utils/boolToNumber.d.ts +9 -0
- package/lib/utils/boolToNumber.d.ts.map +1 -0
- package/lib/utils/boolToNumber.js +21 -0
- package/lib/utils/boolToNumber.js.map +1 -0
- package/lib/utils/borderIterator.d.ts +9 -0
- package/lib/utils/borderIterator.d.ts.map +1 -0
- package/lib/utils/borderIterator.js +25 -0
- package/lib/utils/borderIterator.js.map +1 -0
- package/lib/utils/checkKernel.d.ts +8 -0
- package/lib/utils/checkKernel.d.ts.map +1 -0
- package/lib/utils/checkKernel.js +16 -0
- package/lib/utils/checkKernel.js.map +1 -0
- package/lib/utils/checkProcessable.d.ts +18 -0
- package/lib/utils/checkProcessable.d.ts.map +1 -0
- package/lib/utils/checkProcessable.js +65 -0
- package/lib/utils/checkProcessable.js.map +1 -0
- package/lib/utils/clamp.d.ts +10 -0
- package/lib/utils/clamp.d.ts.map +1 -0
- package/lib/utils/clamp.js +38 -0
- package/lib/utils/clamp.js.map +1 -0
- package/lib/utils/colorModels.d.ts +15 -0
- package/lib/utils/colorModels.d.ts.map +1 -0
- package/lib/utils/colorModels.js +39 -0
- package/lib/utils/colorModels.js.map +1 -0
- package/lib/utils/copyData.d.ts +4 -0
- package/lib/utils/copyData.d.ts.map +1 -0
- package/lib/utils/copyData.js +20 -0
- package/lib/utils/copyData.js.map +1 -0
- package/lib/utils/getIndex.d.ts +12 -0
- package/lib/utils/getIndex.d.ts.map +1 -0
- package/lib/utils/getIndex.js +17 -0
- package/lib/utils/getIndex.js.map +1 -0
- package/lib/utils/getOutputImage.d.ts +61 -0
- package/lib/utils/getOutputImage.d.ts.map +1 -0
- package/lib/utils/getOutputImage.js +150 -0
- package/lib/utils/getOutputImage.js.map +1 -0
- package/lib/utils/interpolateBorder.d.ts +44 -0
- package/lib/utils/interpolateBorder.d.ts.map +1 -0
- package/lib/utils/interpolateBorder.js +143 -0
- package/lib/utils/interpolateBorder.js.map +1 -0
- package/lib/utils/interpolatePixel.d.ts +18 -0
- package/lib/utils/interpolatePixel.d.ts.map +1 -0
- package/lib/utils/interpolatePixel.js +122 -0
- package/lib/utils/interpolatePixel.js.map +1 -0
- package/lib/utils/kernels.d.ts +13 -0
- package/lib/utils/kernels.d.ts.map +1 -0
- package/lib/utils/kernels.js +66 -0
- package/lib/utils/kernels.js.map +1 -0
- package/lib/utils/kinds.d.ts +9 -0
- package/lib/utils/kinds.d.ts.map +1 -0
- package/lib/utils/kinds.js +23 -0
- package/lib/utils/kinds.js.map +1 -0
- package/lib/utils/round.d.ts +2 -0
- package/lib/utils/round.d.ts.map +1 -0
- package/lib/utils/round.js +11 -0
- package/lib/utils/round.js.map +1 -0
- package/lib/utils/validators.d.ts +23 -0
- package/lib/utils/validators.d.ts.map +1 -0
- package/lib/utils/validators.js +40 -0
- package/lib/utils/validators.js.map +1 -0
- package/lib-esm/IJS.d.ts +316 -0
- package/lib-esm/IJS.d.ts.map +1 -0
- package/lib-esm/IJS.js +526 -0
- package/lib-esm/IJS.js.map +1 -0
- package/lib-esm/Mask.d.ts +257 -0
- package/lib-esm/Mask.d.ts.map +1 -0
- package/lib-esm/Mask.js +334 -0
- package/lib-esm/Mask.js.map +1 -0
- package/lib-esm/compute/histogram.d.ts +20 -0
- package/lib-esm/compute/histogram.d.ts.map +1 -0
- package/lib-esm/compute/histogram.js +24 -0
- package/lib-esm/compute/histogram.js.map +1 -0
- package/lib-esm/compute/index.d.ts +2 -0
- package/lib-esm/compute/index.d.ts.map +1 -0
- package/lib-esm/compute/index.js +2 -0
- package/lib-esm/compute/index.js.map +1 -0
- package/lib-esm/filters/and.d.ts +17 -0
- package/lib-esm/filters/and.d.ts.map +1 -0
- package/lib-esm/filters/and.js +25 -0
- package/lib-esm/filters/and.js.map +1 -0
- package/lib-esm/filters/blur.d.ts +37 -0
- package/lib-esm/filters/blur.d.ts.map +1 -0
- package/lib-esm/filters/blur.js +18 -0
- package/lib-esm/filters/blur.js.map +1 -0
- package/lib-esm/filters/convolution.d.ts +79 -0
- package/lib-esm/filters/convolution.d.ts.map +1 -0
- package/lib-esm/filters/convolution.js +189 -0
- package/lib-esm/filters/convolution.js.map +1 -0
- package/lib-esm/filters/derivativeFilter.d.ts +40 -0
- package/lib-esm/filters/derivativeFilter.d.ts.map +1 -0
- package/lib-esm/filters/derivativeFilter.js +38 -0
- package/lib-esm/filters/derivativeFilter.js.map +1 -0
- package/lib-esm/filters/gaussianBlur.d.ts +59 -0
- package/lib-esm/filters/gaussianBlur.d.ts.map +1 -0
- package/lib-esm/filters/gaussianBlur.js +55 -0
- package/lib-esm/filters/gaussianBlur.js.map +1 -0
- package/lib-esm/filters/gradientFilter.d.ts +54 -0
- package/lib-esm/filters/gradientFilter.d.ts.map +1 -0
- package/lib-esm/filters/gradientFilter.js +51 -0
- package/lib-esm/filters/gradientFilter.js.map +1 -0
- package/lib-esm/filters/hypotenuse.d.ts +23 -0
- package/lib-esm/filters/hypotenuse.d.ts.map +1 -0
- package/lib-esm/filters/hypotenuse.js +39 -0
- package/lib-esm/filters/hypotenuse.js.map +1 -0
- package/lib-esm/filters/index.d.ts +11 -0
- package/lib-esm/filters/index.d.ts.map +1 -0
- package/lib-esm/filters/index.js +11 -0
- package/lib-esm/filters/index.js.map +1 -0
- package/lib-esm/filters/invert.d.ts +11 -0
- package/lib-esm/filters/invert.d.ts.map +1 -0
- package/lib-esm/filters/invert.js +33 -0
- package/lib-esm/filters/invert.js.map +1 -0
- package/lib-esm/filters/or.d.ts +17 -0
- package/lib-esm/filters/or.d.ts.map +1 -0
- package/lib-esm/filters/or.js +25 -0
- package/lib-esm/filters/or.js.map +1 -0
- package/lib-esm/filters/subtractImage.d.ts +13 -0
- package/lib-esm/filters/subtractImage.d.ts.map +1 -0
- package/lib-esm/filters/subtractImage.js +57 -0
- package/lib-esm/filters/subtractImage.js.map +1 -0
- package/lib-esm/geometry/index.d.ts +4 -0
- package/lib-esm/geometry/index.d.ts.map +1 -0
- package/lib-esm/geometry/index.js +4 -0
- package/lib-esm/geometry/index.js.map +1 -0
- package/lib-esm/geometry/resize.d.ts +52 -0
- package/lib-esm/geometry/resize.d.ts.map +1 -0
- package/lib-esm/geometry/resize.js +103 -0
- package/lib-esm/geometry/resize.js.map +1 -0
- package/lib-esm/geometry/rotate.d.ts +54 -0
- package/lib-esm/geometry/rotate.d.ts.map +1 -0
- package/lib-esm/geometry/rotate.js +40 -0
- package/lib-esm/geometry/rotate.js.map +1 -0
- package/lib-esm/geometry/transform.d.ts +46 -0
- package/lib-esm/geometry/transform.d.ts.map +1 -0
- package/lib-esm/geometry/transform.js +91 -0
- package/lib-esm/geometry/transform.js.map +1 -0
- package/lib-esm/index.d.ts +10 -0
- package/lib-esm/index.d.ts.map +1 -0
- package/lib-esm/index.js +10 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/load/decode.d.ts +10 -0
- package/lib-esm/load/decode.d.ts.map +1 -0
- package/lib-esm/load/decode.js +26 -0
- package/lib-esm/load/decode.js.map +1 -0
- package/lib-esm/load/decodeJpeg.d.ts +9 -0
- package/lib-esm/load/decodeJpeg.d.ts.map +1 -0
- package/lib-esm/load/decodeJpeg.js +16 -0
- package/lib-esm/load/decodeJpeg.js.map +1 -0
- package/lib-esm/load/decodePng.d.ts +9 -0
- package/lib-esm/load/decodePng.d.ts.map +1 -0
- package/lib-esm/load/decodePng.js +68 -0
- package/lib-esm/load/decodePng.js.map +1 -0
- package/lib-esm/load/decodeTiff.d.ts +9 -0
- package/lib-esm/load/decodeTiff.d.ts.map +1 -0
- package/lib-esm/load/decodeTiff.js +60 -0
- package/lib-esm/load/decodeTiff.js.map +1 -0
- package/lib-esm/load/index.d.ts +8 -0
- package/lib-esm/load/index.d.ts.map +1 -0
- package/lib-esm/load/index.js +8 -0
- package/lib-esm/load/index.js.map +1 -0
- package/lib-esm/load/read.d.ts +17 -0
- package/lib-esm/load/read.d.ts.map +1 -0
- package/lib-esm/load/read.js +23 -0
- package/lib-esm/load/read.js.map +1 -0
- package/lib-esm/load/readCanvas.d.ts +3 -0
- package/lib-esm/load/readCanvas.d.ts.map +1 -0
- package/lib-esm/load/readCanvas.js +13 -0
- package/lib-esm/load/readCanvas.js.map +1 -0
- package/lib-esm/load/readImg.d.ts +3 -0
- package/lib-esm/load/readImg.d.ts.map +1 -0
- package/lib-esm/load/readImg.js +13 -0
- package/lib-esm/load/readImg.js.map +1 -0
- package/lib-esm/morphology/bottomHat.d.ts +19 -0
- package/lib-esm/morphology/bottomHat.d.ts.map +1 -0
- package/lib-esm/morphology/bottomHat.js +39 -0
- package/lib-esm/morphology/bottomHat.js.map +1 -0
- package/lib-esm/morphology/cannyEdgeDetector.d.ts +49 -0
- package/lib-esm/morphology/cannyEdgeDetector.d.ts.map +1 -0
- package/lib-esm/morphology/cannyEdgeDetector.js +149 -0
- package/lib-esm/morphology/cannyEdgeDetector.js.map +1 -0
- package/lib-esm/morphology/clearBorder.d.ts +22 -0
- package/lib-esm/morphology/clearBorder.d.ts.map +1 -0
- package/lib-esm/morphology/clearBorder.js +85 -0
- package/lib-esm/morphology/clearBorder.js.map +1 -0
- package/lib-esm/morphology/close.d.ts +19 -0
- package/lib-esm/morphology/close.d.ts.map +1 -0
- package/lib-esm/morphology/close.js +34 -0
- package/lib-esm/morphology/close.js.map +1 -0
- package/lib-esm/morphology/dilate.d.ts +20 -0
- package/lib-esm/morphology/dilate.d.ts.map +1 -0
- package/lib-esm/morphology/dilate.js +192 -0
- package/lib-esm/morphology/dilate.js.map +1 -0
- package/lib-esm/morphology/erode.d.ts +20 -0
- package/lib-esm/morphology/erode.d.ts.map +1 -0
- package/lib-esm/morphology/erode.js +192 -0
- package/lib-esm/morphology/erode.js.map +1 -0
- package/lib-esm/morphology/floodFill.d.ts +22 -0
- package/lib-esm/morphology/floodFill.d.ts.map +1 -0
- package/lib-esm/morphology/floodFill.js +16 -0
- package/lib-esm/morphology/floodFill.js.map +1 -0
- package/lib-esm/morphology/index.d.ts +11 -0
- package/lib-esm/morphology/index.d.ts.map +1 -0
- package/lib-esm/morphology/index.js +11 -0
- package/lib-esm/morphology/index.js.map +1 -0
- package/lib-esm/morphology/morphologicalGradient.d.ts +19 -0
- package/lib-esm/morphology/morphologicalGradient.d.ts.map +1 -0
- package/lib-esm/morphology/morphologicalGradient.js +36 -0
- package/lib-esm/morphology/morphologicalGradient.js.map +1 -0
- package/lib-esm/morphology/open.d.ts +19 -0
- package/lib-esm/morphology/open.d.ts.map +1 -0
- package/lib-esm/morphology/open.js +36 -0
- package/lib-esm/morphology/open.js.map +1 -0
- package/lib-esm/morphology/topHat.d.ts +19 -0
- package/lib-esm/morphology/topHat.d.ts.map +1 -0
- package/lib-esm/morphology/topHat.js +37 -0
- package/lib-esm/morphology/topHat.js.map +1 -0
- package/lib-esm/operations/convertColor.d.ts +32 -0
- package/lib-esm/operations/convertColor.d.ts.map +1 -0
- package/lib-esm/operations/convertColor.js +142 -0
- package/lib-esm/operations/convertColor.js.map +1 -0
- package/lib-esm/operations/convertDepth.d.ts +10 -0
- package/lib-esm/operations/convertDepth.d.ts.map +1 -0
- package/lib-esm/operations/convertDepth.js +56 -0
- package/lib-esm/operations/convertDepth.js.map +1 -0
- package/lib-esm/operations/copyTo.d.ts +29 -0
- package/lib-esm/operations/copyTo.d.ts.map +1 -0
- package/lib-esm/operations/copyTo.js +48 -0
- package/lib-esm/operations/copyTo.js.map +1 -0
- package/lib-esm/operations/grey.d.ts +50 -0
- package/lib-esm/operations/grey.d.ts.map +1 -0
- package/lib-esm/operations/grey.js +60 -0
- package/lib-esm/operations/grey.js.map +1 -0
- package/lib-esm/operations/greyAlgorithms.d.ts +149 -0
- package/lib-esm/operations/greyAlgorithms.d.ts.map +1 -0
- package/lib-esm/operations/greyAlgorithms.js +223 -0
- package/lib-esm/operations/greyAlgorithms.js.map +1 -0
- package/lib-esm/operations/index.d.ts +8 -0
- package/lib-esm/operations/index.d.ts.map +1 -0
- package/lib-esm/operations/index.js +8 -0
- package/lib-esm/operations/index.js.map +1 -0
- package/lib-esm/operations/merge.d.ts +9 -0
- package/lib-esm/operations/merge.d.ts.map +1 -0
- package/lib-esm/operations/merge.js +47 -0
- package/lib-esm/operations/merge.js.map +1 -0
- package/lib-esm/operations/split.d.ts +9 -0
- package/lib-esm/operations/split.d.ts.map +1 -0
- package/lib-esm/operations/split.js +19 -0
- package/lib-esm/operations/split.js.map +1 -0
- package/lib-esm/operations/threshold.d.ts +58 -0
- package/lib-esm/operations/threshold.d.ts.map +1 -0
- package/lib-esm/operations/threshold.js +106 -0
- package/lib-esm/operations/threshold.js.map +1 -0
- package/lib-esm/operations/thresholds/huang.d.ts +8 -0
- package/lib-esm/operations/thresholds/huang.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/huang.js +78 -0
- package/lib-esm/operations/thresholds/huang.js.map +1 -0
- package/lib-esm/operations/thresholds/intermodes.d.ts +8 -0
- package/lib-esm/operations/thresholds/intermodes.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/intermodes.js +59 -0
- package/lib-esm/operations/thresholds/intermodes.js.map +1 -0
- package/lib-esm/operations/thresholds/isodata.d.ts +8 -0
- package/lib-esm/operations/thresholds/isodata.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/isodata.js +52 -0
- package/lib-esm/operations/thresholds/isodata.js.map +1 -0
- package/lib-esm/operations/thresholds/li.d.ts +9 -0
- package/lib-esm/operations/thresholds/li.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/li.js +74 -0
- package/lib-esm/operations/thresholds/li.js.map +1 -0
- package/lib-esm/operations/thresholds/maxEntropy.d.ts +9 -0
- package/lib-esm/operations/thresholds/maxEntropy.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/maxEntropy.js +77 -0
- package/lib-esm/operations/thresholds/maxEntropy.js.map +1 -0
- package/lib-esm/operations/thresholds/mean.d.ts +9 -0
- package/lib-esm/operations/thresholds/mean.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/mean.js +23 -0
- package/lib-esm/operations/thresholds/mean.js.map +1 -0
- package/lib-esm/operations/thresholds/minError.d.ts +9 -0
- package/lib-esm/operations/thresholds/minError.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/minError.js +87 -0
- package/lib-esm/operations/thresholds/minError.js.map +1 -0
- package/lib-esm/operations/thresholds/minimum.d.ts +8 -0
- package/lib-esm/operations/thresholds/minimum.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/minimum.js +75 -0
- package/lib-esm/operations/thresholds/minimum.js.map +1 -0
- package/lib-esm/operations/thresholds/moments.d.ts +9 -0
- package/lib-esm/operations/thresholds/moments.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/moments.js +59 -0
- package/lib-esm/operations/thresholds/moments.js.map +1 -0
- package/lib-esm/operations/thresholds/otsu.d.ts +9 -0
- package/lib-esm/operations/thresholds/otsu.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/otsu.js +39 -0
- package/lib-esm/operations/thresholds/otsu.js.map +1 -0
- package/lib-esm/operations/thresholds/percentile.d.ts +8 -0
- package/lib-esm/operations/thresholds/percentile.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/percentile.js +36 -0
- package/lib-esm/operations/thresholds/percentile.js.map +1 -0
- package/lib-esm/operations/thresholds/renyiEntropy.d.ts +9 -0
- package/lib-esm/operations/thresholds/renyiEntropy.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/renyiEntropy.js +130 -0
- package/lib-esm/operations/thresholds/renyiEntropy.js.map +1 -0
- package/lib-esm/operations/thresholds/shanbhag.d.ts +10 -0
- package/lib-esm/operations/thresholds/shanbhag.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/shanbhag.js +74 -0
- package/lib-esm/operations/thresholds/shanbhag.js.map +1 -0
- package/lib-esm/operations/thresholds/triangle.d.ts +8 -0
- package/lib-esm/operations/thresholds/triangle.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/triangle.js +109 -0
- package/lib-esm/operations/thresholds/triangle.js.map +1 -0
- package/lib-esm/operations/thresholds/yen.d.ts +9 -0
- package/lib-esm/operations/thresholds/yen.d.ts.map +1 -0
- package/lib-esm/operations/thresholds/yen.js +59 -0
- package/lib-esm/operations/thresholds/yen.js.map +1 -0
- package/lib-esm/roi/RoiManager.d.ts +32 -0
- package/lib-esm/roi/RoiManager.d.ts.map +1 -0
- package/lib-esm/roi/RoiManager.js +7 -0
- package/lib-esm/roi/RoiManager.js.map +1 -0
- package/lib-esm/roi/RoiMapManager.d.ts +33 -0
- package/lib-esm/roi/RoiMapManager.d.ts.map +1 -0
- package/lib-esm/roi/RoiMapManager.js +13 -0
- package/lib-esm/roi/RoiMapManager.js.map +1 -0
- package/lib-esm/roi/colorRois.d.ts +39 -0
- package/lib-esm/roi/colorRois.d.ts.map +1 -0
- package/lib-esm/roi/colorRois.js +44 -0
- package/lib-esm/roi/colorRois.js.map +1 -0
- package/lib-esm/roi/fromMask.d.ts +19 -0
- package/lib-esm/roi/fromMask.d.ts.map +1 -0
- package/lib-esm/roi/fromMask.js +144 -0
- package/lib-esm/roi/fromMask.js.map +1 -0
- package/lib-esm/roi/index.d.ts +5 -0
- package/lib-esm/roi/index.d.ts.map +1 -0
- package/lib-esm/roi/index.js +5 -0
- package/lib-esm/roi/index.js.map +1 -0
- package/lib-esm/roi/utils/colorMaps/getBinaryMap.d.ts +37 -0
- package/lib-esm/roi/utils/colorMaps/getBinaryMap.d.ts.map +1 -0
- package/lib-esm/roi/utils/colorMaps/getBinaryMap.js +30 -0
- package/lib-esm/roi/utils/colorMaps/getBinaryMap.js.map +1 -0
- package/lib-esm/roi/utils/colorMaps/getRainbowMap.d.ts +25 -0
- package/lib-esm/roi/utils/colorMaps/getRainbowMap.d.ts.map +1 -0
- package/lib-esm/roi/utils/colorMaps/getRainbowMap.js +47 -0
- package/lib-esm/roi/utils/colorMaps/getRainbowMap.js.map +1 -0
- package/lib-esm/roi/utils/colorMaps/getSaturationMap.d.ts +42 -0
- package/lib-esm/roi/utils/colorMaps/getSaturationMap.d.ts.map +1 -0
- package/lib-esm/roi/utils/colorMaps/getSaturationMap.js +35 -0
- package/lib-esm/roi/utils/colorMaps/getSaturationMap.js.map +1 -0
- package/lib-esm/roi/utils/constants.d.ts +4 -0
- package/lib-esm/roi/utils/constants.d.ts.map +1 -0
- package/lib-esm/roi/utils/constants.js +4 -0
- package/lib-esm/roi/utils/constants.js.map +1 -0
- package/lib-esm/roi/utils/getColorMap.d.ts +32 -0
- package/lib-esm/roi/utils/getColorMap.d.ts.map +1 -0
- package/lib-esm/roi/utils/getColorMap.js +24 -0
- package/lib-esm/roi/utils/getColorMap.js.map +1 -0
- package/lib-esm/roi/utils/hsvToRgb.d.ts +21 -0
- package/lib-esm/roi/utils/hsvToRgb.d.ts.map +1 -0
- package/lib-esm/roi/utils/hsvToRgb.js +54 -0
- package/lib-esm/roi/utils/hsvToRgb.js.map +1 -0
- package/lib-esm/roi/utils/rgbToNumber.d.ts +8 -0
- package/lib-esm/roi/utils/rgbToNumber.d.ts.map +1 -0
- package/lib-esm/roi/utils/rgbToNumber.js +10 -0
- package/lib-esm/roi/utils/rgbToNumber.js.map +1 -0
- package/lib-esm/save/encode.d.ts +38 -0
- package/lib-esm/save/encode.d.ts.map +1 -0
- package/lib-esm/save/encode.js +29 -0
- package/lib-esm/save/encode.js.map +1 -0
- package/lib-esm/save/encodeJpeg.d.ts +18 -0
- package/lib-esm/save/encodeJpeg.d.ts.map +1 -0
- package/lib-esm/save/encodeJpeg.js +22 -0
- package/lib-esm/save/encodeJpeg.js.map +1 -0
- package/lib-esm/save/encodePng.d.ts +12 -0
- package/lib-esm/save/encodePng.d.ts.map +1 -0
- package/lib-esm/save/encodePng.js +12 -0
- package/lib-esm/save/encodePng.js.map +1 -0
- package/lib-esm/save/index.d.ts +6 -0
- package/lib-esm/save/index.d.ts.map +1 -0
- package/lib-esm/save/index.js +6 -0
- package/lib-esm/save/index.js.map +1 -0
- package/lib-esm/save/write.d.ts +27 -0
- package/lib-esm/save/write.d.ts.map +1 -0
- package/lib-esm/save/write.js +65 -0
- package/lib-esm/save/write.js.map +1 -0
- package/lib-esm/save/writeCanvas.d.ts +42 -0
- package/lib-esm/save/writeCanvas.d.ts.map +1 -0
- package/lib-esm/save/writeCanvas.js +25 -0
- package/lib-esm/save/writeCanvas.js.map +1 -0
- package/lib-esm/utils/boolToNumber.d.ts +9 -0
- package/lib-esm/utils/boolToNumber.d.ts.map +1 -0
- package/lib-esm/utils/boolToNumber.js +17 -0
- package/lib-esm/utils/boolToNumber.js.map +1 -0
- package/lib-esm/utils/borderIterator.d.ts +9 -0
- package/lib-esm/utils/borderIterator.d.ts.map +1 -0
- package/lib-esm/utils/borderIterator.js +21 -0
- package/lib-esm/utils/borderIterator.js.map +1 -0
- package/lib-esm/utils/checkKernel.d.ts +8 -0
- package/lib-esm/utils/checkKernel.d.ts.map +1 -0
- package/lib-esm/utils/checkKernel.js +12 -0
- package/lib-esm/utils/checkKernel.js.map +1 -0
- package/lib-esm/utils/checkProcessable.d.ts +18 -0
- package/lib-esm/utils/checkProcessable.d.ts.map +1 -0
- package/lib-esm/utils/checkProcessable.js +62 -0
- package/lib-esm/utils/checkProcessable.js.map +1 -0
- package/lib-esm/utils/clamp.d.ts +10 -0
- package/lib-esm/utils/clamp.d.ts.map +1 -0
- package/lib-esm/utils/clamp.js +34 -0
- package/lib-esm/utils/clamp.js.map +1 -0
- package/lib-esm/utils/colorModels.d.ts +15 -0
- package/lib-esm/utils/colorModels.d.ts.map +1 -0
- package/lib-esm/utils/colorModels.js +36 -0
- package/lib-esm/utils/colorModels.js.map +1 -0
- package/lib-esm/utils/copyData.d.ts +4 -0
- package/lib-esm/utils/copyData.d.ts.map +1 -0
- package/lib-esm/utils/copyData.js +16 -0
- package/lib-esm/utils/copyData.js.map +1 -0
- package/lib-esm/utils/getIndex.d.ts +12 -0
- package/lib-esm/utils/getIndex.d.ts.map +1 -0
- package/lib-esm/utils/getIndex.js +13 -0
- package/lib-esm/utils/getIndex.js.map +1 -0
- package/lib-esm/utils/getOutputImage.d.ts +61 -0
- package/lib-esm/utils/getOutputImage.d.ts.map +1 -0
- package/lib-esm/utils/getOutputImage.js +143 -0
- package/lib-esm/utils/getOutputImage.js.map +1 -0
- package/lib-esm/utils/interpolateBorder.d.ts +44 -0
- package/lib-esm/utils/interpolateBorder.d.ts.map +1 -0
- package/lib-esm/utils/interpolateBorder.js +134 -0
- package/lib-esm/utils/interpolateBorder.js.map +1 -0
- package/lib-esm/utils/interpolatePixel.d.ts +18 -0
- package/lib-esm/utils/interpolatePixel.d.ts.map +1 -0
- package/lib-esm/utils/interpolatePixel.js +118 -0
- package/lib-esm/utils/interpolatePixel.js.map +1 -0
- package/lib-esm/utils/kernels.d.ts +13 -0
- package/lib-esm/utils/kernels.d.ts.map +1 -0
- package/lib-esm/utils/kernels.js +63 -0
- package/lib-esm/utils/kernels.js.map +1 -0
- package/lib-esm/utils/kinds.d.ts +9 -0
- package/lib-esm/utils/kinds.d.ts.map +1 -0
- package/lib-esm/utils/kinds.js +20 -0
- package/lib-esm/utils/kinds.js.map +1 -0
- package/lib-esm/utils/round.d.ts +2 -0
- package/lib-esm/utils/round.d.ts.map +1 -0
- package/lib-esm/utils/round.js +7 -0
- package/lib-esm/utils/round.js.map +1 -0
- package/lib-esm/utils/validators.d.ts +23 -0
- package/lib-esm/utils/validators.d.ts.map +1 -0
- package/lib-esm/utils/validators.js +34 -0
- package/lib-esm/utils/validators.js.map +1 -0
- package/package.json +79 -0
- package/src/IJS.ts +758 -0
- package/src/Mask.ts +476 -0
- package/src/compute/histogram.ts +39 -0
- package/src/compute/index.ts +1 -0
- package/src/filters/and.ts +34 -0
- package/src/filters/blur.ts +49 -0
- package/src/filters/convolution.ts +357 -0
- package/src/filters/derivativeFilter.ts +77 -0
- package/src/filters/gaussianBlur.ts +124 -0
- package/src/filters/gradientFilter.ts +106 -0
- package/src/filters/hypotenuse.ts +74 -0
- package/src/filters/index.ts +10 -0
- package/src/filters/invert.ts +47 -0
- package/src/filters/or.ts +34 -0
- package/src/filters/subtractImage.ts +91 -0
- package/src/geometry/index.ts +3 -0
- package/src/geometry/resize.ts +182 -0
- package/src/geometry/rotate.ts +99 -0
- package/src/geometry/transform.ts +169 -0
- package/src/index.ts +9 -0
- package/src/load/decode.ts +33 -0
- package/src/load/decodeJpeg.ts +17 -0
- package/src/load/decodePng.ts +78 -0
- package/src/load/decodeTiff.ts +64 -0
- package/src/load/index.ts +7 -0
- package/src/load/read.ts +27 -0
- package/src/load/readCanvas.ts +17 -0
- package/src/load/readImg.ts +15 -0
- package/src/morphology/bottomHat.ts +66 -0
- package/src/morphology/cannyEdgeDetector.ts +214 -0
- package/src/morphology/clearBorder.ts +116 -0
- package/src/morphology/close.ts +61 -0
- package/src/morphology/dilate.ts +264 -0
- package/src/morphology/erode.ts +264 -0
- package/src/morphology/floodFill.ts +31 -0
- package/src/morphology/index.ts +10 -0
- package/src/morphology/morphologicalGradient.ts +69 -0
- package/src/morphology/open.ts +61 -0
- package/src/morphology/topHat.ts +64 -0
- package/src/operations/convertColor.ts +185 -0
- package/src/operations/convertDepth.ts +59 -0
- package/src/operations/copyTo.ts +107 -0
- package/src/operations/grey.ts +114 -0
- package/src/operations/greyAlgorithms.ts +265 -0
- package/src/operations/index.ts +7 -0
- package/src/operations/merge.ts +52 -0
- package/src/operations/split.ts +19 -0
- package/src/operations/threshold.ts +145 -0
- package/src/operations/thresholds/huang.ts +84 -0
- package/src/operations/thresholds/intermodes.ts +62 -0
- package/src/operations/thresholds/isodata.ts +53 -0
- package/src/operations/thresholds/li.ts +81 -0
- package/src/operations/thresholds/maxEntropy.ts +89 -0
- package/src/operations/thresholds/mean.ts +23 -0
- package/src/operations/thresholds/minError.ts +102 -0
- package/src/operations/thresholds/minimum.ts +78 -0
- package/src/operations/thresholds/moments.ts +60 -0
- package/src/operations/thresholds/otsu.ts +42 -0
- package/src/operations/thresholds/percentile.ts +40 -0
- package/src/operations/thresholds/renyiEntropy.ts +148 -0
- package/src/operations/thresholds/shanbhag.ts +82 -0
- package/src/operations/thresholds/triangle.ts +115 -0
- package/src/operations/thresholds/yen.ts +63 -0
- package/src/roi/RoiManager.ts +34 -0
- package/src/roi/RoiMapManager.ts +48 -0
- package/src/roi/colorRois.ts +69 -0
- package/src/roi/fromMask.ts +184 -0
- package/src/roi/index.ts +4 -0
- package/src/roi/utils/colorMaps/getBinaryMap.ts +72 -0
- package/src/roi/utils/colorMaps/getRainbowMap.ts +65 -0
- package/src/roi/utils/colorMaps/getSaturationMap.ts +80 -0
- package/src/roi/utils/constants.ts +3 -0
- package/src/roi/utils/getColorMap.ts +51 -0
- package/src/roi/utils/hsvToRgb.ts +62 -0
- package/src/roi/utils/rgbToNumber.ts +9 -0
- package/src/save/encode.ts +65 -0
- package/src/save/encodeJpeg.ts +37 -0
- package/src/save/encodePng.ts +16 -0
- package/src/save/index.ts +5 -0
- package/src/save/write.ts +109 -0
- package/src/save/writeCanvas.ts +82 -0
- package/src/utils/boolToNumber.ts +18 -0
- package/src/utils/borderIterator.ts +22 -0
- package/src/utils/checkKernel.ts +13 -0
- package/src/utils/checkProcessable.ts +98 -0
- package/src/utils/clamp.ts +39 -0
- package/src/utils/colorModels.ts +41 -0
- package/src/utils/copyData.ts +23 -0
- package/src/utils/getIndex.ts +19 -0
- package/src/utils/getOutputImage.ts +182 -0
- package/src/utils/interpolateBorder.ts +206 -0
- package/src/utils/interpolatePixel.ts +170 -0
- package/src/utils/kernels.ts +73 -0
- package/src/utils/kinds.ts +27 -0
- package/src/utils/round.ts +6 -0
- package/src/utils/validators.ts +43 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { IJS, ImageColorModel } from '../IJS';
|
|
2
|
+
import { getOutputImage, maskToOutputImage } from '../utils/getOutputImage';
|
|
3
|
+
/**
|
|
4
|
+
* Convert image to a different color model.
|
|
5
|
+
*
|
|
6
|
+
* @param image - Image to convert.
|
|
7
|
+
* @param colorModel - New color model.
|
|
8
|
+
* @param options - Convert color options.
|
|
9
|
+
* @returns The converted image.
|
|
10
|
+
*/
|
|
11
|
+
export function convertColor(image, colorModel, options = {}) {
|
|
12
|
+
const canConvert = new Map([
|
|
13
|
+
[
|
|
14
|
+
ImageColorModel.GREY,
|
|
15
|
+
[ImageColorModel.GREYA, ImageColorModel.RGB, ImageColorModel.RGBA],
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
ImageColorModel.GREYA,
|
|
19
|
+
[ImageColorModel.GREY, ImageColorModel.RGB, ImageColorModel.RGBA],
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
ImageColorModel.RGB,
|
|
23
|
+
[ImageColorModel.GREYA, ImageColorModel.GREY, ImageColorModel.RGBA],
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
ImageColorModel.RGBA,
|
|
27
|
+
[ImageColorModel.GREYA, ImageColorModel.GREY, ImageColorModel.RGB],
|
|
28
|
+
],
|
|
29
|
+
[ImageColorModel.BINARY, [ImageColorModel.GREY]],
|
|
30
|
+
]);
|
|
31
|
+
if (image.colorModel === colorModel) {
|
|
32
|
+
throw new Error(`Cannot convert color, image is already ${colorModel}`);
|
|
33
|
+
}
|
|
34
|
+
const canConvertTo = canConvert.get(image.colorModel);
|
|
35
|
+
if (!canConvertTo || !canConvertTo.includes(colorModel)) {
|
|
36
|
+
throw new Error(`conversion from ${image.colorModel} to ${colorModel} not implemented`);
|
|
37
|
+
}
|
|
38
|
+
if (image instanceof IJS) {
|
|
39
|
+
const output = getOutputImage(image, options, {
|
|
40
|
+
newParameters: { colorModel: colorModel },
|
|
41
|
+
});
|
|
42
|
+
if (image.colorModel === ImageColorModel.GREY ||
|
|
43
|
+
image.colorModel === ImageColorModel.GREYA) {
|
|
44
|
+
convertGreyToAny(image, output);
|
|
45
|
+
}
|
|
46
|
+
if (image.colorModel === ImageColorModel.RGB ||
|
|
47
|
+
image.colorModel === ImageColorModel.RGBA) {
|
|
48
|
+
if (colorModel === ImageColorModel.RGB ||
|
|
49
|
+
colorModel === ImageColorModel.RGBA) {
|
|
50
|
+
convertRgbToRgb(image, output);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// GREYA or GREY
|
|
54
|
+
convertRgbToGrey(image, output);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!image.alpha && output.alpha) {
|
|
58
|
+
output.fillAlpha(output.maxValue);
|
|
59
|
+
}
|
|
60
|
+
if (image.alpha && output.alpha) {
|
|
61
|
+
copyAlpha(image, output);
|
|
62
|
+
}
|
|
63
|
+
return output;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const output = maskToOutputImage(image, options);
|
|
67
|
+
convertBinaryToGrey(image, output);
|
|
68
|
+
return output;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Copy alpha channel of source to dest.
|
|
73
|
+
*
|
|
74
|
+
* @param source - Source image.
|
|
75
|
+
* @param dest - Destination image.
|
|
76
|
+
*/
|
|
77
|
+
export function copyAlpha(source, dest) {
|
|
78
|
+
if (source.size !== dest.size) {
|
|
79
|
+
throw new Error('source and destination have different sizes');
|
|
80
|
+
}
|
|
81
|
+
if (!source.alpha) {
|
|
82
|
+
throw new Error('source image does not have alpha');
|
|
83
|
+
}
|
|
84
|
+
if (!dest.alpha) {
|
|
85
|
+
throw new Error('destination does not have alpha');
|
|
86
|
+
}
|
|
87
|
+
for (let i = 0; i < dest.size; i++) {
|
|
88
|
+
dest.setValueByIndex(i, dest.channels - 1, source.getValueByIndex(i, source.channels - 1));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Convert grey image to other color model.
|
|
93
|
+
*
|
|
94
|
+
* @param image - Image to convert.
|
|
95
|
+
* @param newImage - Converted image.
|
|
96
|
+
*/
|
|
97
|
+
function convertGreyToAny(image, newImage) {
|
|
98
|
+
for (let i = 0; i < image.size; i++) {
|
|
99
|
+
for (let j = 0; j < newImage.components; j++) {
|
|
100
|
+
newImage.setValueByIndex(i, j, image.getValueByIndex(i, 0));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Convert RGB image to RGB. Allows to use convert with an RGB target whatever the image color model is.
|
|
106
|
+
*
|
|
107
|
+
* @param image - Image to convert.
|
|
108
|
+
* @param newImage - Converted image.
|
|
109
|
+
*/
|
|
110
|
+
function convertRgbToRgb(image, newImage) {
|
|
111
|
+
for (let i = 0; i < image.size; i++) {
|
|
112
|
+
for (let j = 0; j < 3; j++) {
|
|
113
|
+
newImage.setValueByIndex(i, j, image.getValueByIndex(i, j));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Convert RGB image to GREY.
|
|
119
|
+
*
|
|
120
|
+
* @param image - Image to convert.
|
|
121
|
+
* @param newImage - Converted image.
|
|
122
|
+
*/
|
|
123
|
+
function convertRgbToGrey(image, newImage) {
|
|
124
|
+
for (let i = 0; i < image.size; i++) {
|
|
125
|
+
const r = image.getValueByIndex(i, 0);
|
|
126
|
+
const g = image.getValueByIndex(i, 1);
|
|
127
|
+
const b = image.getValueByIndex(i, 2);
|
|
128
|
+
newImage.setValueByIndex(i, 0, Math.round(0.299 * r + 0.587 * g + 0.114 * b));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Convert Mask to GREY.
|
|
133
|
+
*
|
|
134
|
+
* @param mask - Mask to convert.
|
|
135
|
+
* @param newImage - Converted image.
|
|
136
|
+
*/
|
|
137
|
+
export function convertBinaryToGrey(mask, newImage) {
|
|
138
|
+
for (let i = 0; i < mask.size; i++) {
|
|
139
|
+
newImage.setValueByIndex(i, 0, mask.getBitByIndex(i) ? newImage.maxValue : 0);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=convertColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertColor.js","sourceRoot":"","sources":["../../src/operations/convertColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAS5E;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAiB,EACjB,UAA2B,EAC3B,UAA+B,EAAE;IAEjC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC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AG,KAAK,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,QAAQ,CAAC,eAAe,CACtB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAC9C,CAAC;KACH;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAU,EAAE,QAAa;IAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QAClC,QAAQ,CAAC,eAAe,CACtB,CAAC,EACD,CAAC,EACD,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAC9C,CAAC;KACH;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IJS, ColorDepth } from '../IJS';
|
|
2
|
+
/**
|
|
3
|
+
* Convert the color depth of an image.
|
|
4
|
+
*
|
|
5
|
+
* @param image - Image to convert.
|
|
6
|
+
* @param newDepth - Depth to convert to.
|
|
7
|
+
* @returns Converted image.
|
|
8
|
+
*/
|
|
9
|
+
export declare function convertDepth(image: IJS, newDepth: ColorDepth): IJS;
|
|
10
|
+
//# sourceMappingURL=convertDepth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertDepth.d.ts","sourceRoot":"","sources":["../../src/operations/convertDepth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,GAAG,GAAG,CAUlE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IJS, ColorDepth } from '../IJS';
|
|
2
|
+
/**
|
|
3
|
+
* Convert the color depth of an image.
|
|
4
|
+
*
|
|
5
|
+
* @param image - Image to convert.
|
|
6
|
+
* @param newDepth - Depth to convert to.
|
|
7
|
+
* @returns Converted image.
|
|
8
|
+
*/
|
|
9
|
+
export function convertDepth(image, newDepth) {
|
|
10
|
+
if (image.depth === newDepth) {
|
|
11
|
+
throw new Error('cannot convert image to same depth');
|
|
12
|
+
}
|
|
13
|
+
if (newDepth === ColorDepth.UINT16) {
|
|
14
|
+
return convertToUint16(image);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return convertToUint8(image);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Convert image depth to 16 bits.
|
|
22
|
+
*
|
|
23
|
+
* @param image - Image to convert.
|
|
24
|
+
* @returns Converted image.
|
|
25
|
+
*/
|
|
26
|
+
function convertToUint16(image) {
|
|
27
|
+
const newImage = new IJS(image.width, image.height, {
|
|
28
|
+
depth: ColorDepth.UINT16,
|
|
29
|
+
colorModel: image.colorModel,
|
|
30
|
+
});
|
|
31
|
+
for (let i = 0; i < image.size; i++) {
|
|
32
|
+
for (let j = 0; j < newImage.channels; j++) {
|
|
33
|
+
newImage.setValueByIndex(i, j, image.getValueByIndex(i, j) << 8);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return newImage;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Convert image depth to 8 bits.
|
|
40
|
+
*
|
|
41
|
+
* @param image - Image to convert.
|
|
42
|
+
* @returns Converted image.
|
|
43
|
+
*/
|
|
44
|
+
function convertToUint8(image) {
|
|
45
|
+
const newImage = new IJS(image.width, image.height, {
|
|
46
|
+
depth: ColorDepth.UINT8,
|
|
47
|
+
colorModel: image.colorModel,
|
|
48
|
+
});
|
|
49
|
+
for (let i = 0; i < image.size; i++) {
|
|
50
|
+
for (let j = 0; j < newImage.channels; j++) {
|
|
51
|
+
newImage.setValueByIndex(i, j, image.getValueByIndex(i, j) >> 8);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return newImage;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=convertDepth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertDepth.js","sourceRoot":"","sources":["../../src/operations/convertDepth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAU,EAAE,QAAoB;IAC3D,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IAED,IAAI,QAAQ,KAAK,UAAU,CAAC,MAAM,EAAE;QAClC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;KAC/B;SAAM;QACL,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;KAC9B;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;QAClD,KAAK,EAAE,UAAU,CAAC,MAAM;QACxB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC,CAAC;IAEH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE;YAC1C,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SAClE;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAU;IAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;QAClD,KAAK,EAAE,UAAU,CAAC,KAAK;QACvB,UAAU,EAAE,KAAK,CAAC,UAAU;KAC7B,CAAC,CAAC;IACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE;YAC1C,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;SAClE;KACF;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IJS } from '..';
|
|
2
|
+
export interface CopyToOptions {
|
|
3
|
+
/**
|
|
4
|
+
* X offset for the copy, the top left corner of the target image is the reference.
|
|
5
|
+
*
|
|
6
|
+
* @default 0
|
|
7
|
+
*/
|
|
8
|
+
columnOffset?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Y offset for the copy, the top left corner of the target image is the reference.
|
|
11
|
+
*
|
|
12
|
+
* @default 0
|
|
13
|
+
*/
|
|
14
|
+
rowOffset?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Image to which to output.
|
|
17
|
+
*/
|
|
18
|
+
out?: IJS;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Copy the image to another one by specifying the location in the target image.
|
|
22
|
+
*
|
|
23
|
+
* @param source - The source image.
|
|
24
|
+
* @param target - The target image.
|
|
25
|
+
* @param options - copyTo options.
|
|
26
|
+
* @returns The target with the source copied to it.
|
|
27
|
+
*/
|
|
28
|
+
export default function copyTo(source: IJS, target: IJS, options?: CopyToOptions): IJS;
|
|
29
|
+
//# sourceMappingURL=copyTo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyTo.d.ts","sourceRoot":"","sources":["../../src/operations/copyTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAGzB,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,GAAG,EACX,OAAO,GAAE,aAAkB,GAC1B,GAAG,CAwEL"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getOutputImage } from '../utils/getOutputImage';
|
|
2
|
+
/**
|
|
3
|
+
* Copy the image to another one by specifying the location in the target image.
|
|
4
|
+
*
|
|
5
|
+
* @param source - The source image.
|
|
6
|
+
* @param target - The target image.
|
|
7
|
+
* @param options - copyTo options.
|
|
8
|
+
* @returns The target with the source copied to it.
|
|
9
|
+
*/
|
|
10
|
+
export default function copyTo(source, target, options = {}) {
|
|
11
|
+
const { columnOffset = 0, rowOffset = 0 } = options;
|
|
12
|
+
if (source.colorModel !== target.colorModel) {
|
|
13
|
+
throw new Error('Source and target should have the same color model.');
|
|
14
|
+
}
|
|
15
|
+
const result = getOutputImage(target, options, { clone: true });
|
|
16
|
+
if (source.alpha) {
|
|
17
|
+
for (let row = Math.max(rowOffset, 0); row < Math.min(source.height + rowOffset, target.height); row++) {
|
|
18
|
+
for (let column = Math.max(columnOffset, 0); column < Math.min(source.width + columnOffset, target.width); column++) {
|
|
19
|
+
let sourceAlpha = source.getValue(row - rowOffset, column - columnOffset, source.channels - 1);
|
|
20
|
+
let targetAlpha = target.getValue(row, column, source.channels - 1);
|
|
21
|
+
let newAlpha = sourceAlpha + targetAlpha * (1 - sourceAlpha / source.maxValue);
|
|
22
|
+
result.setValue(row, column, target.channels - 1, newAlpha);
|
|
23
|
+
for (let component = 0; component < source.components; component++) {
|
|
24
|
+
let sourceComponent = source.getValue(row - rowOffset, column - columnOffset, component);
|
|
25
|
+
let targetComponent = target.getValue(row, column, component);
|
|
26
|
+
let newComponent = (sourceComponent * sourceAlpha +
|
|
27
|
+
targetComponent *
|
|
28
|
+
targetAlpha *
|
|
29
|
+
(1 - sourceAlpha / source.maxValue)) /
|
|
30
|
+
newAlpha;
|
|
31
|
+
result.setValue(row, column, component, newComponent);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (let row = Math.max(rowOffset, 0); row < Math.min(source.height + rowOffset, target.height); row++) {
|
|
38
|
+
for (let column = Math.max(columnOffset, 0); column < Math.min(source.width + columnOffset, target.width); column++) {
|
|
39
|
+
for (let component = 0; component < target.components; component++) {
|
|
40
|
+
let sourceComponent = source.getValue(row - rowOffset, column - columnOffset, component);
|
|
41
|
+
result.setValue(row, column, component, sourceComponent);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=copyTo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copyTo.js","sourceRoot":"","sources":["../../src/operations/copyTo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAqBzD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,MAAW,EACX,MAAW,EACX,UAAyB,EA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,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;iBAC1D;aACF;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IJS } from '..';
|
|
2
|
+
import * as greyAlgorithms from './greyAlgorithms';
|
|
3
|
+
export declare type GreyAlgorithms = keyof typeof greyAlgorithms;
|
|
4
|
+
/**
|
|
5
|
+
* Call back that converts the RGB channels to grey. It is clamped afterwards.
|
|
6
|
+
*
|
|
7
|
+
* @callback GreyAlgorithmCallback
|
|
8
|
+
* @param {number} red - value of the red channel
|
|
9
|
+
* @param {number} green - value of the green channel
|
|
10
|
+
* @param {number} blue - value of the blue channel
|
|
11
|
+
* @returns {number} value of the grey channel
|
|
12
|
+
*/
|
|
13
|
+
export declare type GreyAlgorithmCallback = (red: number, green: number, blue: number, image: IJS) => number;
|
|
14
|
+
export interface GreyOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Specify the grey algorithm to use.
|
|
17
|
+
*
|
|
18
|
+
* @default 'luma709'
|
|
19
|
+
*/
|
|
20
|
+
algorithm?: GreyAlgorithms | GreyAlgorithmCallback;
|
|
21
|
+
/**
|
|
22
|
+
* Specify wether to keep an alpha channel in the new image or not.
|
|
23
|
+
*
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
keepAlpha?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Specify wether to merge the alpha channel with the gray pixel or not.
|
|
29
|
+
*
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
mergeAlpha?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Image to which to output.
|
|
35
|
+
*/
|
|
36
|
+
out?: IJS;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Convert the current image to grayscale.
|
|
40
|
+
* The source image has to be RGB or RGBA.
|
|
41
|
+
* If there is an alpha channel you have to specify what to do:
|
|
42
|
+
* - keepAlpha : keep the alpha channel, you will get a GREYA image
|
|
43
|
+
* - mergeAlpha : multiply each pixel of the image by the alpha, you will get a GREY image
|
|
44
|
+
*
|
|
45
|
+
* @param image - Original color image to convert to grey.
|
|
46
|
+
* @param options - The grey conversion options.
|
|
47
|
+
* @returns The resulting grey image.
|
|
48
|
+
*/
|
|
49
|
+
export default function grey(image: IJS, options?: GreyOptions): IJS;
|
|
50
|
+
//# sourceMappingURL=grey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grey.d.ts","sourceRoot":"","sources":["../../src/operations/grey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAmB,MAAM,IAAI,CAAC;AAI1C,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AAEnD,oBAAY,cAAc,GAAG,MAAM,OAAO,cAAc,CAAC;AAEzD;;;;;;;;GAQG;AACH,oBAAY,qBAAqB,GAAG,CAClC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,KACP,MAAM,CAAC;AAEZ,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,GAAG,qBAAqB,CAAC;IACnD;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,GAAE,WAAgB,GAAG,GAAG,CAqDvE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ImageColorModel } from '..';
|
|
2
|
+
import { getClamp } from '../utils/clamp';
|
|
3
|
+
import { getOutputImage } from '../utils/getOutputImage';
|
|
4
|
+
import * as greyAlgorithms from './greyAlgorithms';
|
|
5
|
+
/**
|
|
6
|
+
* Convert the current image to grayscale.
|
|
7
|
+
* The source image has to be RGB or RGBA.
|
|
8
|
+
* If there is an alpha channel you have to specify what to do:
|
|
9
|
+
* - keepAlpha : keep the alpha channel, you will get a GREYA image
|
|
10
|
+
* - mergeAlpha : multiply each pixel of the image by the alpha, you will get a GREY image
|
|
11
|
+
*
|
|
12
|
+
* @param image - Original color image to convert to grey.
|
|
13
|
+
* @param options - The grey conversion options.
|
|
14
|
+
* @returns The resulting grey image.
|
|
15
|
+
*/
|
|
16
|
+
export default function grey(image, options = {}) {
|
|
17
|
+
let { algorithm = 'luma709', keepAlpha = false, mergeAlpha = true } = options;
|
|
18
|
+
if (image.colorModel !== ImageColorModel.RGB &&
|
|
19
|
+
image.colorModel !== ImageColorModel.RGBA) {
|
|
20
|
+
throw new Error('Image color model is not RGB or RGBA');
|
|
21
|
+
}
|
|
22
|
+
keepAlpha = keepAlpha && image.alpha;
|
|
23
|
+
mergeAlpha = mergeAlpha && image.alpha;
|
|
24
|
+
if (keepAlpha) {
|
|
25
|
+
mergeAlpha = false;
|
|
26
|
+
}
|
|
27
|
+
let newColorModel = keepAlpha ? ImageColorModel.GREYA : ImageColorModel.GREY;
|
|
28
|
+
let newImage = getOutputImage(image, options, {
|
|
29
|
+
newParameters: { colorModel: newColorModel },
|
|
30
|
+
});
|
|
31
|
+
let method;
|
|
32
|
+
if (typeof algorithm === 'function') {
|
|
33
|
+
method = algorithm;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// eslint-disable-next-line import/namespace
|
|
37
|
+
method = greyAlgorithms[algorithm];
|
|
38
|
+
}
|
|
39
|
+
let clamp = getClamp(newImage);
|
|
40
|
+
for (let i = 0; i < image.size; i++) {
|
|
41
|
+
const red = image.getValueByIndex(i, 0);
|
|
42
|
+
const green = image.getValueByIndex(i, 1);
|
|
43
|
+
const blue = image.getValueByIndex(i, 2);
|
|
44
|
+
let newValue;
|
|
45
|
+
if (mergeAlpha) {
|
|
46
|
+
const alpha = image.getValueByIndex(i, 3);
|
|
47
|
+
newValue = clamp((method(red, green, blue, image) * alpha) / image.maxValue);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
newValue = clamp(method(red, green, blue, image));
|
|
51
|
+
if (keepAlpha) {
|
|
52
|
+
const alpha = image.getValueByIndex(i, 3);
|
|
53
|
+
newImage.setValueByIndex(i, 1, alpha);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
newImage.setValueByIndex(i, 0, newValue);
|
|
57
|
+
}
|
|
58
|
+
return newImage;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=grey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grey.js","sourceRoot":"","sources":["../../src/operations/grey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,eAAe,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AA6CnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAU,EAAE,UAAuB,EAAE;IAChE,IAAI,EAAE,SAAS,GAAG,SAAS,EAAE,SAAS,GAAG,KAAK,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE9E,IACE,KAAK,CAAC,UAAU,KAAK,eAAe,CAAC,GAAG;QACxC,KAAK,CAAC,UAAU,KAAK,eAAe,CAAC,IAAI,EACzC;QACA,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KACzD;IAED,SAAS,GAAG,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC;IACrC,UAAU,GAAG,UAAU,IAAI,KAAK,CAAC,KAAK,CAAC;IACvC,IAAI,SAAS,EAAE;QACb,UAAU,GAAG,KAAK,CAAC;KACpB;IAED,IAAI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AG,KAAK,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC1C,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;aACvC;SACF;QACD,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;KAC1C;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { IJS } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* Converts R, G and B values to a single value using Luma 709 standard({@link https://en.wikipedia.org/wiki/Luma_(video)}).
|
|
4
|
+
*
|
|
5
|
+
* @param red - Red value of current pixel.
|
|
6
|
+
* @param green - Green value of current pixel.
|
|
7
|
+
* @param blue - Blue value of current pixel.
|
|
8
|
+
* @returns - Corresponding gray value.
|
|
9
|
+
*/
|
|
10
|
+
export declare function luma709(red: number, green: number, blue: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Converts R, G and B values to a single value using Luma 601 standard({@link https://en.wikipedia.org/wiki/Luma_(video)}).
|
|
13
|
+
*
|
|
14
|
+
* @param red - Red value of current pixel.
|
|
15
|
+
* @param green - Green value of current pixel.
|
|
16
|
+
* @param blue - Blue value of current pixel.
|
|
17
|
+
* @returns - Corresponding gray value.
|
|
18
|
+
*/
|
|
19
|
+
export declare function luma601(red: number, green: number, blue: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* Return the maximal value between red, green and blue.
|
|
22
|
+
*
|
|
23
|
+
* @param red - Red value of current pixel.
|
|
24
|
+
* @param green - Green value of current pixel.
|
|
25
|
+
* @param blue - Blue value of current pixel.
|
|
26
|
+
* @returns - Corresponding gray value.
|
|
27
|
+
*/
|
|
28
|
+
export declare function max(red: number, green: number, blue: number): number;
|
|
29
|
+
/**
|
|
30
|
+
* Return the minimal value between red, green and blue.
|
|
31
|
+
*
|
|
32
|
+
* @param red - Red value of current pixel.
|
|
33
|
+
* @param green - Green value of current pixel.
|
|
34
|
+
* @param blue - Blue value of current pixel.
|
|
35
|
+
* @returns - Corresponding gray value.
|
|
36
|
+
*/
|
|
37
|
+
export declare function min(red: number, green: number, blue: number): number;
|
|
38
|
+
/**
|
|
39
|
+
* Return the average of red, green and blue.
|
|
40
|
+
*
|
|
41
|
+
* @param red - Red value of current pixel.
|
|
42
|
+
* @param green - Green value of current pixel.
|
|
43
|
+
* @param blue - Blue value of current pixel.
|
|
44
|
+
* @returns - Corresponding gray value.
|
|
45
|
+
*/
|
|
46
|
+
export declare function average(red: number, green: number, blue: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* Return the average between the max and min values of red, green and blue.
|
|
49
|
+
*
|
|
50
|
+
* @param red - Red value of current pixel.
|
|
51
|
+
* @param green - Green value of current pixel.
|
|
52
|
+
* @param blue - Blue value of current pixel.
|
|
53
|
+
* @returns - Corresponding gray value.
|
|
54
|
+
*/
|
|
55
|
+
export declare function minmax(red: number, green: number, blue: number): number;
|
|
56
|
+
/**
|
|
57
|
+
* Return the red value.
|
|
58
|
+
*
|
|
59
|
+
* @param red - Red value of current pixel.
|
|
60
|
+
* @returns - Corresponding gray value.
|
|
61
|
+
*/
|
|
62
|
+
export declare function red(red: number): number;
|
|
63
|
+
/**
|
|
64
|
+
* Return the green value.
|
|
65
|
+
*
|
|
66
|
+
* @param red - Red value of current pixel.
|
|
67
|
+
* @param green - Green value of current pixel.
|
|
68
|
+
* @returns - Corresponding gray value.
|
|
69
|
+
*/
|
|
70
|
+
export declare function green(red: number, green: number): number;
|
|
71
|
+
/**
|
|
72
|
+
* Return the blue value.
|
|
73
|
+
*
|
|
74
|
+
* @param red - Red value of current pixel.
|
|
75
|
+
* @param green - Green value of current pixel.
|
|
76
|
+
* @param blue - Blue value of current pixel.
|
|
77
|
+
* @returns - Corresponding gray value.
|
|
78
|
+
*/
|
|
79
|
+
export declare function blue(red: number, green: number, blue: number): number;
|
|
80
|
+
/**
|
|
81
|
+
* Return the minimum of the inverses of red, green and blue.
|
|
82
|
+
*
|
|
83
|
+
* @param red - Red value of current pixel.
|
|
84
|
+
* @param green - Green value of current pixel.
|
|
85
|
+
* @param blue - Blue value of current pixel.
|
|
86
|
+
* @param image - Image to convert to grey.
|
|
87
|
+
* @returns - Corresponding gray value.
|
|
88
|
+
*/
|
|
89
|
+
export declare function black(red: number, green: number, blue: number, image: IJS): number;
|
|
90
|
+
/**
|
|
91
|
+
* Returns the cyan component of a pixel.
|
|
92
|
+
*
|
|
93
|
+
* @param red - Red value of current pixel.
|
|
94
|
+
* @param green - Green value of current pixel.
|
|
95
|
+
* @param blue - Blue value of current pixel.
|
|
96
|
+
* @param image - Image to convert to grey.
|
|
97
|
+
* @returns - Corresponding gray value.
|
|
98
|
+
*/
|
|
99
|
+
export declare function cyan(red: number, green: number, blue: number, image: IJS): number;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the magenta component of a pixel.
|
|
102
|
+
*
|
|
103
|
+
* @param red - Red value of current pixel
|
|
104
|
+
* @param green - Green value of current pixel
|
|
105
|
+
* @param blue - Blue value of current pixel
|
|
106
|
+
* @param image - Image to convert to grey.
|
|
107
|
+
* @returns - Corresponding gray value.
|
|
108
|
+
*/
|
|
109
|
+
export declare function magenta(red: number, green: number, blue: number, image: IJS): number;
|
|
110
|
+
/**
|
|
111
|
+
* Returns the yellow component of a pixel.
|
|
112
|
+
*
|
|
113
|
+
* @param red - Red value of current pixel
|
|
114
|
+
* @param green - Green value of current pixel
|
|
115
|
+
* @param blue - Blue value of current pixel
|
|
116
|
+
* @param image - Image to convert to grey.
|
|
117
|
+
* @returns - Corresponding gray value.
|
|
118
|
+
*/
|
|
119
|
+
export declare function yellow(red: number, green: number, blue: number, image: IJS): number;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the hue of a pixel.
|
|
122
|
+
*
|
|
123
|
+
* @param red - Red value of current pixel
|
|
124
|
+
* @param green - Green value of current pixel
|
|
125
|
+
* @param blue - Blue value of current pixel
|
|
126
|
+
* @param image - Image to convert to grey.
|
|
127
|
+
* @returns - Corresponding gray value.
|
|
128
|
+
*/
|
|
129
|
+
export declare function hue(red: number, green: number, blue: number, image: IJS): number;
|
|
130
|
+
/**
|
|
131
|
+
* Returns the saturation component of a pixel.
|
|
132
|
+
*
|
|
133
|
+
* @param red - Red value of current pixel
|
|
134
|
+
* @param green - Green value of current pixel
|
|
135
|
+
* @param blue - Blue value of current pixel
|
|
136
|
+
* @param image - Image to convert to grey.
|
|
137
|
+
* @returns - Corresponding gray value.
|
|
138
|
+
*/
|
|
139
|
+
export declare function saturation(red: number, green: number, blue: number, image: IJS): number;
|
|
140
|
+
/**
|
|
141
|
+
* Returns the lightness of a pixel.
|
|
142
|
+
*
|
|
143
|
+
* @param red - Red value of current pixel
|
|
144
|
+
* @param green - Green value of current pixel
|
|
145
|
+
* @param blue - Blue value of current pixel
|
|
146
|
+
* @returns - Corresponding gray value.
|
|
147
|
+
*/
|
|
148
|
+
export declare function lightness(red: number, green: number, blue: number): number;
|
|
149
|
+
//# sourceMappingURL=greyAlgorithms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greyAlgorithms.d.ts","sourceRoot":"","sources":["../../src/operations/greyAlgorithms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAEzB;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CASxE;AACD;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxE;AACD;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpE;AACD;;;;;;;GAOG;AACH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