Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import glob
  2. from PIL import Image
  3. import numpy as np
  4.  
  5. image_list = []
  6.  
  7. for filename in glob.glob(r'E:\PyCharmProjects\Practice\mozaika\*.jpg'):
  8.     im=Image.open(filename)
  9.     im.thumbnail((100,100))
  10.     image_list.append(im)
  11.  
  12. new_image = Image.new('RGB', (500, 500))
  13.  
  14. for image in image_list:
  15.     for i in range(0, 500, 100):
  16.         for j in range(0, 500, 100):
  17.             new_image.paste(image, (i,j))
  18. new_image.save('mozaika.jpg')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement