Forum Discussion

rushikesh's avatar
rushikesh
Contributor
6 years ago
Solved

Is there a way to measure how much an image differs from compared image ?

Hello,   I have two images say A and B. There is a baseline image say Z.   I want to compare A with Z and find out how much A differs from Z. ( like in percentage or particular number)   then ...
  • will_fetherolf's avatar
    6 years ago

    Based on the images provided...

     

    Do some math to determine the center of the image.  Using the Pixels function, which is a method of Picture (https://support.smartbear.com/testcomplete/docs/reference/program-objects/picture/pixels.html?q=pixels), retrieve the color at the middle.  If it's your shade of blue, it's pinned.  If it's that shade of gray, it's unpinned.

     

    Retrieving the amount of red is a similar process.  You're going to loop through each pixel in the image and if the pixel color is red, increment a red counter.  It's not elegant, but it'll get the job done.

     

    I think your best bet is to test for blue or gray.