Files
pyDefis/Mosaïque de photos.py
Francois JUMELLE 20526d93c8 Initial release
2021-05-03 22:32:40 +02:00

18 lines
429 B
Python

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")