Skip to content

Instantly share code, notes, and snippets.

@hktechn0
Created February 5, 2010 20:44
Show Gist options
  • Save hktechn0/296207 to your computer and use it in GitHub Desktop.
Save hktechn0/296207 to your computer and use it in GitHub Desktop.
PIL Image get from web (urllib2)
#!/usr/bin/env python
import urllib2
import Image
import cStringIO
imgdata = urllib2.urlopen("http://www.google.co.jp/intl/ja_jp/images/logo.gif").read()
img = Image.open(cStringIO.StringIO(imgdata))
img.save("goog.png")
@chiragmatkar
Copy link

thanks buddy , was stuck after moving from urllib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment