@blazediff/cli 2.0.0 → 2.0.2
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/dist/cli.js +38 -6
- package/dist/commands/hitchhikers-ssim.js +14 -3
- package/dist/commands/msssim.js +8 -1
- package/dist/commands/ssim.js +8 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -9603,7 +9603,14 @@ async function main4() {
|
|
|
9603
9603
|
outputData = new Uint8Array(img1.data.length);
|
|
9604
9604
|
}
|
|
9605
9605
|
const startTime = performance.now();
|
|
9606
|
-
const score = z(
|
|
9606
|
+
const score = z(
|
|
9607
|
+
img1.data,
|
|
9608
|
+
img2.data,
|
|
9609
|
+
outputData,
|
|
9610
|
+
img1.width,
|
|
9611
|
+
img1.height,
|
|
9612
|
+
{}
|
|
9613
|
+
);
|
|
9607
9614
|
const duration = performance.now() - startTime;
|
|
9608
9615
|
if (options.outputPath && outputData) {
|
|
9609
9616
|
await transformer.write(
|
|
@@ -9847,7 +9854,14 @@ async function main5() {
|
|
|
9847
9854
|
outputData = new Uint8Array(img1.data.length);
|
|
9848
9855
|
}
|
|
9849
9856
|
const startTime = performance.now();
|
|
9850
|
-
const score = P3(
|
|
9857
|
+
const score = P3(
|
|
9858
|
+
img1.data,
|
|
9859
|
+
img2.data,
|
|
9860
|
+
outputData,
|
|
9861
|
+
img1.width,
|
|
9862
|
+
img1.height,
|
|
9863
|
+
{}
|
|
9864
|
+
);
|
|
9851
9865
|
const duration = performance.now() - startTime;
|
|
9852
9866
|
if (options.outputPath && outputData) {
|
|
9853
9867
|
await transformer.write(
|
|
@@ -10078,7 +10092,9 @@ async function main6() {
|
|
|
10078
10092
|
process.exit(1);
|
|
10079
10093
|
}
|
|
10080
10094
|
}
|
|
10081
|
-
const transformer = await getTransformer5(
|
|
10095
|
+
const transformer = await getTransformer5(
|
|
10096
|
+
options.transformer
|
|
10097
|
+
);
|
|
10082
10098
|
const [img1, img2] = await Promise.all([
|
|
10083
10099
|
transformer.read(image1),
|
|
10084
10100
|
transformer.read(image2)
|
|
@@ -10103,7 +10119,14 @@ async function main6() {
|
|
|
10103
10119
|
ssimOptions.covPooling = options.covPooling;
|
|
10104
10120
|
}
|
|
10105
10121
|
const startTime = performance.now();
|
|
10106
|
-
const score = en2(
|
|
10122
|
+
const score = en2(
|
|
10123
|
+
img1.data,
|
|
10124
|
+
img2.data,
|
|
10125
|
+
outputData,
|
|
10126
|
+
img1.width,
|
|
10127
|
+
img1.height,
|
|
10128
|
+
ssimOptions
|
|
10129
|
+
);
|
|
10107
10130
|
const duration = performance.now() - startTime;
|
|
10108
10131
|
if (options.outputPath && outputData) {
|
|
10109
10132
|
await transformer.write(
|
|
@@ -10126,7 +10149,9 @@ async function main6() {
|
|
|
10126
10149
|
};
|
|
10127
10150
|
console.log(`completed in: ${result.duration.toFixed(2)}ms`);
|
|
10128
10151
|
console.log(`dimensions: ${result.width}x${result.height}`);
|
|
10129
|
-
console.log(
|
|
10152
|
+
console.log(
|
|
10153
|
+
`window: ${result.windowSize}x${result.windowSize} (stride: ${result.windowStride})`
|
|
10154
|
+
);
|
|
10130
10155
|
console.log(`pooling: ${result.poolingMethod}`);
|
|
10131
10156
|
console.log(
|
|
10132
10157
|
`Hitchhiker's SSIM score: ${result.score.toFixed(6)} (0=different, 1=identical)`
|
|
@@ -10208,7 +10233,14 @@ async function main7() {
|
|
|
10208
10233
|
process.exit(0);
|
|
10209
10234
|
}
|
|
10210
10235
|
const command = args[0];
|
|
10211
|
-
const validCommands = [
|
|
10236
|
+
const validCommands = [
|
|
10237
|
+
"bin",
|
|
10238
|
+
"core",
|
|
10239
|
+
"gmsd",
|
|
10240
|
+
"ssim",
|
|
10241
|
+
"msssim",
|
|
10242
|
+
"hitchhikers-ssim"
|
|
10243
|
+
];
|
|
10212
10244
|
const isCommand = validCommands.includes(command);
|
|
10213
10245
|
if ((args.includes("-h") || args.includes("--help")) && !isCommand) {
|
|
10214
10246
|
printUsage7();
|
|
@@ -8828,7 +8828,9 @@ async function main() {
|
|
|
8828
8828
|
process.exit(1);
|
|
8829
8829
|
}
|
|
8830
8830
|
}
|
|
8831
|
-
const transformer = await getTransformer(
|
|
8831
|
+
const transformer = await getTransformer(
|
|
8832
|
+
options.transformer
|
|
8833
|
+
);
|
|
8832
8834
|
const [img1, img2] = await Promise.all([
|
|
8833
8835
|
transformer.read(image1),
|
|
8834
8836
|
transformer.read(image2)
|
|
@@ -8853,7 +8855,14 @@ async function main() {
|
|
|
8853
8855
|
ssimOptions.covPooling = options.covPooling;
|
|
8854
8856
|
}
|
|
8855
8857
|
const startTime = performance.now();
|
|
8856
|
-
const score = en(
|
|
8858
|
+
const score = en(
|
|
8859
|
+
img1.data,
|
|
8860
|
+
img2.data,
|
|
8861
|
+
outputData,
|
|
8862
|
+
img1.width,
|
|
8863
|
+
img1.height,
|
|
8864
|
+
ssimOptions
|
|
8865
|
+
);
|
|
8857
8866
|
const duration = performance.now() - startTime;
|
|
8858
8867
|
if (options.outputPath && outputData) {
|
|
8859
8868
|
await transformer.write(
|
|
@@ -8876,7 +8885,9 @@ async function main() {
|
|
|
8876
8885
|
};
|
|
8877
8886
|
console.log(`completed in: ${result.duration.toFixed(2)}ms`);
|
|
8878
8887
|
console.log(`dimensions: ${result.width}x${result.height}`);
|
|
8879
|
-
console.log(
|
|
8888
|
+
console.log(
|
|
8889
|
+
`window: ${result.windowSize}x${result.windowSize} (stride: ${result.windowStride})`
|
|
8890
|
+
);
|
|
8880
8891
|
console.log(`pooling: ${result.poolingMethod}`);
|
|
8881
8892
|
console.log(
|
|
8882
8893
|
`Hitchhiker's SSIM score: ${result.score.toFixed(6)} (0=different, 1=identical)`
|
package/dist/commands/msssim.js
CHANGED
|
@@ -8841,7 +8841,14 @@ async function main() {
|
|
|
8841
8841
|
outputData = new Uint8Array(img1.data.length);
|
|
8842
8842
|
}
|
|
8843
8843
|
const startTime = performance.now();
|
|
8844
|
-
const score = P(
|
|
8844
|
+
const score = P(
|
|
8845
|
+
img1.data,
|
|
8846
|
+
img2.data,
|
|
8847
|
+
outputData,
|
|
8848
|
+
img1.width,
|
|
8849
|
+
img1.height,
|
|
8850
|
+
{}
|
|
8851
|
+
);
|
|
8845
8852
|
const duration = performance.now() - startTime;
|
|
8846
8853
|
if (options.outputPath && outputData) {
|
|
8847
8854
|
await transformer.write(
|
package/dist/commands/ssim.js
CHANGED
|
@@ -8872,7 +8872,14 @@ async function main() {
|
|
|
8872
8872
|
outputData = new Uint8Array(img1.data.length);
|
|
8873
8873
|
}
|
|
8874
8874
|
const startTime = performance.now();
|
|
8875
|
-
const score = z(
|
|
8875
|
+
const score = z(
|
|
8876
|
+
img1.data,
|
|
8877
|
+
img2.data,
|
|
8878
|
+
outputData,
|
|
8879
|
+
img1.width,
|
|
8880
|
+
img1.height,
|
|
8881
|
+
{}
|
|
8882
|
+
);
|
|
8876
8883
|
const duration = performance.now() - startTime;
|
|
8877
8884
|
if (options.outputPath && outputData) {
|
|
8878
8885
|
await transformer.write(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazediff/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Command-line interface for the blazediff image comparison library",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"homepage": "https://blazediff.dev",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@blazediff/bin": "
|
|
40
|
+
"@blazediff/bin": "3.1.0",
|
|
41
41
|
"@blazediff/core": "1.8.0",
|
|
42
42
|
"@blazediff/gmsd": "1.7.0",
|
|
43
|
-
"@blazediff/sharp-transformer": "2.0.0",
|
|
44
43
|
"@blazediff/pngjs-transformer": "2.0.0",
|
|
44
|
+
"@blazediff/sharp-transformer": "2.0.0",
|
|
45
45
|
"@blazediff/ssim": "1.7.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|