@blazediff/bin 1.5.0 → 1.6.0

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 CHANGED
@@ -18,12 +18,21 @@ npm install -g @blazediff/bin
18
18
  ## Usage
19
19
 
20
20
  ```bash
21
- blazediff <image1> <image2> [options]
21
+ blazediff <command> <image1> <image2> [options]
22
22
  ```
23
23
 
24
- **Arguments:**
25
- - `image1` - Path to the first image
26
- - `image2` - Path to the second image
24
+ ## Commands
25
+
26
+ BlazeDiff supports multiple comparison algorithms, each optimized for different use cases:
27
+
28
+ ### `diff` - Pixel-by-pixel comparison (default)
29
+ Fast pixel-level comparison for detecting visual regressions.
30
+
31
+ ```bash
32
+ blazediff diff image1.png image2.png [options]
33
+ # Or simply:
34
+ blazediff image1.png image2.png [options]
35
+ ```
27
36
 
28
37
  **Options:**
29
38
  - `-o, --output <path>` - Output path for the diff image
@@ -34,24 +43,69 @@ blazediff <image1> <image2> [options]
34
43
  - `--diff-color-alt <r,g,b>` - Alternative color for dark differences
35
44
  - `--include-aa` - Include anti-aliasing detection
36
45
  - `--diff-mask` - Draw diff over transparent background
37
- - `--transformer <name>` - Specify transformer to use (pngjs, sharp)
38
46
  - `--color-space <name>` - Specify color space to use (yiq, ycbcr)
47
+ - `--transformer <name>` - Specify transformer to use (pngjs, sharp)
48
+ - `-h, --help` - Show help message
49
+
50
+ ### `gmsd` - Gradient Magnitude Similarity Deviation
51
+ Perceptual quality metric based on gradient similarity.
52
+
53
+ ```bash
54
+ blazediff gmsd image1.png image2.png [options]
55
+ ```
56
+
57
+ **Options:**
58
+ - `-o, --output <path>` - Output path for GMS similarity map
59
+ - `--downsample <0|1>` - Downsample factor (0=full-res, 1=2x, default: 0)
60
+ - `--gmsd-c <num>` - Stability constant (default: 170)
61
+ - `--transformer <name>` - Specify transformer to use (pngjs, sharp)
62
+ - `-h, --help` - Show help message
63
+
64
+ ### `ssim` - Structural Similarity Index
65
+ Industry-standard metric for measuring structural similarity.
66
+
67
+ ```bash
68
+ blazediff ssim image1.png image2.png [options]
69
+ ```
70
+
71
+ **Options:**
72
+ - `-o, --output <path>` - Output path for SSIM map visualization
73
+ - `--transformer <name>` - Specify transformer to use (pngjs, sharp)
74
+ - `-h, --help` - Show help message
75
+
76
+ ### `msssim` - Multi-Scale Structural Similarity Index
77
+ Enhanced SSIM that operates at multiple image scales.
78
+
79
+ ```bash
80
+ blazediff msssim image1.png image2.png [options]
81
+ ```
82
+
83
+ **Options:**
84
+ - `-o, --output <path>` - Output path for MS-SSIM map visualization
85
+ - `--transformer <name>` - Specify transformer to use (pngjs, sharp)
39
86
  - `-h, --help` - Show help message
40
87
 
41
88
  ## Examples
42
89
 
43
90
  ```bash
44
- # Basic comparison
91
+ # Pixel-by-pixel diff (default)
45
92
  blazediff image1.png image2.png
93
+ blazediff diff image1.png image2.png -o diff.png -t 0.05
46
94
 
47
- # Save diff image with custom threshold
48
- blazediff image1.png image2.png -o diff.png -t 0.05
95
+ # GMSD similarity metric
96
+ blazediff gmsd image1.png image2.png
97
+ blazediff gmsd image1.png image2.png -o gms-map.png
49
98
 
50
- # Use Sharp transformer for better performance
51
- blazediff image1.png image2.png --transformer sharp -o diff.png
99
+ # SSIM structural similarity
100
+ blazediff ssim image1.png image2.png
101
+ blazediff ssim image1.png image2.png -o ssim-map.png
102
+
103
+ # MS-SSIM multi-scale similarity
104
+ blazediff msssim image1.png image2.png
105
+ blazediff msssim image1.png image2.png -o msssim-map.png
52
106
 
53
- # JPEG support (requires Sharp transformer)
54
- blazediff image1.jpg image2.jpg --transformer sharp -o diff.png
107
+ # Use Sharp transformer for better performance
108
+ blazediff ssim image1.jpg image2.jpg --transformer sharp
55
109
  ```
56
110
 
57
111
  ## Transformers
@@ -61,5 +115,10 @@ blazediff image1.jpg image2.jpg --transformer sharp -o diff.png
61
115
 
62
116
  ## Exit Codes
63
117
 
118
+ ### Diff Mode
64
119
  - `0` - Images are identical
65
120
  - `1` - Images have differences or error occurred
121
+
122
+ ### GMSD, SSIM, MS-SSIM Modes
123
+ - `0` - Images are highly similar (score >= 0.95)
124
+ - `1` - Images have noticeable differences (score < 0.95) or error occurred