Skip to content

Commit

Permalink
Merge pull request #6215 from kolibril13/readURL
Browse files Browse the repository at this point in the history
Add example to read image from URL
  • Loading branch information
radarhere committed Apr 18, 2022
2 parents a33dc56 + f9bf1cd commit 46ba6b5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/handbook/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,17 @@ image header. In addition, seek will also be used when the image data is read
tar file, you can use the :py:class:`~PIL.ContainerIO` or
:py:class:`~PIL.TarIO` modules to access it.

Reading from URL
^^^^^^^^^^^^^^^^

::

from PIL import Image
from urllib.request import urlopen
url = "https://python-pillow.org/images/pillow-logo.png"
img = Image.open(urlopen(url))


Reading from a tar archive
^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 46ba6b5

Please sign in to comment.