requests get image from url

Solutions on MaxInterview for requests get image from url by the best coders in the world

showing results for - "requests get image from url"
Fabien
11 Apr 2019
1import requests
2import io
3from PIL import Image
4
5response = requests.get("https://i.imgur.com/ExdKOOz.png")
6image_bytes = io.BytesIO(response.content)
7
8img = Image.open(image_bytes)
9print(f'Size: {img.size}')
10img.show()
11