Files
pyDefis/Herculito 9 La ceinture d'Hippolyte.py
Francois JUMELLE 20526d93c8 Initial release
2021-05-03 22:32:40 +02:00

20 lines
484 B
Python

from PIL import Image
image = Image.open("herculito-ceinture.png")
width, height = image.size
image_rgb = image.convert("RGB")
for x in range(width//2):
for y in range(height):
pixel1 = image_rgb.getpixel((x,y))
pixel2 = image_rgb.getpixel((x+width//2,y))
if pixel1 == pixel2:
pixel = (255,255,255)
else:
pixel = (0,0,0)
image_rgb.putpixel((x, y), pixel)
image_rgb.save("herculito-ceinture_decoded.png", "png")