@pamin-labs/uidiff 0.0.1 → 0.0.3
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 +22 -20
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Moved content is lined up, and every real edit is boxed, numbered and labelled a
|
|
|
10
10
|
|
|
11
11
|
- **Changes, not pixels.** A pixel diff paints everything below an inserted row. uidiff aligns what only moved and reports it as one shift with its offset, so only real edits get a box.
|
|
12
12
|
- **Catches what eyes miss.** A colour a few shades off or a single changed word is boxed and shown side by side in a close-up.
|
|
13
|
-
- **One small native binary.**
|
|
13
|
+
- **One small native binary.** 604 KB, no runtime, 9.8 ms to report JSON for a 2560×1600 pair. PNG, JPEG and WebP in; a sheet and JSON out.
|
|
14
14
|
|
|
15
15
|
## Quick start
|
|
16
16
|
|
|
@@ -54,30 +54,26 @@ irm https://uidiff.paminlabs.com/install.ps1 | iex
|
|
|
54
54
|
|
|
55
55
|
### The report
|
|
56
56
|
|
|
57
|
-
`--json` prints one object for scripts, CI and agents. This is the report for the comparison at the top of this page
|
|
57
|
+
`--json` prints one object for scripts, CI and agents. This is the report for the comparison at the top of this page:
|
|
58
58
|
|
|
59
59
|
```json
|
|
60
60
|
{
|
|
61
61
|
"version": 1,
|
|
62
|
-
"width": 2560,
|
|
63
|
-
"height": 1600,
|
|
64
62
|
"regions": [
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
"before": { "x": 1746, "y": 1114, "width": 642, "height": 204 },
|
|
69
|
-
"after": { "x": 1746, "y": 924, "width": 642, "height": 204 } },
|
|
70
|
-
{ "number": 3, "kind": "inserted",
|
|
71
|
-
"before": null, "after": { "x": 1346, "y": 1136, "width": 1042, "height": 100 } }
|
|
63
|
+
{"number": 1, "kind": "removed", "before": {"x": 1531, "y": 787, "width": 857, "height": 165}, "after": null},
|
|
64
|
+
{"number": 2, "kind": "changed", "before": {"x": 1746, "y": 1114, "width": 642, "height": 204}, "after": {"x": 1746, "y": 924, "width": 642, "height": 204}},
|
|
65
|
+
{"number": 3, "kind": "inserted", "before": null, "after": {"x": 1346, "y": 1136, "width": 1042, "height": 100}}
|
|
72
66
|
],
|
|
67
|
+
"width": 2560,
|
|
68
|
+
"height": 1600,
|
|
73
69
|
"moves": [
|
|
74
|
-
{ "x": 860, "width": 1520,
|
|
75
|
-
|
|
70
|
+
{"before": {"y": 968, "height": 366}, "after": {"y": 778, "height": 366}, "x": 860, "width": 1520},
|
|
71
|
+
{"before": {"y": 1334, "height": 99}, "after": {"y": 1252, "height": 99}, "x": 860, "width": 1520}
|
|
76
72
|
]
|
|
77
73
|
}
|
|
78
74
|
```
|
|
79
75
|
|
|
80
|
-
Boxes are in device pixels. A region has a box on each side where it exists. A move's offset is its after `y` minus its before `y`, here −190 px.
|
|
76
|
+
Boxes are in device pixels. A region has a box on each side where it exists. A move's offset is its after `y` minus its before `y`, here −190 px and −82 px.
|
|
81
77
|
|
|
82
78
|
## How it compares
|
|
83
79
|
|
|
@@ -89,18 +85,19 @@ Boxes are in device pixels. A region has a box on each side where it exists. A m
|
|
|
89
85
|
| Boxes on things that did not change | **4** | 46 | 147 | 131 |
|
|
90
86
|
| Moved content found with its offset | **56 / 56** | 56 / 56 | n/a | n/a |
|
|
91
87
|
| What you get | labelled regions, moves, a sheet | a mask | a mask | a mask |
|
|
92
|
-
| CLI time, 2560×1600 pair | **
|
|
93
|
-
| CPU time, same pair | **
|
|
88
|
+
| CLI time, 2560×1600 pair | **9.8 ms** | 65 ms | 103 ms | 379 ms |
|
|
89
|
+
| CPU time, same pair | **12.9 ms** | 80 ms | 127 ms | 419 ms |
|
|
94
90
|
| Peak RSS | **35.4 MiB** | 70 MiB | 50 MiB | 147 MiB |
|
|
95
91
|
| Install | **604 KB**, one file | 1.3 MB + Node | 2.4 MB | 0.76 MB + Node |
|
|
96
92
|
|
|
97
|
-
<sub>Timings are medians from 15 rotated rounds on Arm64 macOS. The uidiff column was refreshed independently on the
|
|
93
|
+
<sub>Timings are medians from 15 rotated rounds on Arm64 macOS. The uidiff column was refreshed independently on the original pair, alternating the current CLI with v0.0.2. Competitor figures are from the original run. Each comparison starts a new process. uidiff writes JSON, and Iris and pixelmatch include Node startup. See the <a href="bench/README.md">benchmark method</a>.</sub>
|
|
98
94
|
|
|
99
95
|
## Usage
|
|
100
96
|
|
|
101
97
|
```text
|
|
102
98
|
uidiff <before> <after> [--scale N] [--json] [--annotate <out.png>]
|
|
103
99
|
uidiff --help
|
|
100
|
+
uidiff --version
|
|
104
101
|
```
|
|
105
102
|
|
|
106
103
|
| Argument | Meaning |
|
|
@@ -108,14 +105,19 @@ uidiff --help
|
|
|
108
105
|
| `<before>`, `<after>` | The two captures: PNG, JPEG or WebP. Different heights are fine; a different width is reported as added or removed columns. |
|
|
109
106
|
| `--scale N` | Device pixels per logical pixel (CSS px, points or dp), as a plain decimal such as `2` or `1.5`. Default `1`. It sets padding and merge distances in logical pixels; boxes stay in device pixels. |
|
|
110
107
|
| `--json` | Print the report as one JSON object instead of the region count. |
|
|
111
|
-
| `--annotate <out.png>` | Also write the sheet to this PNG. The file is replaced only once the sheet is complete. |
|
|
108
|
+
| `--annotate <out.png>` | Also write the sheet to this PNG. The file is replaced only once the sheet is complete. Large sheets are compressed on several cores, so the PNG bytes can differ between machines while the pixels stay the same. |
|
|
112
109
|
| `--help` | Print usage and exit 0. |
|
|
110
|
+
| `--version` | Print the installed version and exit 0. |
|
|
113
111
|
|
|
114
112
|
| Exit code | Meaning |
|
|
115
113
|
| --- | --- |
|
|
116
114
|
| `0` | No change regions detected. |
|
|
117
115
|
| `1` | Change regions found. |
|
|
118
|
-
| `2` | A comparison or usage error, reported on stderr. |
|
|
116
|
+
| `2` | A comparison or usage error, reported on stderr. `SheetIsInput` means the sheet path names either input, including through a link. |
|
|
117
|
+
|
|
118
|
+
Pass captures as files. `-` does not read stdin, and input pipes are unsupported. A symlink at the sheet path is replaced by the PNG itself, unless it points to an input, which raises `SheetIsInput`.
|
|
119
|
+
|
|
120
|
+
Connected changes smaller than four pixels are treated as noise. If the smaller capture has at most 1024 pixels, single-pixel regions can be reported.
|
|
119
121
|
|
|
120
122
|
For the best results, freeze animations, carets and timers, and keep fonts, locale and device scale the same for both captures.
|
|
121
123
|
|
|
@@ -137,7 +139,7 @@ brew install pamin-labs/tap/uidiff
|
|
|
137
139
|
The install scripts download from uidiff.paminlabs.com, which also works where GitHub is unreachable. They verify the binary against `SHA256SUMS` and install it to `~/.local/bin` or `%LOCALAPPDATA%\Programs\uidiff`. Set `UIDIFF_VERSION` to pick a release, with or without the leading `v`:
|
|
138
140
|
|
|
139
141
|
```sh
|
|
140
|
-
curl -fsSL https://uidiff.paminlabs.com/install.sh | UIDIFF_VERSION
|
|
142
|
+
curl -fsSL https://uidiff.paminlabs.com/install.sh | UIDIFF_VERSION=<version> sh
|
|
141
143
|
```
|
|
142
144
|
|
|
143
145
|
The [releases page](https://github.com/pamin-labs/uidiff/releases) also has standalone binaries, archives with license notices and checksums.
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.3",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"THIRD_PARTY_NOTICES"
|
|
30
30
|
],
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@pamin-labs/uidiff-linux-x64": "0.0.
|
|
33
|
-
"@pamin-labs/uidiff-linux-arm64": "0.0.
|
|
34
|
-
"@pamin-labs/uidiff-darwin-x64": "0.0.
|
|
35
|
-
"@pamin-labs/uidiff-darwin-arm64": "0.0.
|
|
36
|
-
"@pamin-labs/uidiff-win32-x64": "0.0.
|
|
37
|
-
"@pamin-labs/uidiff-win32-arm64": "0.0.
|
|
32
|
+
"@pamin-labs/uidiff-linux-x64": "0.0.3",
|
|
33
|
+
"@pamin-labs/uidiff-linux-arm64": "0.0.3",
|
|
34
|
+
"@pamin-labs/uidiff-darwin-x64": "0.0.3",
|
|
35
|
+
"@pamin-labs/uidiff-darwin-arm64": "0.0.3",
|
|
36
|
+
"@pamin-labs/uidiff-win32-x64": "0.0.3",
|
|
37
|
+
"@pamin-labs/uidiff-win32-arm64": "0.0.3"
|
|
38
38
|
},
|
|
39
39
|
"uidiffNative": {
|
|
40
40
|
"linux-x64": "@pamin-labs/uidiff-linux-x64",
|