From the course: Scripting for Testers
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Comparing images - Python Tutorial
From the course: Scripting for Testers
Comparing images
- [Instructor] In the last video, we created an image that showed a diff between two images. That's an interesting way to compare images. But now let's look at creating an image that contains both images. So we'll do that inside our compare images method here. So here we're saving the diff, but let's also save a comparison image. And we'll start by actually creating a blank image that's big enough to hold both images that we plan to put into it. And then we'll insert each image into that blank image. So let's first figure out the height that we want. So we'll get the max height of our two images, which is max, and then our img1 height and our img2 height. And then we'll create a new image, which we'll call combined. And we'll use the Image.new method to do that. We want it to be a red, green, blue image. And then we have to specify the width and the height of this image. So the width that it's going to have is just going to be img1.width + img2.width. So we're going to add the two…
Contents
-
-
-
-
-
-
(Locked)
Taking a snapshot of your site5m 20s
-
(Locked)
Verifying images in a snapshot6m 6s
-
(Locked)
Emulating different devices3m 37s
-
(Locked)
Create image diff (difference) tools4m 4s
-
(Locked)
Comparing images5m 57s
-
(Locked)
Generating test images5m 42s
-
(Locked)
Find a subimage in an image6m 38s
-
(Locked)
Challenge: Cross browser data validation1m 22s
-
(Locked)
Solution: Cross browser data validation5m 52s
-
(Locked)
-