mapbox / pixelmatch

The smallest, simplest and fastest JavaScript pixel-level image comparison library
ISC License
6.17k stars 307 forks source link

Optimize for identical images case #60

Closed mourner closed 5 years ago

mourner commented 5 years ago

Closes #38. Closes #39 (being a replacement).

@bontscho I'm very sorry for not getting to your PR in time! Took the same approach but adapted it so that it doesn't rely on Node-specific features, and instead works on typed array level so it works both in Node and the browser. Performance is about the same.

I also opted for doing the optimization by default, without any options — there seems to be no value in turning this off.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 6ba4756f19b92de5d9f619fb4b96ef89d4d27d4e on optimize-identical into 8a5683b7e85760275c94151ebc217522f83793a0 on master.