Skip to content

Commit 5103075

Browse files
authored
Merge pull request python-pillow#4737 from nulano/refs-image
Fix documentation references: omitted Image functions
2 parents 4ae694c + 4f1ee7a commit 5103075

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

docs/handbook/image-file-formats.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Over 30 different file formats can be identified and read by the library.
88
Write support is less extensive, but most common interchange and presentation
99
formats are supported.
1010

11-
The :py:meth:`~PIL.Image.Image.open` function identifies files from their
11+
The :py:meth:`~PIL.Image.open` function identifies files from their
1212
contents, not their names, but the :py:meth:`~PIL.Image.Image.save` method
1313
looks at the name to determine which format to use, unless the format is given
1414
explicitly.
@@ -25,7 +25,7 @@ Pillow reads and writes Windows and OS/2 BMP files containing ``1``, ``L``, ``P`
2525
or ``RGB`` data. 16-colour images are read as ``P`` images. Run-length encoding
2626
is not supported.
2727

28-
The :py:meth:`~PIL.Image.Image.open` method sets the following
28+
The :py:meth:`~PIL.Image.open` method sets the following
2929
:py:attr:`~PIL.Image.Image.info` properties:
3030

3131
**compression**
@@ -74,7 +74,7 @@ are used or GIF89a is already in use.
7474
Note that GIF files are always read as grayscale (``L``)
7575
or palette mode (``P``) images.
7676

77-
The :py:meth:`~PIL.Image.Image.open` method sets the following
77+
The :py:meth:`~PIL.Image.open` method sets the following
7878
:py:attr:`~PIL.Image.Image.info` properties:
7979

8080
**background**
@@ -203,7 +203,7 @@ ICNS
203203
Pillow reads and (macOS only) writes macOS ``.icns`` files. By default, the
204204
largest available icon is read, though you can override this by setting the
205205
:py:attr:`~PIL.Image.Image.size` property before calling
206-
:py:meth:`~PIL.Image.Image.load`. The :py:meth:`~PIL.Image.Image.open` method
206+
:py:meth:`~PIL.Image.Image.load`. The :py:meth:`~PIL.Image.open` method
207207
sets the following :py:attr:`~PIL.Image.Image.info` property:
208208

209209
**sizes**
@@ -257,7 +257,7 @@ Using the :py:meth:`~PIL.Image.Image.draft` method, you can speed things up by
257257
converting ``RGB`` images to ``L``, and resize images to 1/2, 1/4 or 1/8 of
258258
their original size while loading them.
259259

260-
The :py:meth:`~PIL.Image.Image.open` method may set the following
260+
The :py:meth:`~PIL.Image.open` method may set the following
261261
:py:attr:`~PIL.Image.Image.info` properties if available:
262262

263263
**jfif**
@@ -697,7 +697,7 @@ Pillow also reads SPIDER stack files containing sequences of SPIDER images. The
697697
:py:meth:`~PIL.Image.Image.seek` and :py:meth:`~PIL.Image.Image.tell` methods are supported, and
698698
random access is allowed.
699699

700-
The :py:meth:`~PIL.Image.Image.open` method sets the following attributes:
700+
The :py:meth:`~PIL.Image.open` method sets the following attributes:
701701

702702
**format**
703703
Set to ``SPIDER``
@@ -750,7 +750,7 @@ uncompressed files.
750750
support for reading Packbits, LZW and JPEG compressed TIFFs
751751
without using libtiff.
752752

753-
The :py:meth:`~PIL.Image.Image.open` method sets the following
753+
The :py:meth:`~PIL.Image.open` method sets the following
754754
:py:attr:`~PIL.Image.Image.info` properties:
755755

756756
**compression**
@@ -1021,7 +1021,7 @@ FLI, FLC
10211021

10221022
Pillow reads Autodesk FLI and FLC animations.
10231023

1024-
The :py:meth:`~PIL.Image.Image.open` method sets the following
1024+
The :py:meth:`~PIL.Image.open` method sets the following
10251025
:py:attr:`~PIL.Image.Image.info` properties:
10261026

10271027
**duration**
@@ -1054,7 +1054,7 @@ GBR
10541054

10551055
The GBR decoder reads GIMP brush files, version 1 and 2.
10561056

1057-
The :py:meth:`~PIL.Image.Image.open` method sets the following
1057+
The :py:meth:`~PIL.Image.open` method sets the following
10581058
:py:attr:`~PIL.Image.Image.info` properties:
10591059

10601060
**comment**
@@ -1069,7 +1069,7 @@ GD
10691069
Pillow reads uncompressed GD2 files. Note that you must use
10701070
:py:func:`PIL.GdImageFile.open` to read such a file.
10711071

1072-
The :py:meth:`~PIL.Image.Image.open` method sets the following
1072+
The :py:meth:`~PIL.Image.open` method sets the following
10731073
:py:attr:`~PIL.Image.Image.info` properties:
10741074

10751075
**transparency**
@@ -1185,7 +1185,7 @@ XPM
11851185

11861186
Pillow reads X pixmap files (mode ``P``) with 256 colors or less.
11871187

1188-
The :py:meth:`~PIL.Image.Image.open` method sets the following
1188+
The :py:meth:`~PIL.Image.open` method sets the following
11891189
:py:attr:`~PIL.Image.Image.info` properties:
11901190

11911191
**transparency**

docs/reference/Image.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,16 @@ Constructing images
7676
.. autofunction:: new
7777
.. autofunction:: fromarray
7878
.. autofunction:: frombytes
79-
.. autofunction:: fromstring
8079
.. autofunction:: frombuffer
8180

81+
Generating images
82+
^^^^^^^^^^^^^^^^^
83+
84+
.. autofunction:: effect_mandelbrot
85+
.. autofunction:: effect_noise
86+
.. autofunction:: linear_gradient
87+
.. autofunction:: radial_gradient
88+
8289
Registering plugins
8390
^^^^^^^^^^^^^^^^^^^
8491

@@ -88,12 +95,14 @@ Registering plugins
8895
ignore them.
8996

9097
.. autofunction:: register_open
91-
.. autofunction:: register_decoder
9298
.. autofunction:: register_mime
9399
.. autofunction:: register_save
94-
.. autofunction:: register_encoder
100+
.. autofunction:: register_save_all
95101
.. autofunction:: register_extension
96-
102+
.. autofunction:: register_extensions
103+
.. autofunction:: registered_extensions
104+
.. autofunction:: register_decoder
105+
.. autofunction:: register_encoder
97106

98107
The Image Class
99108
---------------
@@ -140,6 +149,8 @@ This crops the input image with the provided coordinates:
140149
141150
142151
.. automethod:: PIL.Image.Image.draft
152+
.. automethod:: PIL.Image.Image.effect_spread
153+
.. automethod:: PIL.Image.Image.entropy
143154
.. automethod:: PIL.Image.Image.filter
144155

145156
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:
176187
print(im.getbbox())
177188
# Returns four coordinates in the format (left, upper, right, lower)
178189
190+
.. automethod:: PIL.Image.Image.getchannel
179191
.. automethod:: PIL.Image.Image.getcolors
180192
.. automethod:: PIL.Image.Image.getdata
181-
.. automethod:: PIL.Image.Image.getextrema
182193
.. automethod:: PIL.Image.Image.getexif
194+
.. automethod:: PIL.Image.Image.getextrema
183195
.. automethod:: PIL.Image.Image.getpalette
184196
.. automethod:: PIL.Image.Image.getpixel
197+
.. automethod:: PIL.Image.Image.getprojection
185198
.. automethod:: PIL.Image.Image.histogram
186199
.. automethod:: PIL.Image.Image.offset
187200
.. automethod:: PIL.Image.Image.paste
@@ -191,6 +204,8 @@ This helps to get the bounding box coordinates of the input image:
191204
.. automethod:: PIL.Image.Image.putpalette
192205
.. automethod:: PIL.Image.Image.putpixel
193206
.. automethod:: PIL.Image.Image.quantize
207+
.. automethod:: PIL.Image.Image.reduce
208+
.. automethod:: PIL.Image.Image.remap_palette
194209
.. automethod:: PIL.Image.Image.resize
195210

196211
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)``
205220
(width, height) = (im.width // 2, im.height // 2)
206221
im_resized = im.resize((width, height))
207222
208-
.. automethod:: PIL.Image.Image.remap_palette
209223
.. automethod:: PIL.Image.Image.rotate
210224

211225
This rotates the input image by ``theta`` degrees counter clockwise:
@@ -225,7 +239,6 @@ This rotates the input image by ``theta`` degrees counter clockwise:
225239
.. automethod:: PIL.Image.Image.seek
226240
.. automethod:: PIL.Image.Image.show
227241
.. automethod:: PIL.Image.Image.split
228-
.. automethod:: PIL.Image.Image.getchannel
229242
.. automethod:: PIL.Image.Image.tell
230243
.. automethod:: PIL.Image.Image.thumbnail
231244
.. automethod:: PIL.Image.Image.tobitmap

src/PIL/ImageDraw2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def arc(self, xy, start, end, *options):
106106

107107
def chord(self, xy, start, end, *options):
108108
"""
109-
Same as :py:meth:`~PIL.ImageDraw2.ImageDraw.arc`, but connects the end points
109+
Same as :py:meth:`~PIL.ImageDraw2.Draw.arc`, but connects the end points
110110
with a straight line.
111111
112112
.. seealso:: :py:meth:`PIL.ImageDraw.ImageDraw.chord`

0 commit comments

Comments
 (0)