- How to get string data from a python PIL image object?
- from PIL import ImageGrab
- import cStringIO
- fakie = cStringIO.StringIO()
- ImageGrab.grab().save(fakie, 'GIF')
- data = fakie.getvalue()
- fakie.close()
- # This last bit of code is to see if the var data stored the right info in a str bc i need to send it through a socket
- with open('C:somethingsomethingDesktopimage.gif', 'w') as f:
- f.write(data)