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

Uploaded CPython 3.8+Windows ARM64

blazediff-5.3.0-cp38-abi3-win_amd64.whl (594.3 kB view details)

Uploaded CPython 3.8+Windows x86-64

blazediff-5.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (737.9 kB view details)

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

blazediff-5.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (691.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

blazediff-5.3.0-cp38-abi3-macosx_11_0_arm64.whl (618.9 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

blazediff-5.3.0-cp38-abi3-macosx_10_12_x86_64.whl (648.3 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for blazediff-5.3.0-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 f5a1ce5687998a4e1b0af65b900ac1a7907bc6b0450f7524198ec568b0a57df9
MD5 0b0261204c3060c62a6316febb1713b6
BLAKE2b-256 0336279fe1f9d555af7fb35e5c7fb9e73acf3e7ce0e235ebcd697ca489f28fb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blazediff-5.3.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 594.3 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.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 98b3d04d42f631d323e79632f18d76304c0d7ed46ecdd6645756160b01bfbea4
MD5 5689d0489fcc9c8ab80e7b711337d7c1
BLAKE2b-256 fb9bc539b40d610570d77c26d2caa50d88b05e6c2fcb2b52550338546607d117

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2448b54b8ba27e66049cd3b7810b1d25874484314e032c9b56d5cf15e43f7526
MD5 ddce6ac02fd94bf76c5120345156aab3
BLAKE2b-256 4973946c89759451b0dd2ecc412750a37defebbfee4aabe5730b0b768c66e0f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e64e1e1c9281d485a2012820b22f07ced8eda18cc5ce11b0d9adfb109e3c9ee7
MD5 93c5d81d26795db918551a54b6411a61
BLAKE2b-256 fcdbe66709d2c6b02930baed27768bd385fc1fad5b8087941f59bdf91253d424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c009bfee4a82a086949969d9d23f7b6640358f97e05385e773630a95c9f21b2
MD5 caacd75d72df54f60cd3e7310f1a44b3
BLAKE2b-256 8ab66d4a3b0f8a8f201637a8c7b1d0b0fb6d5d8ac902ee0b0a5148fdd476a030

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for blazediff-5.3.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 45e19a20df1b09f2da18d959dee2e74994c239c5ee1cc6f44a14f53ab9444942
MD5 ec2be17f98d7e642b27d4ba32c76418f
BLAKE2b-256 c851ca145a327a8a9a6184c9d7c7a63d4ff7ffd0a60aee33a5abf3d8fd97f642

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