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
337 stars 105 forks source link

[IMPROVEMENT] Diff between pixels #190

Open dmiroshnyk opened 4 years ago

dmiroshnyk commented 4 years ago

Moved from another issue

Why diff between pixels is calculated like (pixel2RGB - pixel1RGB)? For example, we have pixel2 - white. Diff vs pixel1 depends on pixel1 RGB color. So, diff vs red pixel will be less than vs blue. I don't understand the reason of this. For example, if I convert my image with google and change all red colors to blue and ask to recalculate diff (let's imagine the bug is fixed) - the diff percentage return another value which looks having no sense because the result file will look identically. IMHO, the diff between single pixel should be normalized to 0 (no diff) or 1(diff) and formula should look like: (<# of all different pixels> / <# of all pixels>) * 100. What do you think about it?

scp-WFZ commented 2 years ago

@romankh3 Hello~, I'd like to work on this issue.