📜  请求从 url 获取图像 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:13.240000             🧑  作者: Mango

代码示例1
import requests
import io
from PIL import Image

response = requests.get("https://i.imgur.com/ExdKOOz.png")
image_bytes = io.BytesIO(response.content)

img = Image.open(image_bytes)
print(f'Size: {img.size}')
img.show()