Always return a positive number of different pixels.
This commit is contained in:
parent
cb7b9e6a66
commit
bd940bdc2e
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ def compare(actual, expected, alpha=True):
|
|||
pixels = im1.width() * im1.height()
|
||||
delta_pixels = (im2.width() * im2.height()) - pixels
|
||||
if delta_pixels != 0:
|
||||
return delta_pixels
|
||||
return abs(delta_pixels)
|
||||
for x in range(0,im1.width(),2):
|
||||
for y in range(0,im1.height(),2):
|
||||
if compare_pixels(im1.get_pixel(x,y),im2.get_pixel(x,y),alpha=alpha):
|
||||
|
|
Loading…
Add table
Reference in a new issue