Initial release
This commit is contained in:
18
Mosaïque de photos.py
Normal file
18
Mosaïque de photos.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
from PIL import Image
|
||||
|
||||
input = open("photomosaic_input.txt").read().splitlines()
|
||||
|
||||
solution = Image.new("RGB", (180*32, 110*32))
|
||||
|
||||
for line in input:
|
||||
x,y,img=line.split(",")
|
||||
x = int(x.strip())
|
||||
y = int(y.strip())
|
||||
img = Image.open(os.path.join("imagettes_espions", "{:03d}".format(int(img.strip()))+".jpeg"))
|
||||
solution.paste(img, (y*32,x*32))
|
||||
|
||||
solution.show()
|
||||
solution.save("photomosaic_input.jpg")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user