공부
[Python] url to image
승가비
2021. 1. 14. 06:48
728x90
pip3 install requests
pip3 install Pillow
from PIL import Image
import requests
import time
file = Image.open(requests.get(image, stream=True).raw)
filename = time.time() + '.png'
file.save(filename)
https://stackoverflow.com/questions/7391945/how-do-i-read-image-data-from-a-url-in-python
How do I read image data from a URL in Python?
What I'm trying to do is fairly simple when we're dealing with a local file, but the problem comes when I try to do this with a remote URL. Basically, I'm trying to create a PIL image object from ...
stackoverflow.com
728x90