@blazediff/cli 1.8.0 → 2.0.1
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/README.md +49 -23
- package/dist/cli.js +9440 -142
- package/dist/commands/bin.js +145 -0
- package/dist/commands/core.js +8984 -0
- package/dist/commands/gmsd.js +8727 -17
- package/dist/commands/hitchhikers-ssim.js +8723 -25
- package/dist/commands/msssim.js +8752 -21
- package/dist/commands/ssim.js +8783 -21
- package/package.json +2 -1
- package/dist/commands/diff.js +0 -255
package/README.md
CHANGED
|
@@ -18,20 +18,35 @@ npm install -g @blazediff/cli
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
blazediff <command> <image1> <image2> [options]
|
|
21
|
+
blazediff-cli <command> <image1> <image2> [options]
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Commands
|
|
25
25
|
|
|
26
26
|
BlazeDiff supports multiple comparison algorithms, each optimized for different use cases:
|
|
27
27
|
|
|
28
|
-
### `
|
|
29
|
-
|
|
28
|
+
### `bin` - Native binary comparison (default)
|
|
29
|
+
The fastest option. Uses the native Rust binary with SIMD optimization for maximum performance.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
blazediff
|
|
33
|
-
# Or
|
|
34
|
-
blazediff image1.png image2.png [options]
|
|
32
|
+
blazediff-cli image1.png image2.png diff.png [options]
|
|
33
|
+
# Or explicitly:
|
|
34
|
+
blazediff-cli bin image1.png image2.png diff.png [options]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Options:**
|
|
38
|
+
- `-t, --threshold <num>` - Color difference threshold (0 to 1, default: 0.1)
|
|
39
|
+
- `-a, --antialiasing` - Enable anti-aliasing detection
|
|
40
|
+
- `--diff-mask` - Output only differences (transparent background)
|
|
41
|
+
- `--fail-on-layout` - Fail immediately if images have different dimensions
|
|
42
|
+
- `-c, --compression <num>` - PNG compression level (0-9, default: 0)
|
|
43
|
+
- `-h, --help` - Show help message
|
|
44
|
+
|
|
45
|
+
### `core` - JavaScript pixel comparison
|
|
46
|
+
Pure JavaScript implementation. Slower than `bin` but offers more customization options.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
blazediff-cli core image1.png image2.png [options]
|
|
35
50
|
```
|
|
36
51
|
|
|
37
52
|
**Options:**
|
|
@@ -51,7 +66,7 @@ blazediff image1.png image2.png [options]
|
|
|
51
66
|
Perceptual quality metric based on gradient similarity.
|
|
52
67
|
|
|
53
68
|
```bash
|
|
54
|
-
blazediff gmsd image1.png image2.png [options]
|
|
69
|
+
blazediff-cli gmsd image1.png image2.png [options]
|
|
55
70
|
```
|
|
56
71
|
|
|
57
72
|
**Options:**
|
|
@@ -65,7 +80,7 @@ blazediff gmsd image1.png image2.png [options]
|
|
|
65
80
|
Industry-standard metric for measuring structural similarity.
|
|
66
81
|
|
|
67
82
|
```bash
|
|
68
|
-
blazediff ssim image1.png image2.png [options]
|
|
83
|
+
blazediff-cli ssim image1.png image2.png [options]
|
|
69
84
|
```
|
|
70
85
|
|
|
71
86
|
**Options:**
|
|
@@ -77,7 +92,7 @@ blazediff ssim image1.png image2.png [options]
|
|
|
77
92
|
Enhanced SSIM that operates at multiple image scales.
|
|
78
93
|
|
|
79
94
|
```bash
|
|
80
|
-
blazediff msssim image1.png image2.png [options]
|
|
95
|
+
blazediff-cli msssim image1.png image2.png [options]
|
|
81
96
|
```
|
|
82
97
|
|
|
83
98
|
**Options:**
|
|
@@ -85,39 +100,50 @@ blazediff msssim image1.png image2.png [options]
|
|
|
85
100
|
- `--transformer <name>` - Specify transformer to use (pngjs, sharp)
|
|
86
101
|
- `-h, --help` - Show help message
|
|
87
102
|
|
|
103
|
+
### `hitchhikers-ssim` - Fast SSIM
|
|
104
|
+
Integral image-based SSIM implementation for faster computation.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
blazediff-cli hitchhikers-ssim image1.png image2.png [options]
|
|
108
|
+
```
|
|
109
|
+
|
|
88
110
|
## Examples
|
|
89
111
|
|
|
90
112
|
```bash
|
|
91
|
-
#
|
|
92
|
-
blazediff image1.png image2.png
|
|
93
|
-
blazediff
|
|
113
|
+
# Native binary diff (default, fastest)
|
|
114
|
+
blazediff-cli image1.png image2.png diff.png
|
|
115
|
+
blazediff-cli bin image1.png image2.png diff.png -t 0.05 -a
|
|
116
|
+
|
|
117
|
+
# JavaScript pixel diff (more options)
|
|
118
|
+
blazediff-cli core image1.png image2.png -o diff.png -t 0.05
|
|
94
119
|
|
|
95
120
|
# GMSD similarity metric
|
|
96
|
-
blazediff gmsd image1.png image2.png
|
|
97
|
-
blazediff gmsd image1.png image2.png -o gms-map.png
|
|
121
|
+
blazediff-cli gmsd image1.png image2.png
|
|
122
|
+
blazediff-cli gmsd image1.png image2.png -o gms-map.png
|
|
98
123
|
|
|
99
124
|
# SSIM structural similarity
|
|
100
|
-
blazediff ssim image1.png image2.png
|
|
101
|
-
blazediff ssim image1.png image2.png -o ssim-map.png
|
|
125
|
+
blazediff-cli ssim image1.png image2.png
|
|
126
|
+
blazediff-cli ssim image1.png image2.png -o ssim-map.png
|
|
102
127
|
|
|
103
128
|
# MS-SSIM multi-scale similarity
|
|
104
|
-
blazediff msssim image1.png image2.png
|
|
105
|
-
blazediff msssim image1.png image2.png -o msssim-map.png
|
|
129
|
+
blazediff-cli msssim image1.png image2.png
|
|
130
|
+
blazediff-cli msssim image1.png image2.png -o msssim-map.png
|
|
106
131
|
|
|
107
|
-
# Use Sharp transformer for better performance
|
|
108
|
-
blazediff
|
|
132
|
+
# Use Sharp transformer for better performance (core/gmsd/ssim)
|
|
133
|
+
blazediff-cli core image1.jpg image2.jpg --transformer sharp
|
|
109
134
|
```
|
|
110
135
|
|
|
111
|
-
## Transformers
|
|
136
|
+
## Transformers (for `core`, `gmsd`, `ssim`, `msssim`)
|
|
112
137
|
|
|
113
138
|
- **pngjs** - Pure JavaScript, works everywhere. Supports PNG only.
|
|
114
139
|
- **sharp** - Native bindings, significantly faster. Supports PNG and JPEG.
|
|
115
140
|
|
|
116
141
|
## Exit Codes
|
|
117
142
|
|
|
118
|
-
###
|
|
143
|
+
### bin/core Mode
|
|
119
144
|
- `0` - Images are identical
|
|
120
|
-
- `1` - Images have differences
|
|
145
|
+
- `1` - Images have differences
|
|
146
|
+
- `2` - Error (file not found, invalid format, etc.)
|
|
121
147
|
|
|
122
148
|
### GMSD, SSIM, MS-SSIM Modes
|
|
123
149
|
- `0` - Images are highly similar (score >= 0.95)
|