Skip to Content
New: codec-png-native and codec-png-wasm bring the blazediff-png codec to Node and WebAssembly, faster than spng and jSquash. Read more β†’
Comparevs odiff

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

odiffBlazeDiff (core-native)
LicenseMITMIT
ImplementationZig, SIMD (SSE2, AVX2, AVX512, NEON)Rust, SIMD (NEON, SSE4.1)
DeliveryNative binary, Node API, CLIN-API addon, @blazediff/cli, Python, Rust
InputFile paths, buffersFile paths, encoded bytes
FormatsPNG, JPEG, WebP, TIFF, BMPPNG, JPEG, QOI
Color metricYIQYIQ
Ignore regionsYes (rectangles)No (selector masks in @blazediff/agent)
Browser / edgeNoYes, through @blazediff/core-wasm
Beyond pixel countsChanged lines and columnsRegion 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

BlazeDiffOther librariesLower is better
#LibraryVersionTotal timevs ODiff
1BlazeDiff Next7.0.01.69s4.66x faster
2BlazeDiff7.0.02.37s3.33x faster
3ODiff4.3.87.89sbaseline
Per-fixture results (34)
FixtureODiffBlazeDiffBlazeDiff NextBlazeDiff vs ODiffBlazeDiff Next vs ODiff
4k/11.19s233ms175ms5.09x6.77x
4k/1 (identical)279ms187ms129ms1.49x2.15x
4k/21.56s300ms222ms5.21x7.03x
4k/2 (identical)336ms226ms151ms1.49x2.23x
4k/31.74s294ms233ms5.91x7.46x
4k/3 (identical)371ms230ms159ms1.62x2.33x
blazediff/13.43ms1.78ms1.58ms1.93x2.17x
blazediff/1 (identical)1.46ms0.91ms0.72ms1.60x2.04x
blazediff/23.58ms2.06ms1.67ms1.74x2.14x
blazediff/2 (identical)1.56ms1.03ms0.67ms1.51x2.33x
blazediff/345.93ms21.24ms16.27ms2.16x2.82x
blazediff/3 (identical)19.18ms14.31ms9.54ms1.34x2.01x
blazediff/424.16ms11.29ms10.58ms2.14x2.28x
blazediff/4 (identical)8.29ms4.46ms3.52ms1.86x2.36x
page/11.00s361ms250ms2.78x4.02x
page/1 (identical)535ms259ms151ms2.07x3.54x
page/2607ms155ms124ms3.92x4.90x
page/2 (identical)118ms42.80ms34.50ms2.77x3.43x
pixelmatch/13.38ms1.52ms1.01ms2.22x3.36x
pixelmatch/1 (identical)1.71ms1.15ms0.69ms1.48x2.48x
pixelmatch/23.37ms1.74ms1.41ms1.94x2.39x
pixelmatch/2 (identical)0.79ms0.52ms0.23ms1.52x3.47x
pixelmatch/32.47ms1.22ms0.81ms2.03x3.06x
pixelmatch/3 (identical)1.48ms0.89ms0.52ms1.66x2.83x
pixelmatch/49.83ms4.65ms3.93ms2.12x2.50x
pixelmatch/4 (identical)2.68ms2.08ms1.22ms1.29x2.21x
pixelmatch/50.89ms0.80ms0.69ms1.11x1.29x
pixelmatch/5 (identical)0.80ms0.55ms0.42ms1.46x1.90x
pixelmatch/65.74ms1.85ms1.33ms3.11x4.33x
pixelmatch/6 (identical)1.06ms1.15ms0.48ms0.93x2.20x
pixelmatch/73.40ms1.58ms1.46ms2.16x2.33x
pixelmatch/7 (identical)0.68ms0.61ms0.33ms1.11x2.06x
same/15.15ms3.18ms2.67ms1.62x1.93x
same/1 (identical)5.48ms3.23ms2.55ms1.70x2.15x
TOTAL7.89s2.37s1.69s3.33x4.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 ignoreRegions or on the changed-line output.
  • You use a tool that already integrates odiff, for example Argos or Lost Pixel.
Last updated on