- Category
- Developer Tools
- Rank
- No. 513Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- dmtrkovalenko
- GitHub
- 3.2k stars
- Latest release
- v4.5.0
- Date
About
Dmitry Kovalenko's SIMD-first image-comparison library with Node.js bindings — the fastest pixel diff for visual regression tests.
What it does
Odiff compares two encoded images and reports whether their layouts or pixels differ. It measures perceived color distance with YIQ, can generate a PNG diff, and accepts controls for thresholds, antialiasing, ignored regions, overlays, and memory use.
Why it's ranked here
The appeal is unusually focused engineering: native comparison, several CPU vector instruction sets, cross-format input, structured results, and a persistent process for repeated work. The repository also supplies a Playwright matcher and platform packages, making the core practical inside JavaScript test suites.
What's good
It distinguishes layout changes, pixel changes, and missing files instead of returning one vague failure. Results can include changed-pixel counts, percentages, rows, and columns. Teams can tune color thresholds, exclude unstable regions, suppress antialiasing noise, and choose a lower-memory mode for large images.
Tradeoffs
The standard Node path launches a child process, while avoiding repeated startup requires managing the persistent server. Prebuilt binaries cover a defined platform matrix rather than every operating system and architecture. Diff output is limited to PNG, and lower memory consumption explicitly trades away speed on larger images.
How to use it well
Use it as the comparison engine in screenshot-heavy CI, especially with Playwright or repeated Node workloads. Keep a persistent server alive when processing many pairs, tune thresholds against representative images, and ignore genuinely dynamic regions. It does not replace screenshot capture, baseline management, hosted review, or approval workflows.
Technical notes+
The root package.json defines a private MIT-licensed npm workspace over npm_packages/*. npm_packages/odiff-bin/odiff.js converts JavaScript options into CLI arguments, executes the resolved native binary, and maps exit codes into typed results. npm_packages/odiff-bin/server.js maintains a spawned --server process, correlates newline-delimited JSON by requestId, serializes writes, handles stream backpressure, supports encoded buffers, and offers per-request timeouts. npm_packages/odiff-bin/binary.js resolves optional platform packages for Linux, macOS, and Windows across x64, Arm64, and Linux RISC-V 64. src/rvv.c implements a RISC-V Vector YIQ color-distance path with scalar stubs when vector support is unavailable. npm_packages/playwright-odiff/tsup.config.ts builds dual ESM and CommonJS outputs with declarations and sourcemaps.
Observed
- License
- MIT
- Primary implementation
- Zig, with C SIMD code and JavaScript/TypeScript integration layers
- Install surface
- npm workspace containing odiff-bin, playwright-odiff, and optional platform-specific binary packages
- Interfaces
- Native CLI, Node.js library, Playwright matcher, and newline-delimited JSON server over standard input and output
- Prebuilt platforms
- Linux x64, Arm64, and RISC-V 64; macOS x64 and Arm64; Windows x64 and Arm64
- Image formats
- README lists PNG, JPEG, JPG, WebP, and TIFF, including cross-format comparison
Read from README.md, package.json, src/rvv.c, scripts/process-readme.js, scripts/set-npm-version.js, npm_packages/odiff-bin/odiff.js, npm_packages/odiff-bin/server.js, npm_packages/odiff-bin/binary.js, npm_packages/odiff-bin/odiff.d.ts, npm_packages/playwright-odiff/tsup.config.ts, npm_packages/playwright-odiff/playwright.config.ts, npm_packages/platforms/linux-x64/index.js, npm_packages/platforms/win32-x64/index.js, npm_packages/platforms/darwin-x64/index.js, npm_packages/playwright-odiff/src/index.ts.
What it can do
Compare two images pixel by pixel
Two image files → Pixel difference data
Generate visual diff image showing differences
Two image files → Diff image highlighting changed pixels
Perform visual regression testing
Reference image and test image → Pass/fail result with difference metrics
Calculate difference percentage between images
Two image files → Numerical difference percentage
Detect pixel-level changes in images
Two image files → Boolean result indicating if images differ
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
