Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- import sys, binascii, os
- hue = raw_input("")
- value = bin(int(binascii.hexlify(hue), 16)).replace('b','')
- cmap = {'0': (255,255,255),
- '1': (0,0,0)}
- data = [cmap[letter] for letter in value]
- img = Image.new('RGB', (8, len(value)//8), "white")
- img.putdata(data)
- #img.show()
- desktoppath = os.path.expanduser("~/Desktop/")
- img.save(desktoppath+"file.BMP")
- print repr(hue)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement