cancel
Showing results for 
Search instead for 
Did you mean: 

[TechCorner Challenge #12] Compare images using the Region Checkpoint

SOLVED
Highlighted
Community Manager

[TechCorner Challenge #12] Compare images using the Region Checkpoint

Hi TestComplete Community!

 

Dare to take the challenge?🙂

By completing the tasks, you can practice your skills of working with TestComplete features and also get into the TechCorner Leaderboard! 

 

Task: Compare the two images below using TC Region Checkpoint ...and reveal a secret message! Post the message and the script to the comments.

Difficulty:Star_Gold.pngStar_gray.pngStar_gray.png

 

Steps to do this:

1. Add the images below to the Regions collection.

2. Perform a pixel-by-pixel comparison using the Check method.

3. Click the “View Comparison Result” button in the log to reveal the secret message and post it along with your script to the comments!

 

Images to compare:

 

img1.png

img2.png

 

Have fun and good luck😊

 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Leader

Compare images using the Region Checkpoint

Task: Compare the two images below using TC Region Checkpoint ...and reveal a secret message! Post the message and the script to the comments.

 

This is a solution created for [TechCorner Challenge #12]

 

Secret message:

anupamchampati_0-1600351238630.png

 

function Test()

{

   var pic2 = Utils.Picture;

   pic2.LoadFromFile('D:\\img2.png');

  Regions.img1_png.Check(pic2, false, false, 1, 1);

}

 

Result:

Click here to show or modify data of the checkpoint "img1_png".

The images are not equal.

The pixel difference is 1 %.
The color difference is 20 %.

There is a slight difference between the compared images. If you want the checkpoint to report them as equal, set its Pixel Tolerance parameter to 277.

Update the "img1_png" checkpoint data.

 

View solution in original post

Tags (1)
Highlighted
Occasional Contributor

Compare images using the Region Checkpoint

Task: Compare the two images below using TC Region Checkpoint ...and reveal a secret message! Post the message and the script to the comments.

 

This is a solution created for [TechCorner Challenge #12]

 

[DelphiScript]

procedure comparingPictures();

begin

if Not Regions.img1_png.Check('img2_png') then

Log.Message('Differ')

end;

 

Project Explorer:

elanto_4-1600354390687.png

Workspace

elanto_5-1600354443083.png

 

Results

@elanto_Challenge_12.JPG

View solution in original post

Tags (1)
5 REPLIES 5
Highlighted
Community Leader

Compare images using the Region Checkpoint

Task: Compare the two images below using TC Region Checkpoint ...and reveal a secret message! Post the message and the script to the comments.

 

This is a solution created for [TechCorner Challenge #12]

 

Secret message:

anupamchampati_0-1600351238630.png

 

function Test()

{

   var pic2 = Utils.Picture;

   pic2.LoadFromFile('D:\\img2.png');

  Regions.img1_png.Check(pic2, false, false, 1, 1);

}

 

Result:

Click here to show or modify data of the checkpoint "img1_png".

The images are not equal.

The pixel difference is 1 %.
The color difference is 20 %.

There is a slight difference between the compared images. If you want the checkpoint to report them as equal, set its Pixel Tolerance parameter to 277.

Update the "img1_png" checkpoint data.

 

View solution in original post

Tags (1)
Highlighted
Community Manager

Re: [TechCorner Challenge #12] Compare images using the Region Checkpoint

@anupamchampati glad to see you participating in our challenge🙂

 

Did you manage to read the secret message? Check out the highlighted changes on the picture tab (like shown in this topic) and post the text you find 🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Leader

Re: [TechCorner Challenge #12] Compare images using the Region Checkpoint

Great, nice to see this secret message :😀

anupamchampati_0-1600351238630.png

 

Highlighted
Occasional Contributor

Compare images using the Region Checkpoint

Task: Compare the two images below using TC Region Checkpoint ...and reveal a secret message! Post the message and the script to the comments.

 

This is a solution created for [TechCorner Challenge #12]

 

[DelphiScript]

procedure comparingPictures();

begin

if Not Regions.img1_png.Check('img2_png') then

Log.Message('Differ')

end;

 

Project Explorer:

elanto_4-1600354390687.png

Workspace

elanto_5-1600354443083.png

 

Results

@elanto_Challenge_12.JPG

View solution in original post

Tags (1)
Community Manager

Re: Compare images using the Region Checkpoint

Good job @elanto ! Now we have a Delphi solution as well🙂


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors