Montikore's avatar
Montikore
Occasional Contributor
9 years ago
Status:
Accepted for Discussion

Being able to compare images with a tolerance percentage

My wish is just  to add a value between 1 and 100 to the compare function parameters. It represents the percentage of similitude of the images : in many cases images are not exactly the same but are similar enough to be considered equal. If the calculated similitude of the 2 images is equal or superior to the parameter, then it returns true, else false.

 

  • cunderw's avatar
    cunderw
    Community Hero

    Are you using the compare pictures operation? This is already a supported paramter. 

     

    PixelTolerance

    Lets you ignore a slight difference between the images. If the number of different pixels is less than or equal to PixelTolerance, then TestComplete considers the images to be identical. 0 is the default value. It means that no difference between the bitmaps, except for that set by the Transparent parameter, is ignored.

  • mgroen2's avatar
    mgroen2
    Super Contributor

    Montikore, cunderw I have created a feature request in the past, related to this. It can be found here.

     

    Sometimes the images you have to compare are "equal" except they are different in size, for example a the size of a side bar is rendered differently in IE compared to FF, which results in huge amount of difference, if you check on pixel level. Because if the bar is for example 500 pixels wide, then each difference in pixel row would be a difference of 500 pixels, but you have to be able to set a tolerance on size so you can check if they are equal and accept some difference in size

  • Status changed:
    New Idea
    to
    Accepted for Discussion

    Great Idea! Thank you very much. I will add to the enhancements discussion for this week and post the result after the discussion.

     

    Best Regards,

    Masha

  • Montikore's avatar
    Montikore
    Occasional Contributor

    @cunderw PixelTolerance is not a percentage... so almost useless

     

    mgroen2 your feature request is more something like "search an image inside another image" as a size difference tolerance

     

    Here i'm only suggesting an acceptable percentage of differences between 2 images of same size.