Skip to content

Commit

Permalink
docs: add info about option "shouldCluster" (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod authored Apr 10, 2020
1 parent afc8230 commit 20f2512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ looksSame('image1.png', 'image2.png', {ignoreAntialiasing: true, antialiasingTol
Looksame returns information about diff bounds. It returns only first pixel if you passed `stopOnFirstFail` option with `true` value. The whole diff area would be returned if `stopOnFirstFail` option is not passed or it's passed with `false` value.

### Getting diff clusters
Looksame returns diff bounds divided into clusters. You can pass clusters size using `clustersSize` option.
Looksame returns diff bounds divided into clusters if option `shouldCluster` passed with `true` value. Moreover you can pass clusters size using `clustersSize` option.

```javascript
looksSame('image1.png', 'image2.png', {stopOnFirstFail: false}, function(error, {equal, diffBounds, diffClusters}) {
looksSame('image1.png', 'image2.png', {shouldCluster: true, clustersSize: 10}, function(error, {equal, diffBounds, diffClusters}) {
// {
// equal: false,
// diffBounds: {left: 10, top: 10, right: 20, bottom: 20}
Expand Down

0 comments on commit 20f2512

Please sign in to comment.