BlazeDiff vs odiff
@blazediff/core-native is ~3.3x faster
than odiff over our 34 fixtures, with image decode and diff PNG writing
included. Both are native binaries with a Node API, and both return the same
kind of result, so most code moves over with a changed import.
odiff is a SIMD image diff written in Zig, popular in visual testing tools. It decodes many image formats and has a server mode that keeps one process alive between comparisons. BlazeDiff runs a block-based Rust kernel with SIMD on ARM and x86, and it reads file paths or encoded bytes.
At a glance
| odiff | BlazeDiff (core-native) | |
|---|---|---|
| License | MIT | MIT |
| Implementation | Zig, SIMD (SSE2, AVX2, AVX512, NEON) | Rust, SIMD (NEON, SSE4.1) |
| Delivery | Native binary, Node API, CLI | N-API addon, @blazediff/cli, Python, Rust |
| Input | File paths, buffers | File paths, encoded bytes |
| Formats | PNG, JPEG, WebP, TIFF, BMP | PNG, JPEG, QOI |
| Color metric | YIQ | YIQ |
| Ignore regions | Yes (rectangles) | No (selector masks in @blazediff/agent) |
| Browser / edge | No | Yes, through @blazediff/core-wasm |
| Beyond pixel counts | Changed lines and columns | Region analysis, SSIM, GMSD and MILO packages |
Benchmarks
odiff runs through ODiffServer, its server mode, so process start-up is not
counted against it. βBlazeDiff Nextβ is the same binary with the
blazediff-png codec turned on through
BLAZEDIFF_PNG_ENABLED=1.
JavaScript Native Binary (@blazediff/core-native vs odiff) (image IO included)
TOTAL TIME Β· 34 FIXTURES Β· MEAN OF 25 RUNS Β· IO INCLUDED
| # | Library | Version | Total time | vs ODiff |
|---|---|---|---|---|
| 1 | BlazeDiff Next | 7.0.0 | 1.69s | 4.66x faster |
| 2 | BlazeDiff | 7.0.0 | 2.37s | 3.33x faster |
| 3 | ODiff | 4.3.8 | 7.89s | baseline |
Per-fixture results (34)
| Fixture | ODiff | BlazeDiff | BlazeDiff Next | BlazeDiff vs ODiff | BlazeDiff Next vs ODiff |
|---|---|---|---|---|---|
| 4k/1 | 1.19s | 233ms | 175ms | 5.09x | 6.77x |
| 4k/1 (identical) | 279ms | 187ms | 129ms | 1.49x | 2.15x |
| 4k/2 | 1.56s | 300ms | 222ms | 5.21x | 7.03x |
| 4k/2 (identical) | 336ms | 226ms | 151ms | 1.49x | 2.23x |
| 4k/3 | 1.74s | 294ms | 233ms | 5.91x | 7.46x |
| 4k/3 (identical) | 371ms | 230ms | 159ms | 1.62x | 2.33x |
| blazediff/1 | 3.43ms | 1.78ms | 1.58ms | 1.93x | 2.17x |
| blazediff/1 (identical) | 1.46ms | 0.91ms | 0.72ms | 1.60x | 2.04x |
| blazediff/2 | 3.58ms | 2.06ms | 1.67ms | 1.74x | 2.14x |
| blazediff/2 (identical) | 1.56ms | 1.03ms | 0.67ms | 1.51x | 2.33x |
| blazediff/3 | 45.93ms | 21.24ms | 16.27ms | 2.16x | 2.82x |
| blazediff/3 (identical) | 19.18ms | 14.31ms | 9.54ms | 1.34x | 2.01x |
| blazediff/4 | 24.16ms | 11.29ms | 10.58ms | 2.14x | 2.28x |
| blazediff/4 (identical) | 8.29ms | 4.46ms | 3.52ms | 1.86x | 2.36x |
| page/1 | 1.00s | 361ms | 250ms | 2.78x | 4.02x |
| page/1 (identical) | 535ms | 259ms | 151ms | 2.07x | 3.54x |
| page/2 | 607ms | 155ms | 124ms | 3.92x | 4.90x |
| page/2 (identical) | 118ms | 42.80ms | 34.50ms | 2.77x | 3.43x |
| pixelmatch/1 | 3.38ms | 1.52ms | 1.01ms | 2.22x | 3.36x |
| pixelmatch/1 (identical) | 1.71ms | 1.15ms | 0.69ms | 1.48x | 2.48x |
| pixelmatch/2 | 3.37ms | 1.74ms | 1.41ms | 1.94x | 2.39x |
| pixelmatch/2 (identical) | 0.79ms | 0.52ms | 0.23ms | 1.52x | 3.47x |
| pixelmatch/3 | 2.47ms | 1.22ms | 0.81ms | 2.03x | 3.06x |
| pixelmatch/3 (identical) | 1.48ms | 0.89ms | 0.52ms | 1.66x | 2.83x |
| pixelmatch/4 | 9.83ms | 4.65ms | 3.93ms | 2.12x | 2.50x |
| pixelmatch/4 (identical) | 2.68ms | 2.08ms | 1.22ms | 1.29x | 2.21x |
| pixelmatch/5 | 0.89ms | 0.80ms | 0.69ms | 1.11x | 1.29x |
| pixelmatch/5 (identical) | 0.80ms | 0.55ms | 0.42ms | 1.46x | 1.90x |
| pixelmatch/6 | 5.74ms | 1.85ms | 1.33ms | 3.11x | 4.33x |
| pixelmatch/6 (identical) | 1.06ms | 1.15ms | 0.48ms | 0.93x | 2.20x |
| pixelmatch/7 | 3.40ms | 1.58ms | 1.46ms | 2.16x | 2.33x |
| pixelmatch/7 (identical) | 0.68ms | 0.61ms | 0.33ms | 1.11x | 2.06x |
| same/1 | 5.15ms | 3.18ms | 2.67ms | 1.62x | 1.93x |
| same/1 (identical) | 5.48ms | 3.23ms | 2.55ms | 1.70x | 2.15x |
| TOTAL | 7.89s | 2.37s | 1.69s | 3.33x | 4.66x |
pnpm benchmark core-native Β· Apple M1 Max Β· darwin/arm64 Β· Node v22.14.0 Β· rustc 1.97.1 (8bab26f4f 2026-07-14) Β· 2026-11-12 Β· 867ed3b-dirty
Switching
Both libraries return a discriminated union. odiff uses match and a reason.
BlazeDiff uses a kind of compared, dimension-mismatch or io-error, with
count, percentage and identical when the images were compared.
// Before
import { compare } from "odiff-bin";
// After
import { diff } from "@blazediff/core-native";
const result = await diff("baseline.png", "current.png", {
output: "diff.png",
threshold: 0.1,
});
if (result.kind === "compared" && !result.identical) {
console.log(`${result.count} pixels differ`);
}For odiffβs ignoreRegions, pass a mask: one byte per pixel, non-zero
pixels are skipped. captureDiffLines and reduceRamUsage have no direct
counterpart, so remove them.
When to keep odiff
- You compare WebP, TIFF or BMP files, or a JPEG against a PNG.
- You depend on
ignoreRegionsor on the changed-line output. - You use a tool that already integrates odiff, for example Argos or Lost Pixel.