Advertisement
Peaser

imagerecut

Aug 1st, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. from PIL import Image
  2.  
  3. def recur(object, amt):
  4. total = []
  5. while len(total) < amt:
  6. for i in object:
  7. total.append(i)
  8. return total[:amt]
  9.  
  10. b = Image.open('cover.jpg')
  11.  
  12. ob = b.getdata()
  13. ob = list(ob)
  14. amt = len(ob)
  15. width, height = b.size
  16. total = recur(ob[:124121],amt)
  17.  
  18.  
  19. img = Image.new('RGB', (width, height), "white")
  20. img.putdata(total)
  21. img.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement