compare-img
v1.0.4
Published
Binary-level image comparison for Node.js and the browser.
Maintainers
Readme
compare-img
Binary-level image comparison for Node.js and the browser.
Pass image URLs. Get back true if they're all identical, false otherwise. That's it.
Live demo — shumatsumonobu.github.io/compare-img
Install
npm install compare-imgQuick Start
import compare from 'compare-img';
// Same images → true
await compare('photos/original.png', 'photos/original.png');
// Different images → false
await compare('photos/original.png', 'photos/edited.png');API
compare(...imgs: string[]): Promise<boolean>
compare(imgs: string[]): Promise<boolean>Arguments can be passed individually or as a single array. Returns true only when all images match.
import compare from 'compare-img';
// Individual arguments
await compare('photos/original.png', 'photos/backup.png', 'photos/edited.png');
// Array
await compare(['photos/original.png', 'photos/backup.png', 'photos/edited.png']);Changelog
See CHANGELOG.md.
Author
shumatsumonobu — GitHub / X / Facebook
