Files
pyDefis/On a brouillé la carte du Maraudeur.py
2022-10-16 18:03:42 +02:00

20 lines
377 B
Python

from PIL import Image
a = 53911
b = 15677
image = Image.open("maraudeur_cr.png")
width, height = image.size
res = Image.new(image.mode, (width, height))
n = width * height
for pos in range(n):
new_pos = (a*pos+b)%n
pixel = image.getpixel((new_pos%width,new_pos//width))
res.putpixel((pos%width,pos//width), pixel)
#res.save("maraudeur_cr_res.png")
res.show()