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.
https://t.me/romankh3
Apache License 2.0
343 stars 105 forks source link

[BUG] Can not compare "10" and "11" in two images #128

Closed lbingyan closed 5 years ago

lbingyan commented 5 years ago

Describe the bug I have two images, and the first one fill out the age field as "10" while the second one is "11", but the comparison result is passed.

here is my code `

imageComparison.setThreshold(5);
imageComparison.getThreshold();

imageComparison.setRectangleLineWidth(2);
imageComparison.getRectangleLineWidth();

imageComparison.setPixelToleranceLevel(0.005);
imageComparison.getPixelToleranceLevel();

imageComparison.setDestination(resultDestination);
imageComparison.getDestination();

imageComparison.setMinimalRectangleSize(100);
imageComparison.getMinimalRectangleSize();

`

romankh3 commented 5 years ago

Hello, @lbingyan. Please, provide test images which are reproduced in this case.

Best regards, Roman.

lbingyan commented 5 years ago

Hello, @lbingyan. Please, provide test images which are reproduced in this case.

Best regards, Roman.

Hi Roman,

here are two images:

8297a509-682c-41c9-883f-3ada44804ede_actual a3f690ee-84de-4218-a1bc-d684603cd547_excepted

lbingyan commented 5 years ago

I have a question, what does "MinimalRectangleSize" mean, the comparison minimal unit? I change the "imageComparison.setMinimalRectangleSize(100)" to "imageComparison.setMinimalRectangleSize(50);" and it works. @romankh3

romankh3 commented 5 years ago

minimalRectangleSize means that the rectangles, which are fewer that this value - won't be counted in comparison. Please, read it: https://github.com/romankh3/image-comparison#configurations

Best regards, Roman.

lbingyan commented 5 years ago

minimalRectangleSize means that the rectangles, which are fewer that this value - won't be counted in comparison. Please, read it: https://github.com/romankh3/image-comparison#configurations

Best regards, Roman.

Thanks.

romankh3 commented 5 years ago

if you any suggestions to improve image-comparison - welcome. For example. the description of the configurations can be not clear for newcomers or something else.

Best regards, Roman,