@blazediff/core-native 4.3.3 → 5.0.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
@@ -2,9 +2,9 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- [![npm bundle size](https://img.shields.io/npm/unpacked-size/%40blazediff%2Fcore-native)](https://www.npmjs.com/package/@blazediff/core-native)
6
- [![NPM Downloads](https://img.shields.io/npm/dy/%40blazediff%2Fcore-native)](https://www.npmjs.com/package/@blazediff/core-native)
7
- [![Crates.io](https://img.shields.io/crates/v/blazediff.svg)](https://crates.io/crates/blazediff)
5
+ [![npm bundle size](https://img.shields.io/npm/unpacked-size/%40blazediff%2Fcore-native?style=for-the-badge)](https://www.npmjs.com/package/@blazediff/core-native)
6
+ [![NPM Downloads](https://img.shields.io/npm/dy/%40blazediff%2Fcore-native?style=for-the-badge)](https://www.npmjs.com/package/@blazediff/core-native)
7
+ [![Crates.io](https://img.shields.io/crates/v/blazediff.svg?style=for-the-badge)](https://crates.io/crates/blazediff)
8
8
 
9
9
  </div>
10
10
 
@@ -108,12 +108,6 @@ Compare two images (PNG or JPEG) and generate a diff image. Format is auto-detec
108
108
  <td>false</td>
109
109
  <td>Run structured interpretation after diff - adds <code>interpretation</code> to the result with detected change regions, classification, and a human-readable summary</td>
110
110
  </tr>
111
- <tr>
112
- <td><code>outputFormat</code></td>
113
- <td>"png" | "html"</td>
114
- <td>"png"</td>
115
- <td>Output format for diff. Use <code>"html"</code> to generate an interpret report (implies <code>interpret: true</code>)</td>
116
- </tr>
117
111
  </table>
118
112
 
119
113
  ### interpret(image1Path, image2Path, options?)
@@ -299,12 +293,12 @@ Input images can be mixed formats (e.g., compare PNG to JPEG). Output format is
299
293
 
300
294
  ## Performance
301
295
 
302
- Benchmarked on Apple M1 Pro with 5600x3200 4K PNG images:
296
+ Benchmarked on Apple M1 Max (25 runs, 5 warmup, image IO included) against `odiff` on 5600×3200 4K PNG images via `hyperfine`. Full numbers in the root [BENCHMARKS.md](https://github.com/teimurjan/blazediff/blob/main/BENCHMARKS.md).
303
297
 
304
- | Tool | Benchmark Time | vs blazediff |
305
- |------|------|--------------|
306
- | **blazediff** | ~327ms | - |
307
- | odiff | ~1215ms | 3.4x slower |
298
+ | Tool | 4k/1 | 4k/2 | 4k/3 | vs blazediff |
299
+ |------|-----:|-----:|-----:|-------------|
300
+ | **blazediff** | ~359ms | ~452ms | ~506ms | - |
301
+ | odiff | ~1221ms | ~1525ms | ~1750ms | 3.4-3.5x slower |
308
302
 
309
303
  Binary sizes (stripped, LTO optimized) - **~3x smaller than odiff**:
310
304
 
package/dist/index.d.ts CHANGED
@@ -11,8 +11,6 @@ interface BlazeDiffOptions {
11
11
  quality?: number;
12
12
  /** Run structured interpretation after raw pixel diff */
13
13
  interpret?: boolean;
14
- /** Output format for diff: "png" (default) or "html" (interpret report) */
15
- outputFormat?: "png" | "html";
16
14
  }
17
15
  type BlazeDiffResult = {
18
16
  match: true;
package/dist/index.js CHANGED
@@ -37,7 +37,7 @@ __export(index_exports, {
37
37
  });
38
38
  module.exports = __toCommonJS(index_exports);
39
39
 
40
- // ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.6_tsx@4.20.6_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
40
+ // ../../node_modules/.pnpm/tsup@8.5.0_jiti@2.6.0_postcss@8.5.15_tsx@4.20.6_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
41
41
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
42
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
43
43
 
@@ -142,8 +142,7 @@ function convertToNapiOptions(options) {
142
142
  diffMask: options?.diffMask,
143
143
  compression: options?.compression,
144
144
  quality: options?.quality,
145
- interpret: options?.interpret,
146
- outputFormat: options?.outputFormat
145
+ interpret: options?.interpret
147
146
  };
148
147
  }
149
148
  function resolveBinaryPath() {
@@ -192,7 +191,7 @@ function getBinaryPathInternal() {
192
191
  }
193
192
  function buildArgs(diffOutput, options) {
194
193
  const args = [];
195
- const useInterpret = options?.interpret || options?.outputFormat === "html";
194
+ const useInterpret = options?.interpret ?? false;
196
195
  if (diffOutput) args.push(diffOutput);
197
196
  if (useInterpret) args.push("--interpret");
198
197
  args.push("--output-format=json");
@@ -227,7 +226,7 @@ function detectMissingFile(error, basePath, comparePath) {
227
226
  async function execFileCompare(basePath, comparePath, diffOutput, options) {
228
227
  const binaryPath = getBinaryPathInternal();
229
228
  const args = [basePath, comparePath, ...buildArgs(diffOutput, options)];
230
- if (options?.interpret || options?.outputFormat === "html") {
229
+ if (options?.interpret) {
231
230
  return execFileInterpretCompare(binaryPath, args, basePath, comparePath);
232
231
  }
233
232
  try {
package/dist/index.mjs CHANGED
@@ -99,8 +99,7 @@ function convertToNapiOptions(options) {
99
99
  diffMask: options?.diffMask,
100
100
  compression: options?.compression,
101
101
  quality: options?.quality,
102
- interpret: options?.interpret,
103
- outputFormat: options?.outputFormat
102
+ interpret: options?.interpret
104
103
  };
105
104
  }
106
105
  function resolveBinaryPath() {
@@ -149,7 +148,7 @@ function getBinaryPathInternal() {
149
148
  }
150
149
  function buildArgs(diffOutput, options) {
151
150
  const args = [];
152
- const useInterpret = options?.interpret || options?.outputFormat === "html";
151
+ const useInterpret = options?.interpret ?? false;
153
152
  if (diffOutput) args.push(diffOutput);
154
153
  if (useInterpret) args.push("--interpret");
155
154
  args.push("--output-format=json");
@@ -184,7 +183,7 @@ function detectMissingFile(error, basePath, comparePath) {
184
183
  async function execFileCompare(basePath, comparePath, diffOutput, options) {
185
184
  const binaryPath = getBinaryPathInternal();
186
185
  const args = [basePath, comparePath, ...buildArgs(diffOutput, options)];
187
- if (options?.interpret || options?.outputFormat === "html") {
186
+ if (options?.interpret) {
188
187
  return execFileInterpretCompare(binaryPath, args, basePath, comparePath);
189
188
  }
190
189
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazediff/core-native",
3
- "version": "4.3.3",
3
+ "version": "5.0.0",
4
4
  "description": "Native Rust binaries for blazediff - the fastest image diff in the world",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -20,12 +20,12 @@
20
20
  "dist"
21
21
  ],
22
22
  "optionalDependencies": {
23
- "@blazediff/core-native-darwin-arm64": "4.3.3",
24
- "@blazediff/core-native-darwin-x64": "4.3.3",
25
- "@blazediff/core-native-linux-arm64": "4.3.3",
26
- "@blazediff/core-native-linux-x64": "4.3.3",
27
- "@blazediff/core-native-win32-arm64": "4.3.3",
28
- "@blazediff/core-native-win32-x64": "4.3.3"
23
+ "@blazediff/core-native-darwin-arm64": "5.0.0",
24
+ "@blazediff/core-native-darwin-x64": "5.0.0",
25
+ "@blazediff/core-native-linux-arm64": "5.0.0",
26
+ "@blazediff/core-native-linux-x64": "5.0.0",
27
+ "@blazediff/core-native-win32-arm64": "5.0.0",
28
+ "@blazediff/core-native-win32-x64": "5.0.0"
29
29
  },
30
30
  "keywords": [
31
31
  "image",