Created
July 11, 2018 17:22
-
-
Save marcostolosa/30ed5334ca41db875acad6e1d27025b2 to your computer and use it in GitHub Desktop.
Diff PNG Images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
i1 = Image.open("A.png") | |
i2 = Image.open("B.png") | |
img = Image.new('RGB', i1.size) | |
p1 = i1.load() | |
p2 = i2.load() | |
pnew = img.load() | |
for i in range(i1.size[0]): | |
for j in range(i1.size[1]): | |
if p1[i,j] != p2[i,j]: | |
pnew[i,j] = (255,255,255) | |
img.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment