5 nouveaux défis
This commit is contained in:
19
On a brouillé la carte du Maraudeur.py
Normal file
19
On a brouillé la carte du Maraudeur.py
Normal 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()
|
||||
Reference in New Issue
Block a user