Skip to main content

blazediff

High-performance image diffing with block-based optimization and SIMD acceleration.

Crates.io npm PyPI License: MIT

Features

  • Block-based optimization - Skip identical regions for massive speedups on similar images
  • SIMD acceleration - Native SSE4.1 (x86) and NEON (ARM) implementations
  • Multiple formats - PNG, JPEG, and QOI support
  • Perceptual diffing - YIQ-based color difference with antialiasing detection
  • In-house PNG codec - optional blazediff_png, faster than spng on every fixture, with byte-exact decode parity; opt-in via BLAZEDIFF_PNG_ENABLED
  • Cross-platform - Linux, macOS, and Windows support
  • Multi-language - Native Rust crate, Node.js (N-API), and Python (PyO3) bindings - all sharing the same core

Installation

Rust (CLI + library)

cargo install blazediff

Node.js - @blazediff/core-native

npm install @blazediff/core-native

N-API bindings shipped as pre-built .node binaries for macOS, Linux, and Windows (arm64 + x64). Built from this crate's napi Cargo feature.

import { compare } from "@blazediff/core-native";

const result = await compare("expected.png", "actual.png", "diff.png", {
  threshold: 0.1,
});

Python - blazediff

pip install blazediff

PyO3 bindings shipped as abi3-py38 wheels for CPython ≥ 3.8 (macOS, Linux manylinux, Windows; arm64 + x86_64). Built from this crate's python Cargo feature.

from blazediff import compare

result = compare("expected.png", "actual.png", "diff.png", threshold=0.1)
if result.match:
    print("identical")
else:
    print(f"{result.diff_count} pixels differ ({result.diff_percentage:.2f}%)")

CLI Usage

# Basic diff
blazediff image1.png image2.png -o diff.png

# With custom threshold (0.0 - 1.0)
blazediff image1.png image2.png -o diff.png -t 0.1

# JSON output for scripting
blazediff image1.png image2.png --json

Library Usage

use blazediff::{diff, DiffOptions};

let options = DiffOptions {
    threshold: 0.1,
    include_anti_aliased: false,
    ..Default::default()
};

let result = diff("image1.png", "image2.png", Some("diff.png"), &options)?;
println!("Different pixels: {}", result.diff_count);

Interpret

Structured region analysis that takes a raw pixel diff and produces human-readable change descriptions. Available via --interpret in the CLI or interpret() in the library.

See INTERPRET.md for the full algorithm documentation - pipeline stages, formulas, classification rules, and output format.

Performance

3-4x faster than odiff, 8x faster than pixelmatch on 4K images.

PNG I/O defaults to spng. Setting BLAZEDIFF_PNG_ENABLED=1 routes decode and stored (level 0) encode through the in-house blazediff_png codec, which is faster than spng on every fixture.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

blazediff-5.2.0-cp38-abi3-win_arm64.whl (582.6 kB view details)

Uploaded CPython 3.8+Windows ARM64

blazediff-5.2.0-cp38-abi3-win_amd64.whl (595.9 kB view details)

Uploaded CPython 3.8+Windows x86-64

blazediff-5.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (739.7 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

blazediff-5.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (692.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

blazediff-5.2.0-cp38-abi3-macosx_11_0_arm64.whl (620.3 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

blazediff-5.2.0-cp38-abi3-macosx_10_12_x86_64.whl (650.0 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file blazediff-5.2.0-cp38-abi3-win_arm64.whl.

File metadata

  • Download URL: blazediff-5.2.0-cp38-abi3-win_arm64.whl
  • Upload date:
  • Size: 582.6 kB
  • Tags: CPython 3.8+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for blazediff-5.2.0-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 bd972b88e686c8119c75c2a725021860a372df0637063691b9dff52ef7c0cdb9
MD5 8ae53c370843ba163184dd902e610dcf
BLAKE2b-256 94bce75018d722445aa360b91164e8949f272120f1089ea41b6f4562efe393d7

See more details on using hashes here.

File details

Details for the file blazediff-5.2.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: blazediff-5.2.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 595.9 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for blazediff-5.2.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5b69455b5a7244ba66f861cc5fe9df505f79f8e4571a8d2301413b6f27a4eeac
MD5 2ffb858b850c7801c0d3e587a93823d7
BLAKE2b-256 d25f4c7ef2849fb9679fd6272a2e1aa1a3d21b97829b1ae5a32639f45164d362

See more details on using hashes here.

File details

Details for the file blazediff-5.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for blazediff-5.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36786f2cb2769fd95dadedd39e2b6fc2228b827d175056270385986e93bcb5ab
MD5 2f54c33cc33e0414969b2360611b975f
BLAKE2b-256 79493a021c8e0ed7a76a2ea3f5708bb62d48c615c9c01fb59d61c27c8b423ea0

See more details on using hashes here.

File details

Details for the file blazediff-5.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for blazediff-5.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 50ab361c41634716679a11b36f0e174a648937c11879e16fb79e77e5fa48e039
MD5 98473e1ee3621a0b1684e6f65a9091d5
BLAKE2b-256 36690cf0f8a02662565b41a5ef749b5e9a2a6a671c6d1843dbedabb534183afd

See more details on using hashes here.

File details

Details for the file blazediff-5.2.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for blazediff-5.2.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 52debb001125d5dd812da194eb94ce6319dd342f1460f27cbc238e5e28463926
MD5 6804e854bc96857d8d1cc3c716e3099f
BLAKE2b-256 eccc94599370d25d5c2c91868d99a0f4dfbd09ca7ae483c62d8cb745dd4947a2

See more details on using hashes here.

File details

Details for the file blazediff-5.2.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for blazediff-5.2.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b0a70238b89148bfe38908f788fbf9e705f5ef4b18e030ce8df8af6c1adedb54
MD5 d4946e5d8b479d638e0eb01ea1d8e671
BLAKE2b-256 6b7ea92fa314371af118e24d2a9e6abfabb15aa202395ba914a61cf277d6c6ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page