Last active
September 16, 2016 20:25
-
-
Save mizunashi-mana/4f5d6b660bacd806981076b218931bf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pillow==3.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
from io import BytesIO | |
from PIL import Image | |
url = 'http://cdn1.www.st-hatena.com/users/da/daiiz/profile.gif?1451834248' | |
filePointer = urllib2.urlopen(url) | |
data = filePointer.read() | |
filePointer.close() | |
image = Image.open(BytesIO(data)) | |
image.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from io import BytesIO | |
import base64 | |
data = 'R0lGODlhDwAPAKECAAAAzMzM/////wAAACwAAAAADwAPAAACIISPeQHsrZ5ModrLlN48CXF8m2iQ3YmmKqVlRtW4MLwWACH+H09wdGltaXplZCBieSBVbGVhZCBTbWFydFNhdmVyIQAAOw==' | |
bytesdata = BytesIO(base64.b64decode(data)) | |
im = Image.open(bytesdata) | |
im.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment