Interesting diff algorithm to handle layout movements
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
Hello Garris and nice to meet you.
I use heavily backstopJS which is such a cool tool. While reading some issues in your repo, I've stumbled upon this one where you speak about an algorithm you're working on to compare visuals that detect and handles layout movement.
I wonder if you could share the code : I'd like to use it in my tests.
Thanks a lot,
Greg
__________________________________________________________
Great -- It would be very cool to integrate this! I personally don't care about `resembleOutputOptions` -- but we could see if the pixelmatch guys would accept a PR (looks trivial). If we do still keep this functionality, it should be remapped to `diffOptions`.
Also, I have developed an experimental image diffing algorithm which detects and handles layout movement changes. See below -- Note the change was to add a line of text in the second card. Pixelmatch (second from the right) behaves as you expect. The new diff (last on the right) aims to only flag the changed pixels...

If you have some interest to also add this after working on pixelmatch integration it would be great. But it's totally optional.
Cheers!
_Originally posted by @garris in https://github.com/garris/BackstopJS/issues/850#issuecomment-420440035_
Contributor guide
Research direction
Start by reviewing the referenced discussion in issue #850 and the experimental image-diff example attached here. Determine whether the layout-movement algorithm code is available and define integration boundaries with the existing pixelmatch work; done would mean a documented, tested integration that detects layout movement as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100