27 lines
597 B
Python
27 lines
597 B
Python
from PIL import Image
|
|
|
|
image1 = Image.open("poke_crypto_cle1.png")
|
|
image2 = Image.open("poke_crypto_cle2.png")
|
|
|
|
width, height = image1.size
|
|
|
|
image1_rgb = image1.convert("RGB")
|
|
image2_rgb = image2.convert("RGB")
|
|
|
|
|
|
for x in range(width):
|
|
for y in range(height):
|
|
r1,g1,b1 = image1_rgb.getpixel((x,y))
|
|
r2,g2,b2 = image2_rgb.getpixel((x,y))
|
|
|
|
if r1 == r2:
|
|
#Vert
|
|
value = g1 ^g2
|
|
else:
|
|
#bleu
|
|
value = b1 ^b2
|
|
|
|
|
|
image1_rgb.putpixel((x, y), (value, value, value))
|
|
|
|
image1_rgb.save("poke_crypto_cle_decoded.png", "png") |