Advertisement
Guest User

Untitled

a guest
Nov 15th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import sys
  2. from PIL import Image
  3.  
  4. images = map(Image.open, ['culvularia_H1.jpg', 'culvularia_H1.jpg'])
  5. widths, heights = zip(*(i.size for i in images))
  6.  
  7. total_width = sum(widths)
  8. max_height = max(heights)
  9.  
  10. new_im = Image.new('RGB', (total_width, max_height))
  11.  
  12. x_offset = 0
  13. for im in images:
  14. new_im.paste(im, (x_offset,0))
  15. x_offset += im.size[0]
  16.  
  17. new_im.save('culvularia_H1.jpg')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement