Gathering detailed insights and metrics for odiff-bin-no-output
Gathering detailed insights and metrics for odiff-bin-no-output
Gathering detailed insights and metrics for odiff-bin-no-output
Gathering detailed insights and metrics for odiff-bin-no-output
The fastest pixel-by-pixel image visual difference tool in the world.
npm install odiff-bin-no-output
Typescript
Module System
Node Version
NPM Version
68.9
Supply Chain
99.1
Quality
75.2
Maintenance
100
Vulnerability
100
License
OCaml (70.05%)
JavaScript (15.34%)
C (11.11%)
Dune (1.89%)
Shell (1.01%)
TypeScript (0.59%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2,190 Stars
250 Commits
87 Forks
17 Watchers
7 Branches
10 Contributors
Updated on Jul 14, 2025
Latest Version
2.5.3
Package Id
odiff-bin-no-output@2.5.3
Unpacked Size
3.44 MB
Size
2.37 MB
File Count
10
NPM Version
6.14.15
Node Version
12.22.8
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
ODiff is a blazing fast native image comparison tool. Check benchmarks for the results, but it compares the visual difference between 2 images in milliseconds. It was originally designed to handle the "big" images. Thanks to OCaml and its speedy and predictable compiler we can significantly speed up your CI pipeline.
base | comparison | diff |
---|---|---|
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
.png
, .jpeg
, .jpg
, and .tiff
Run the simple comparison. Image paths can be one of supported formats, diff output can only be .png
.
odiff <IMG1 path> <IMG2 path> <DIFF output path>
We also provides direct node.js binding for the odiff
. Run the odiff
from nodejs:
1const { compare } = require("odiff-bin"); 2 3const { match, reason } = await compare( 4 "path/to/first/image.png", 5 "path/to/second/image.png", 6 "path/to/diff.png" 7);
Here is an api reference:
The best way to get up-to-date cli interface is just to type the
odiff --help
NodeJS Api is pretty tiny as well. Here is a typescript interface we have:
"1export type ODiffOptions = Partial<{ 2 /** Color used to highlight different pixels in the output (in hex format e.g. #cd2cc9). */ 3 diffColor: string; 4 /** Output full diff image. */ 5 outputDiffMask: boolean; 6 /** Do not compare images and produce output if images layout is different. */ 7 failOnLayoutDiff: boolean; 8 /** Return { match: false, reason: '...' } instead of throwing error if file is missing. */ 9 noFailOnFsErrors: boolean; 10 /** Color difference threshold (from 0 to 1). Less more precise. */ 11 threshold: number; 12 /** If this is true, antialiased pixels are not counted to the diff of an image */ 13 antialiasing: boolean; 14 /** An array of regions to ignore in the diff. */ 15 ignoreRegions: Array<{ 16 x1: number; 17 y1: number; 18 x2: number; 19 y2: number; 20 }>; 21}>; 22 23declare function compare( 24 basePath: string, 25 comparePath: string, 26 diffPath: string, 27 options?: ODiffOptions 28): Promise< 29 | { match: true } 30 | { match: false; reason: "layout-diff" } 31 | { 32 match: false; 33 reason: "pixel-diff"; 34 /** Amount of different pixels */ 35 diffCount: number; 36 /** Percentage of different pixels in the whole image */ 37 diffPercentage: number; 38 } 39 | { 40 match: false; 41 reason: "file-not-exists"; 42 /** Errored file path */ 43 file: string; 44 } 45>; 46 47export { compare };
Compare option will return { match: true }
if images are identical. Otherwise return { match: false, reason: "*" }
with a reason why images were different.
Make sure that diff output file will be created only if images have pixel difference we can see 👀
We provide prebuilt binaries for most of the used platforms, there are a few ways to install them:
The recommended and cross-platform way to install this lib is npm and node.js. Make sure that this package is compiled directly to the platform binary executable, so the npm package contains all binaries and post-install
script will automatically link the right one for the current platform.
Important: package name is odiff-bin. But the binary itself is odiff
npm install odiff-bin
Then give it a try 👀
odiff --help
⛔️ Doesn't work. Waiting for brew approve ⛔️
brew install odiff
apk add odiff
Download the binaries for your platform from release page.
Run the benchmarks by yourself. Instructions of how to run the benchmark is here
Performance matters. At least for sort of tasks like visual regression. For example, if you are running 25000 image snapshots per month you can save 20 hours of CI time per month by speeding up comparison time in just 3 seconds per snapshot.
3s * 25000 / 3600 = 20,83333 hours
Here is odiff
performance comparison with other popular visual difference solutions. We are going to compare some real-world use cases.
Lets compare 2 screenshots of full-size https://cypress.io page:
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
pixelmatch www.cypress.io-1.png www.cypress.io.png www.cypress-diff.png | 7.712 ± 0.069 | 7.664 | 7.896 | 6.67 ± 0.03 |
ImageMagick compare www.cypress.io-1.png www.cypress.io.png -compose src diff-magick.png | 8.881 ± 0.121 | 8.692 | 9.066 | 7.65 ± 0.04 |
odiff www.cypress.io-1.png www.cypress.io.png www.cypress-diff.png | 1.168 ± 0.008 | 1.157 | 1.185 | 1.00 |
Wow. Odiff is mostly 6 times faster than imagemagick and pixelmatch. And this will be even clearer if image will become larger. Lets compare an 8k image to find a difference with another 8k image:
Command | Mean [s] | Min [s] | Max [s] | Relative |
---|---|---|---|---|
pixelmatch water-4k.png water-4k-2.png water-diff.png | 10.614 ± 0.162 | 10.398 | 10.910 | 5.50 ± 0.05 |
Imagemagick compare water-4k.png water-4k-2.png -compose src water-diff.png | 9.326 ± 0.436 | 8.819 | 10.394 | 5.24 ± 0.10 |
odiff water-4k.png water-4k-2.png water-diff.png | 1.951 ± 0.014 | 1.936 | 1.981 | 1.00 |
Yes it is significant improvement. And the produced difference will be the same for all 3 commands.
If you have recently updated, please read the changelog for details of what has changed.
The project is licensed under the terms of MIT license
This project was highly inspired by pixelmatch and imagemagick.
...one day a donation button will appear here. But for now you can follow author's twitter :)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 8/30 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More