dify is a fast pixel-by-pixel image comparison tool in Rust.
npm install dify-bin
const dify = require('dify-bin');
dify(['--output', 'diff.png', 'left.jpg', 'right.jpg'], (err, out) => {
if (err) {
if (err.isDifferent) {
console.log('Changes detected');
} else {
console.error(err.stderr);
}
process.exit(err.code);
return;
}
console.log('No changes detected', out.stdout);
});
npx dify-bin --help
npm install --global dify-bin
dify --help