Merge pull request #4737 from nulano/refs-image

Fix documentation references: omitted Image functions
This commit is contained in:
Andrew Murray 2020-06-28 15:43:22 +10:00 committed by GitHub
commit 510307532e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 19 deletions

View File

@ -8,7 +8,7 @@ Over 30 different file formats can be identified and read by the library.
Write support is less extensive, but most common interchange and presentation Write support is less extensive, but most common interchange and presentation
formats are supported. formats are supported.
The :py:meth:`~PIL.Image.Image.open` function identifies files from their The :py:meth:`~PIL.Image.open` function identifies files from their
contents, not their names, but the :py:meth:`~PIL.Image.Image.save` method contents, not their names, but the :py:meth:`~PIL.Image.Image.save` method
looks at the name to determine which format to use, unless the format is given looks at the name to determine which format to use, unless the format is given
explicitly. explicitly.
@ -25,7 +25,7 @@ Pillow reads and writes Windows and OS/2 BMP files containing ``1``, ``L``, ``P`
or ``RGB`` data. 16-colour images are read as ``P`` images. Run-length encoding or ``RGB`` data. 16-colour images are read as ``P`` images. Run-length encoding
is not supported. is not supported.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**compression** **compression**
@ -74,7 +74,7 @@ are used or GIF89a is already in use.
Note that GIF files are always read as grayscale (``L``) Note that GIF files are always read as grayscale (``L``)
or palette mode (``P``) images. or palette mode (``P``) images.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**background** **background**
@ -203,7 +203,7 @@ ICNS
Pillow reads and (macOS only) writes macOS ``.icns`` files. By default, the Pillow reads and (macOS only) writes macOS ``.icns`` files. By default, the
largest available icon is read, though you can override this by setting the largest available icon is read, though you can override this by setting the
:py:attr:`~PIL.Image.Image.size` property before calling :py:attr:`~PIL.Image.Image.size` property before calling
:py:meth:`~PIL.Image.Image.load`. The :py:meth:`~PIL.Image.Image.open` method :py:meth:`~PIL.Image.Image.load`. The :py:meth:`~PIL.Image.open` method
sets the following :py:attr:`~PIL.Image.Image.info` property: sets the following :py:attr:`~PIL.Image.Image.info` property:
**sizes** **sizes**
@ -257,7 +257,7 @@ Using the :py:meth:`~PIL.Image.Image.draft` method, you can speed things up by
converting ``RGB`` images to ``L``, and resize images to 1/2, 1/4 or 1/8 of converting ``RGB`` images to ``L``, and resize images to 1/2, 1/4 or 1/8 of
their original size while loading them. their original size while loading them.
The :py:meth:`~PIL.Image.Image.open` method may set the following The :py:meth:`~PIL.Image.open` method may set the following
:py:attr:`~PIL.Image.Image.info` properties if available: :py:attr:`~PIL.Image.Image.info` properties if available:
**jfif** **jfif**
@ -697,7 +697,7 @@ Pillow also reads SPIDER stack files containing sequences of SPIDER images. The
:py:meth:`~PIL.Image.Image.seek` and :py:meth:`~PIL.Image.Image.tell` methods are supported, and :py:meth:`~PIL.Image.Image.seek` and :py:meth:`~PIL.Image.Image.tell` methods are supported, and
random access is allowed. random access is allowed.
The :py:meth:`~PIL.Image.Image.open` method sets the following attributes: The :py:meth:`~PIL.Image.open` method sets the following attributes:
**format** **format**
Set to ``SPIDER`` Set to ``SPIDER``
@ -750,7 +750,7 @@ uncompressed files.
support for reading Packbits, LZW and JPEG compressed TIFFs support for reading Packbits, LZW and JPEG compressed TIFFs
without using libtiff. without using libtiff.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**compression** **compression**
@ -1021,7 +1021,7 @@ FLI, FLC
Pillow reads Autodesk FLI and FLC animations. Pillow reads Autodesk FLI and FLC animations.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**duration** **duration**
@ -1054,7 +1054,7 @@ GBR
The GBR decoder reads GIMP brush files, version 1 and 2. The GBR decoder reads GIMP brush files, version 1 and 2.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**comment** **comment**
@ -1069,7 +1069,7 @@ GD
Pillow reads uncompressed GD2 files. Note that you must use Pillow reads uncompressed GD2 files. Note that you must use
:py:func:`PIL.GdImageFile.open` to read such a file. :py:func:`PIL.GdImageFile.open` to read such a file.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**transparency** **transparency**
@ -1185,7 +1185,7 @@ XPM
Pillow reads X pixmap files (mode ``P``) with 256 colors or less. Pillow reads X pixmap files (mode ``P``) with 256 colors or less.
The :py:meth:`~PIL.Image.Image.open` method sets the following The :py:meth:`~PIL.Image.open` method sets the following
:py:attr:`~PIL.Image.Image.info` properties: :py:attr:`~PIL.Image.Image.info` properties:
**transparency** **transparency**

View File

@ -76,9 +76,16 @@ Constructing images
.. autofunction:: new .. autofunction:: new
.. autofunction:: fromarray .. autofunction:: fromarray
.. autofunction:: frombytes .. autofunction:: frombytes
.. autofunction:: fromstring
.. autofunction:: frombuffer .. autofunction:: frombuffer
Generating images
^^^^^^^^^^^^^^^^^
.. autofunction:: effect_mandelbrot
.. autofunction:: effect_noise
.. autofunction:: linear_gradient
.. autofunction:: radial_gradient
Registering plugins Registering plugins
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
@ -88,12 +95,14 @@ Registering plugins
ignore them. ignore them.
.. autofunction:: register_open .. autofunction:: register_open
.. autofunction:: register_decoder
.. autofunction:: register_mime .. autofunction:: register_mime
.. autofunction:: register_save .. autofunction:: register_save
.. autofunction:: register_encoder .. autofunction:: register_save_all
.. autofunction:: register_extension .. autofunction:: register_extension
.. autofunction:: register_extensions
.. autofunction:: registered_extensions
.. autofunction:: register_decoder
.. autofunction:: register_encoder
The Image Class The Image Class
--------------- ---------------
@ -140,6 +149,8 @@ This crops the input image with the provided coordinates:
.. automethod:: PIL.Image.Image.draft .. automethod:: PIL.Image.Image.draft
.. automethod:: PIL.Image.Image.effect_spread
.. automethod:: PIL.Image.Image.entropy
.. automethod:: PIL.Image.Image.filter .. automethod:: PIL.Image.Image.filter
This blurs the input image using a filter from the ``ImageFilter`` module: This blurs the input image using a filter from the ``ImageFilter`` module:
@ -176,12 +187,14 @@ This helps to get the bounding box coordinates of the input image:
print(im.getbbox()) print(im.getbbox())
# Returns four coordinates in the format (left, upper, right, lower) # Returns four coordinates in the format (left, upper, right, lower)
.. automethod:: PIL.Image.Image.getchannel
.. automethod:: PIL.Image.Image.getcolors .. automethod:: PIL.Image.Image.getcolors
.. automethod:: PIL.Image.Image.getdata .. automethod:: PIL.Image.Image.getdata
.. automethod:: PIL.Image.Image.getextrema
.. automethod:: PIL.Image.Image.getexif .. automethod:: PIL.Image.Image.getexif
.. automethod:: PIL.Image.Image.getextrema
.. automethod:: PIL.Image.Image.getpalette .. automethod:: PIL.Image.Image.getpalette
.. automethod:: PIL.Image.Image.getpixel .. automethod:: PIL.Image.Image.getpixel
.. automethod:: PIL.Image.Image.getprojection
.. automethod:: PIL.Image.Image.histogram .. automethod:: PIL.Image.Image.histogram
.. automethod:: PIL.Image.Image.offset .. automethod:: PIL.Image.Image.offset
.. automethod:: PIL.Image.Image.paste .. automethod:: PIL.Image.Image.paste
@ -191,6 +204,8 @@ This helps to get the bounding box coordinates of the input image:
.. automethod:: PIL.Image.Image.putpalette .. automethod:: PIL.Image.Image.putpalette
.. automethod:: PIL.Image.Image.putpixel .. automethod:: PIL.Image.Image.putpixel
.. automethod:: PIL.Image.Image.quantize .. automethod:: PIL.Image.Image.quantize
.. automethod:: PIL.Image.Image.reduce
.. automethod:: PIL.Image.Image.remap_palette
.. automethod:: PIL.Image.Image.resize .. automethod:: PIL.Image.Image.resize
This resizes the given image from ``(width, height)`` to ``(width/2, height/2)``: This resizes the given image from ``(width, height)`` to ``(width/2, height/2)``:
@ -205,7 +220,6 @@ This resizes the given image from ``(width, height)`` to ``(width/2, height/2)``
(width, height) = (im.width // 2, im.height // 2) (width, height) = (im.width // 2, im.height // 2)
im_resized = im.resize((width, height)) im_resized = im.resize((width, height))
.. automethod:: PIL.Image.Image.remap_palette
.. automethod:: PIL.Image.Image.rotate .. automethod:: PIL.Image.Image.rotate
This rotates the input image by ``theta`` degrees counter clockwise: This rotates the input image by ``theta`` degrees counter clockwise:
@ -225,7 +239,6 @@ This rotates the input image by ``theta`` degrees counter clockwise:
.. automethod:: PIL.Image.Image.seek .. automethod:: PIL.Image.Image.seek
.. automethod:: PIL.Image.Image.show .. automethod:: PIL.Image.Image.show
.. automethod:: PIL.Image.Image.split .. automethod:: PIL.Image.Image.split
.. automethod:: PIL.Image.Image.getchannel
.. automethod:: PIL.Image.Image.tell .. automethod:: PIL.Image.Image.tell
.. automethod:: PIL.Image.Image.thumbnail .. automethod:: PIL.Image.Image.thumbnail
.. automethod:: PIL.Image.Image.tobitmap .. automethod:: PIL.Image.Image.tobitmap

View File

@ -106,7 +106,7 @@ class Draw:
def chord(self, xy, start, end, *options): def chord(self, xy, start, end, *options):
""" """
Same as :py:meth:`~PIL.ImageDraw2.ImageDraw.arc`, but connects the end points Same as :py:meth:`~PIL.ImageDraw2.Draw.arc`, but connects the end points
with a straight line. with a straight line.
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.chord` .. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.chord`