Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
import base64
from io import BytesIO
from PIL import Image, ImageChops
a_base_64 = 'iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DA' \
'cdvqGQAAAAWSURBVBhXY3BwcGBgYGD8//8/AwMDABgGA7/DZDVsAAAAAElFTkSuQmCC'
b_base_64 = 'iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DA' \
'cdvqGQAAAAVSURBVBhXY/z//z8DAwMTEDMwMAAAJAYDAbrboo8AAAAASUVORK5CYII='
a = Image.open(BytesIO(base64.b64decode(a_base_64)))
b = Image.open(BytesIO(base64.b64decode(b_base_64)))
diff = ImageChops.difference(a, b).convert('L')
print(sum(diff.point(bool).getdata()))
2
Process finished with exit code 0
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question