Rename rmsdiff to rmsDiffPil

This commit is contained in:
2024-03-25 20:01:51 +01:00
parent 8b0b58953d
commit 7c7cbad0ef
2 changed files with 8 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ import math
import operator
import functools
def rmsdiff(im1, im2):
def rmsDiffPil(im1, im2):
"Calculate the root-mean-square difference between two images"
h = ImageChops.difference(im1, im2).histogram()
@@ -12,3 +12,4 @@ def rmsdiff(im1, im2):
return math.sqrt(functools.reduce(operator.add,
map(lambda h, i: h*(i**2), h, range(256))
) / (float(im1.size[0]) * im1.size[1]))