Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- import math
- try:
- filen = "rail.jpg"
- data = open(filen, 'rb').read().encode('base64')
- parts = [ord(i) for i in data]
- vecs = [(i, i, i) for i in parts]
- 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
- img.putdata(vecs)
- img.show()
- except MemoryError: print "TOO FUCKIN BIG"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement