image-js 0.35.4 → 0.35.6
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/index.d.ts +255 -3
- package/lib/browser/environment.js +3 -6
- package/lib/browser/worker/extend.js +1 -1
- package/lib/browser/worker/process/background.js +2 -3
- package/lib/browser/worker/worker.js +2 -3
- package/lib/image/Image.js +1 -2
- package/lib/image/compute/colorHistogram.js +1 -1
- package/lib/image/compute/histogram.js +1 -1
- package/lib/image/compute/max.js +1 -1
- package/lib/image/compute/min.js +1 -1
- package/lib/image/compute/minimalBoundingRectangle.js +1 -1
- package/lib/image/compute/monotoneChainConvexHull.js +1 -1
- package/lib/image/compute/sum.js +1 -1
- package/lib/image/core/environment.js +4 -6
- package/lib/image/core/extend.js +1 -1
- package/lib/image/core/kind.js +2 -2
- package/lib/image/core/kindNames.js +7 -14
- package/lib/image/core/load.js +1 -1
- package/lib/image/extend.js +1 -1
- package/lib/image/filter/background.js +1 -1
- package/lib/image/filter/gradientFilter.js +2 -1
- package/lib/image/filter/hypotenuse.js +1 -1
- package/lib/image/filter/invert.js +1 -1
- package/lib/image/filter/level.js +1 -1
- package/lib/image/filter/medianFilter.js +1 -1
- package/lib/image/filter/scharrFilter.js +1 -1
- package/lib/image/filter/sobelFilter.js +1 -1
- package/lib/image/internal/checks.js +1 -2
- package/lib/image/internal/getOutputImage.js +1 -1
- package/lib/image/model/model.js +5 -10
- package/lib/image/morphology/dilate.js +1 -1
- package/lib/image/morphology/erode.js +1 -1
- package/lib/image/operator/cannyEdge.js +1 -1
- package/lib/image/operator/convolution.js +1 -1
- package/lib/image/operator/extract.js +1 -1
- package/lib/image/operator/floodFill.js +1 -1
- package/lib/image/operator/paintPoints.js +1 -1
- package/lib/image/roi/Roi.js +4 -6
- package/lib/image/roi/RoiLayer.js +1 -1
- package/lib/image/roi/RoiMap.js +1 -1
- package/lib/image/roi/creator/fromMask.js +1 -1
- package/lib/image/roi/creator/fromMaskConnectedComponentLabelingAlgorithm.js +1 -1
- package/lib/image/roi/creator/fromMaxima.js +1 -1
- package/lib/image/roi/creator/fromPoints.js +1 -1
- package/lib/image/roi/creator/fromWaterShed.js +1 -1
- package/lib/image/roi/feretDiameters.js +1 -1
- package/lib/image/roi/manager.js +1 -1
- package/lib/image/transform/cmyk.js +1 -1
- package/lib/image/transform/colorDepth.js +1 -1
- package/lib/image/transform/crop.js +1 -1
- package/lib/image/transform/grey.js +1 -1
- package/lib/image/transform/greyAlgorithms.js +2 -4
- package/lib/image/transform/hsl.js +1 -1
- package/lib/image/transform/hsv.js +1 -1
- package/lib/image/transform/insert.js +1 -1
- package/lib/image/transform/mask/mask.js +1 -1
- package/lib/image/transform/mask/thresholdAlgorithms.js +3 -5
- package/lib/image/transform/pad.js +1 -1
- package/lib/image/transform/resize/resize.js +1 -1
- package/lib/image/transform/rgba.js +1 -1
- package/lib/image/transform/rgba8.js +1 -1
- package/lib/image/transform/rotate.js +1 -1
- package/lib/image/transform/rotateFree.js +1 -1
- package/lib/image/transform/warping.js +1 -1
- package/lib/image/utility/combineChannels.js +1 -1
- package/lib/image/utility/getBestMatch.js +1 -1
- package/lib/image/utility/getChannel.js +1 -1
- package/lib/image/utility/getSimilarity.js +1 -1
- package/lib/image/utility/setBorder.js +1 -1
- package/lib/image/utility/split.js +1 -1
- package/lib/index.js +5 -6
- package/lib/stack/Stack.js +1 -1
- package/lib/stack/extend.js +1 -1
- package/lib/stack/transform/matchAndCrop.js +1 -1
- package/lib/stack/utility/averageImage.js +1 -1
- package/lib/stack/utility/maxImage.js +1 -1
- package/lib/stack/utility/minImage.js +1 -1
- package/lib/util/Shape.js +1 -1
- package/lib/util/channel.js +2 -6
- package/lib/util/dxdy.js +2 -4
- package/lib/util/kernel.js +1 -1
- package/lib/util/kernels.js +8 -16
- package/lib/util/value.js +1 -1
- package/lib/worker/worker.js +1 -2
- package/package.json +2 -2
package/lib/util/channel.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.validateArrayOfChannels = validateArrayOfChannels;
|
|
7
7
|
exports.validateChannel = validateChannel;
|
|
8
8
|
var Model = _interopRequireWildcard(require("../image/model/model"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
11
|
/**
|
|
12
12
|
* Specify which channels should be processed
|
|
13
13
|
* * undefined : we take all the channels but alpha
|
|
@@ -74,7 +74,6 @@ function validateChannel(image, channel, allowAlpha = true) {
|
|
|
74
74
|
// no default
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
|
|
78
77
|
break;
|
|
79
78
|
case Model.HSL:
|
|
80
79
|
if ('hsl'.includes(channel)) {
|
|
@@ -91,7 +90,6 @@ function validateChannel(image, channel, allowAlpha = true) {
|
|
|
91
90
|
// no default
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
|
-
|
|
95
93
|
break;
|
|
96
94
|
case Model.HSV:
|
|
97
95
|
if ('hsv'.includes(channel)) {
|
|
@@ -108,7 +106,6 @@ function validateChannel(image, channel, allowAlpha = true) {
|
|
|
108
106
|
// no default
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
|
-
|
|
112
109
|
break;
|
|
113
110
|
case Model.CMYK:
|
|
114
111
|
if ('cmyk'.includes(channel)) {
|
|
@@ -128,7 +125,6 @@ function validateChannel(image, channel, allowAlpha = true) {
|
|
|
128
125
|
// no default
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
|
-
|
|
132
128
|
break;
|
|
133
129
|
default:
|
|
134
130
|
throw new Error(`Unexpected color model: ${image.colorModel}`);
|
package/lib/util/dxdy.js
CHANGED
|
@@ -4,7 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.dys = exports.dxs = void 0;
|
|
7
|
-
const dxs = [+1, 0, -1, 0, +1, +1, -1, -1];
|
|
8
|
-
exports.
|
|
9
|
-
const dys = [0, +1, 0, -1, +1, -1, +1, -1];
|
|
10
|
-
exports.dys = dys;
|
|
7
|
+
const dxs = exports.dxs = [+1, 0, -1, 0, +1, +1, -1, -1];
|
|
8
|
+
const dys = exports.dys = [0, +1, 0, -1, +1, -1, +1, -1];
|
package/lib/util/kernel.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.validateKernel = validateKernel;
|
|
7
7
|
var _isInteger = _interopRequireDefault(require("is-integer"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
function validateKernel(kernel) {
|
|
10
10
|
let kHeight, kWidth;
|
|
11
11
|
if (Array.isArray(kernel)) {
|
package/lib/util/kernels.js
CHANGED
|
@@ -4,19 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SOBEL_Y = exports.SOBEL_X = exports.SECOND_DERIVATIVE_INV = exports.SECOND_DERIVATIVE = exports.SCHARR_Y = exports.SCHARR_X = exports.DISCRETE_LAPLACE_8 = exports.DISCRETE_LAPLACE_4 = void 0;
|
|
7
|
-
const DISCRETE_LAPLACE_4 = [[0, 1, 0], [1, -4, 1], [0, 1, 0]];
|
|
8
|
-
exports.
|
|
9
|
-
const
|
|
10
|
-
exports.
|
|
11
|
-
const
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
14
|
-
exports.
|
|
15
|
-
const SCHARR_X = [[3, 0, -3], [10, 0, -10], [3, 0, -3]];
|
|
16
|
-
exports.SCHARR_X = SCHARR_X;
|
|
17
|
-
const SCHARR_Y = [[3, 10, 3], [0, 0, 0], [-3, -10, -3]];
|
|
18
|
-
exports.SCHARR_Y = SCHARR_Y;
|
|
19
|
-
const SECOND_DERIVATIVE = [[-1, -2, 0, 2, 1], [-2, -4, 0, 4, 2], [0, 0, 0, 0, 0], [1, 2, 0, -2, -1], [2, 4, 0, -4, -2]];
|
|
20
|
-
exports.SECOND_DERIVATIVE = SECOND_DERIVATIVE;
|
|
21
|
-
const SECOND_DERIVATIVE_INV = [[1, 2, 0, -2, -1], [2, 4, 0, -4, -2], [0, 0, 0, 0, 0], [-2, -4, 0, 4, 2], [-1, -2, 0, 2, 1]];
|
|
22
|
-
exports.SECOND_DERIVATIVE_INV = SECOND_DERIVATIVE_INV;
|
|
7
|
+
const DISCRETE_LAPLACE_4 = exports.DISCRETE_LAPLACE_4 = [[0, 1, 0], [1, -4, 1], [0, 1, 0]];
|
|
8
|
+
const DISCRETE_LAPLACE_8 = exports.DISCRETE_LAPLACE_8 = [[1, 1, 1], [1, -8, 1], [1, 1, 1]];
|
|
9
|
+
const SOBEL_X = exports.SOBEL_X = [[-1, 0, +1], [-2, 0, +2], [-1, 0, +1]];
|
|
10
|
+
const SOBEL_Y = exports.SOBEL_Y = [[-1, -2, -1], [0, 0, 0], [+1, +2, +1]];
|
|
11
|
+
const SCHARR_X = exports.SCHARR_X = [[3, 0, -3], [10, 0, -10], [3, 0, -3]];
|
|
12
|
+
const SCHARR_Y = exports.SCHARR_Y = [[3, 10, 3], [0, 0, 0], [-3, -10, -3]];
|
|
13
|
+
const SECOND_DERIVATIVE = exports.SECOND_DERIVATIVE = [[-1, -2, 0, 2, 1], [-2, -4, 0, 4, 2], [0, 0, 0, 0, 0], [1, 2, 0, -2, -1], [2, 4, 0, -4, -2]];
|
|
14
|
+
const SECOND_DERIVATIVE_INV = exports.SECOND_DERIVATIVE_INV = [[1, 2, 0, -2, -1], [2, 4, 0, -4, -2], [0, 0, 0, 0, 0], [-2, -4, 0, 4, 2], [-1, -2, 0, 2, 1]];
|
package/lib/util/value.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.checkNumberArray = checkNumberArray;
|
|
7
7
|
var _isArrayType = _interopRequireDefault(require("is-array-type"));
|
|
8
8
|
var _Image = _interopRequireDefault(require("../image/Image"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
function checkNumberArray(value) {
|
|
11
11
|
if (!isNaN(value)) {
|
|
12
12
|
if (value <= 0) {
|
package/lib/worker/worker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "image-js",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.6",
|
|
4
4
|
"description": "Image processing and manipulation in JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"image",
|
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
"web-worker-manager": "^0.2.0"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|
|
108
|
-
"node": ">=
|
|
108
|
+
"node": ">= 16.0.0"
|
|
109
109
|
}
|
|
110
110
|
}
|