Advertisement
Peaser

any(no args)

Jul 31st, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. from PIL import Image
  2. import math
  3. try:
  4.  
  5.     filen = "rail.jpg"
  6.  
  7.     data = open(filen, 'rb').read().encode('base64')
  8.     parts = [ord(i) for i in data]
  9.     vecs = [(i, i, i) for i in parts]
  10.  
  11.     img = Image.new('RGB', (int(math.ceil(math.sqrt(len(vecs)))), int(math.ceil(math.sqrt(len(vecs))))), "white") #Making the image square, aswell as *just* large enough to have leftover space
  12.     img.putdata(vecs)
  13.     img.show()
  14.  
  15. except MemoryError: print "TOO FUCKIN BIG"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement