python Image open 读取网络图片本地显示


#!/usr/bin/python3
# -*- coding: utf-8 -*-

import requests
from PIL import Image
from io import BytesIO

response = requests.get('https://static.geetest.com/pictures/gt/5629ed821/5629ed821.webp')
response = response.content

BytesIOObj = BytesIO()
BytesIOObj.write(response)
img = Image.open(BytesIOObj)
img.show()

 

转载地址:https://www.cnblogs.com/Summer-skr--blog/p/11664212.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM