Skip to content

Instantly share code, notes, and snippets.

@gavinmh
Created July 18, 2017 00:15
Show Gist options
  • Save gavinmh/08de9e558e7c51f9356f008d47f214b5 to your computer and use it in GitHub Desktop.
Save gavinmh/08de9e558e7c51f9356f008d47f214b5 to your computer and use it in GitHub Desktop.
Download image into buffer
import requests
from PIL import Image
from StringIO import StringIO
r = requests.get('https://example.com/image.jpg')
i = Image.open(StringIO(r.content))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment