dmtrKovalenko

odiff

odiff is a very fast image comparison tool that diffs two images visually from the command line or a Node.js API and writes a difference image, making it a fit for visual regression testing on all major platforms.

v4.5.0
Published at
Jul 23, 2026
3,224
Stars
665
Download
Synced at
Oct 4, 2026

Latest release

v4.5.0Jul 23, 2026, 02:36 AM
Downloads slow? Switch the source anytime above

README

Project Overview

odiff is an image comparison tool built for speed. It tells you whether two images differ visually and marks where the differences are. It targets highly similar images such as screenshots, photos, and AI-generated pictures, returning results in milliseconds. Now written in Zig with SIMD optimizations, it ships both a command-line tool and a Node.js API, which makes it easy to drop into automated testing and visual regression pipelines.

Item Value
Platform Windows, macOS, Linux
Type Image comparison / visual regression
Usage Command line + Node.js API
License MIT

Find the visual difference between two images in milliseconds.

Key Features

  • Cross-format comparison: compare a JPG against a PNG directly, with no need to normalize formats
  • Multiple formats: supports PNG, JPEG, WebP, and TIFF
  • Anti-aliasing detection: recognizes and ignores small pixel differences caused by anti-aliasing
  • Ignored regions: exclude specific regions so fixed-position noise does not affect the verdict
  • Visualized differences: writes a difference image so problems are easy to see
  • Perceptual scoring: computes differences the way human vision does for results that match what you see
  • SIMD acceleration: optimized for SSE2, AVX2, AVX512, and NEON
  • Controlled memory footprint: keeps memory in check on large images, so it fits CI environments
  • Server mode: a long-running server mode avoids the cost of spawning a process per call
  • Terminal display: shows the diff directly in terminals that support the kitty graphics protocol

Target Audience

  • Frontend and test automation engineers
  • Visual regression test developers
  • Teams doing screenshot comparison and acceptance testing
  • Developers scripting bulk image comparisons

Quick Start

  1. Install odiff with npm install odiff-bin, or download the binary for your platform from the release page
  2. Run odiff a.png b.png to compare directly; the result is shown in terminals with graphics protocol support
  3. Run odiff a.png b.png diff.png to write the difference to an image
  4. Call compare() from Node.js to get the match result and the reason
  5. Wire it into Playwright, Cypress, or similar frameworks for continuous visual checks

Core Advantages

  • Very fast: results come back in milliseconds, so large batches stay quick
  • Easy to adopt: a CLI and a Node.js API get you running in minutes
  • Matches human perception: perceptual scoring cuts down false positives
  • CI friendly: its controlled memory use runs reliably inside pipelines
  • Simple installation: one npm command installs it and links the right binary automatically

System Requirements

Item Requirement
OS Windows, macOS, Linux
Usage Command-line tool or Node.js
Supported formats PNG, JPEG, WebP, TIFF
Install channel npm package or release binaries

Notes

  • Diff output must be PNG: the difference image is always written as PNG, with no other format supported
  • Built for similar images: the tool targets highly similar images, so comparing very different ones says little
  • Terminal display has a precondition: showing the diff inline requires a terminal with kitty graphics protocol support
  • Ignored regions need care: ignoring too many regions can hide real differences

Release history

Sort