Skip to content

Instantly share code, notes, and snippets.

@iptq
Created March 26, 2017 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iptq/a7958fd7b5fff2c7b04de034cb9bc199 to your computer and use it in GitHub Desktop.
Save iptq/a7958fd7b5fff2c7b04de034cb9bc199 to your computer and use it in GitHub Desktop.
VC Solution
#!/usr/bin/env python
from PIL import Image
A = Image.open("A.png")
B = Image.open("B.png")
dA = A.load()
dB = B.load()
C = Image.new("RGB", (370, 370), "white")
for x in range(370):
for y in range(370):
a = dA[x, y]
b = dB[x, y]
v = a ^ b
C.putpixel((x, y), (v, v, v))
C.save("C.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment