5 nouveaux défis

This commit is contained in:
2022-10-16 18:03:42 +02:00
parent 5d8d6dd6ee
commit 00331e1249
9 changed files with 147 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
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()