How To: Do Image comparison between 2 different image rendering

Best practices, code snippets for common functionality, examples, and guidelines.
hc123
Posts: 11
Joined: Tue Nov 09, 2021 9:08 am

How To: Do Image comparison between 2 different image rendering

Post by hc123 » Tue Nov 23, 2021 11:03 am

Hello,

I want to ask a question about image comparison between two different machines.

Here's the image I want to compare:

Image

The Expected image comes from my machine, and the Actual comes from my colleague's machine.

We both have set our screen resolution to 1920x1080 and DPI to 100%

I use ContainsImage validation and it Passed on my machine.

When the test was run on my colleague's machine, it yields Failed.

The Ranorex reports the following differences:

Image

Here's the images after being scaled 400%:

Image

We can see some pixel differences between Expected and Actual. Seems like line rendering between our two machines was different.

My question on this matter, is there any options in Ranorex to do image comparison between these two images with different rendering? Or are there any suggestions on how to compare both images?

For your information, my machine graphics card was Quadro T2000 and my colleague's machine graphics card was GTX 1650

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How To: Do Image comparison between 2 different image rendering

Post by odklizec » Tue Nov 23, 2021 11:41 am

Hi,

I'm afraid, there is no option in Ranorex to solve this kind of "different aliasing" issue. I think your best hope is to play with the Similarity option, which you probably already tried? As Ranorex is primarily a UI test automation tool, image-based operations should be used only as a last-resort option and only with small images. I would never use image validation for anything larger than 100x100 pixels ;) The results on larger images are just too prone to failure, due to resolution/scale differences.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

hc123
Posts: 11
Joined: Tue Nov 09, 2021 9:08 am

Re: How To: Do Image comparison between 2 different image rendering

Post by hc123 » Wed Nov 24, 2021 2:59 pm

Alright. Thanks very much for the answer.

We're testing a CAD application, so sometimes we need the image comparison capabilities for testing.

Will take a note about this.