Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
10 months ago
Solved

Locking image size to certain value for image comparison

Hi,   I use 'Difference' method to compare image versions.  For example: Images saved on a particular past date are compared with images saved on a current date. I am using certain parameters suc...
  • KB1's avatar
    10 months ago

    Good morning!

    Image size variations can indeed affect the accuracy of your comparisons, especially when you switch machines with different settings. However, there's a solution that can help you achieve more consistent results: image resizing.

     

    Before performing the comparison, it's recommended to resize both the old and new images to a standard size. By doing this, you eliminate the discrepancies caused by varying image dimensions. In TestComplete, you have the option to utilize its built-in image manipulation capabilities for resizing. Alternatively, if you're comfortable with Python scripting, you can leverage external libraries like OpenCV to achieve this.

     

    When resizing the images, it's crucial to maintain the original aspect ratio to prevent any distortions in the visuals. Keeping the aspect ratio intact ensures that the images retain their proper proportions during the resizing process.

     

    any questions? please don't hesitate to ask.