romankh3 / image-comparison

Published on Maven Central Java Library that compares 2 images with the same sizes and shows the differences visually by drawing rectangles. Some parts of the image can be excluded from the comparison. Can be used for automation QA tests.

Home Page:https://t.me/romankh3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[IMPROVEMENT] - Ignoring linespaces and comparing only text and styling changes

svccsotest10 opened this issue · comments

I wanted to compare only text and styling changes between images. How can i ignore linespaces while comparing?

Background:

I am comparing two webpages. Both webpages are of same source just deployed on two environments - env1 and env2.

Now env1 renders page with little whitespace of two lines from top while env2 renders without it. I have automated the process and of taking screenshot of webpages and then using image-comparison to compare the images from 2 env's

slide-1_ppt2

slide-1_ppt2

slide-1_ppt1

slide-1_ppt1

Adding both the images.

slide-1_ppt1 has a linespace on top while slide-1_ppt2 does not. As a result I am getting whole content highlighted.

Result of comparison
result-1

How to ignore the linespace?

@romankh3 Hi, I'd like to work on the issue.

How about allowing the user to select to remove a single background for comparison. I mean, if the background has the same pixel, we can chose to ignore them and just compare the remaining part.