1
$\begingroup$

I have an automated visual regression test harness for my web app. It takes baseline and change snapshots using puppeteer and compares them using pixelmatch. If I change the height of an element on the screen however, it pushes everything else on the page down slightly and pixelmatch identifies it as a difference.

I'm wondering if there are any models that can identify visual differences between two very similar images but is robust enough to ignore "slight" layout changes.

$\endgroup$

1 Answer 1

1
$\begingroup$

The first idea to come to my mind, is to calculate the pixel-wise difference, and then pass it through a median filter of a suitable radius. But if your element's height changes significantly and it pushes everything down, then this will be seen as a significant change even after the median filtering.

If you want to ignore all differences due to constant shifting, you'll need to employ more complex algorithms. Then edit-distance and dynamic programming comes to my mind.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .