1、简介
GitHub:https://github.com/whtsky/pixelmatch-py
2、代码
from PIL import Image from pixelmatch.contrib.PIL import pixelmatch img_a = Image.open("WD1.png").resize((1920, 1080)) img_b = Image.open("WD2.png").resize((1920, 1080)) img_diff = Image.new("RGBA", img_a.size) # note how there is no need to specify dimensions mismatch = pixelmatch(img_a, img_b, img_diff, includeAA=True) print(mismatch) img_diff.save("pixelmatch-diff.png")
标签:img,1080,Python,pixelmatch,Image,两图,diff,png From: https://www.cnblogs.com/TSmagic/p/17875313.html