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.4.0-cp38-abi3-win_arm64.whl (582.5 kB view details)

Uploaded CPython 3.8+Windows ARM64

blazediff-5.4.0-cp38-abi3-win_amd64.whl (596.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

blazediff-5.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (732.9 kB view details)

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

blazediff-5.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (685.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

blazediff-5.4.0-cp38-abi3-macosx_11_0_arm64.whl (611.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

blazediff-5.4.0-cp38-abi3-macosx_10_12_x86_64.whl (650.3 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for blazediff-5.4.0-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 1566782bc36a4c755f5914427352bee52794589375a3b5ccd19ebdce1fd6b4c0
MD5 f5154c4fb17df5750f55c28ce45ffe3c
BLAKE2b-256 7efed7a9de7fd99a2dd5678ccca112537131ecd4c34bffee279ade2455ab8cd5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blazediff-5.4.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 596.2 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.4.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 58cd687ecf55100e1ea6ba492a46108afeddbb6e03e55bdc0ad7cb83413ef4d8
MD5 ea1164dd437a68d42248e8cf9c22ecbb
BLAKE2b-256 506821de888585e20229098ef7746c34d778e7fdb59a4a3950604de0353899a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7551fbe7a97be25031f75c80efb731f413b4976ff7e8ca00929db29bd503685c
MD5 1d03227e8fe1145ce4c78889dae056a5
BLAKE2b-256 6bd2f1a1951ae41746b06e74f5fa2ff0e8a3e3c06477cc1b4e5b974e296adf0d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 247199aa3c330c6069aac11ab1e1e812b8ce6bc5e3a32387e882664f17ec0228
MD5 bcb30fe5590eed4032d5ddb76d1126f5
BLAKE2b-256 9a3d73130269c5518d49cb7fe8058b9182acbf2ea1d518e3b4aa512e916f06ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.4.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6571393667aa5ce58571410c1d58593537be8624a2897cdfeaafca236f38679c
MD5 856ed2c9257f972a5aa96676d551f49b
BLAKE2b-256 8aa3ee2c0be0f8e29b62a8fb02e15ce0b341c738a8c3bfd93d556e66242a2fa9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.4.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8819ccde6be102bae33d8fa93b27dc89d85a629f8d013108ce6725c8421ab528
MD5 d63e5c584e566cb72f301a1db2c495d3
BLAKE2b-256 8988320b4bc58a25065e9066b32d96d07c4e2e9d7b37c26e0b5c60b901845fb3

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