Skip to content

Instantly share code, notes, and snippets.

@konverner
Created April 27, 2023 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konverner/8f80703bdfe2dc577270845ba3da313d to your computer and use it in GitHub Desktop.
Save konverner/8f80703bdfe2dc577270845ba3da313d to your computer and use it in GitHub Desktop.
Read image with PIL from url
from PIL import Image
import requests
from io import BytesIO
url = 'https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png'
response = requests.get(url)
img = Image.open(BytesIO(response.content))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment