ashot icon indicating copy to clipboard operation
ashot copied to clipboard

markign differrence with rectangle

Open apathan123 opened this issue 3 years ago • 6 comments

Is it possible to mark diff area with rectangle instead of some solid color OR is ti possible to get marking on x,y co ordinates in image where the diff is identified

apathan123 avatar Jul 27 '21 18:07 apathan123

@valfirst - CAn you please help me in this case

apathan123 avatar Aug 05 '21 05:08 apathan123

with rectangle instead of some solid color

sorry, could you please elaborate on this?

is ti possible to get marking on x,y co ordinates in image where the diff is identified

do you need to get the coordinates (x, y) of the all found diffs?

valfirst avatar Aug 05 '21 06:08 valfirst

with rectangle instead of some solid color

sorry, could you please elaborate on this?

is ti possible to get marking on x,y co ordinates in image where the diff is identified

do you need to get the coordinates (x, y) of the all found diffs?

Yes. Basically when there is very small diff on the screen then its difficult to locate. So if we can have the area of diff marked as rectangle that will be really helpful.

apathan123 avatar Aug 12 '21 04:08 apathan123

https://github.com/romankh3/image-comparison this one draws rectangles

val imageDiff = new ImageComparison(
      read(getRelativeResourceAsStream(getClass(),
          "example.png")),
      read(getRelativeResourceAsStream(getClass(),
          "example-different.png")));

val d = imageDiff
    .setDifferenceRectangleFilling(true, 10)
    .compareImages();

try (val o = new FileOutputStream("diff.png")) {
    write(d.getResult(), "png", o);
}

assertThat(d.getImageComparisonState(),
    is(MISMATCH));

adrian-herscu avatar Mar 16 '22 06:03 adrian-herscu

Thanks so much @adrian-herscu ! Will give a try but looks exactly what I was looking for!

apathan123 avatar Mar 16 '22 08:03 apathan123

Thanks so much @adrian-herscu ! Will give a try but looks exactly what I was looking for!

You're welcome :) Actually, I don't know why this library does comparison at all... Maybe join forces somehow?...

adrian-herscu avatar Mar 16 '22 12:03 adrian-herscu