Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

To report sensitive vulnerability information, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

If your organisation/employer is a distributor of Pillow and would like advance notification of security-related bugs, please let us know your preferred contact method.
If your organization/employer is a distributor of Pillow and would like advance notification of security-related bugs, please let us know your preferred contact method.
6 changes: 3 additions & 3 deletions docs/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Image.Image.get_child_images()

.. deprecated:: 11.2.1

``Image.Image.get_child_images()`` has been deprecated. and will be removed in Pillow
``Image.Image.get_child_images()`` has been deprecated and will be removed in Pillow
13 (2026-10-15). It will be moved to ``ImageFile.ImageFile.get_child_images()``. The
method uses an image's file pointer, and so child images could only be retrieved from
an :py:class:`PIL.ImageFile.ImageFile` instance.
Expand Down Expand Up @@ -543,7 +543,7 @@ Image._showxv
.. deprecated:: 7.2.0
.. versionremoved:: 9.0.0

Use :py:meth:`.Image.Image.show` instead. If custom behaviour is required, use
Use :py:meth:`.Image.Image.show` instead. If custom behavior is required, use
:py:func:`.ImageShow.register` to add a custom :py:class:`.ImageShow.Viewer` class.

ImageFile.raise_ioerror
Expand Down Expand Up @@ -681,7 +681,7 @@ PyQt4 and PySide
Qt 4 reached end-of-life on 2015-12-19. Its Python bindings are also EOL: PyQt4 since
2018-08-31 and PySide since 2015-10-14.

Support for PyQt4 and PySide has been removed from ``ImageQt``. Please upgrade to PyQt5
Support for PyQt4 and PySide has been removed from ``ImageQt``. Please upgrade to PyQt5
or PySide2.

Setting the size of TIFF images
Expand Down
8 changes: 4 additions & 4 deletions docs/handbook/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ pixel, the Python Imaging Library provides different resampling *filters*.
.. data:: Resampling.BOX
:noindex:

Each pixel of source image contributes to one pixel of the
Each pixel of the source image contributes to one pixel of the
destination image with identical weights.
For upscaling is equivalent of :data:`Resampling.NEAREST`.
For upscaling, it is equivalent to :data:`Resampling.NEAREST`.
This filter can only be used with the :py:meth:`~PIL.Image.Image.resize`
and :py:meth:`~PIL.Image.Image.thumbnail` methods.

Expand All @@ -184,7 +184,7 @@ pixel, the Python Imaging Library provides different resampling *filters*.
.. data:: Resampling.BILINEAR
:noindex:

For resize calculate the output pixel value using linear interpolation
For resize, calculates the output pixel value using linear interpolation
on all pixels that may contribute to the output value.
For other transformations linear interpolation over a 2x2 environment
in the input image is used.
Expand All @@ -202,7 +202,7 @@ pixel, the Python Imaging Library provides different resampling *filters*.
.. data:: Resampling.BICUBIC
:noindex:

For resize calculate the output pixel value using cubic interpolation
For resize, calculates the output pixel value using cubic interpolation
on all pixels that may contribute to the output value.
For other transformations cubic interpolation over a 4x4 environment
in the input image is used.
Expand Down
14 changes: 7 additions & 7 deletions docs/handbook/image-file-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Loading
~~~~~~~

To use Ghostscript, Pillow searches for the "gs" executable. On Windows, it
also searches for "gswin32c" and "gswin64c". To customise this behaviour,
also searches for "gswin32c" and "gswin64c". To customize this behavior,
``EpsImagePlugin.gs_binary = "gswin64"`` will set the name of the executable to
use. ``EpsImagePlugin.gs_binary = False`` will prevent Ghostscript use.

Expand All @@ -219,7 +219,7 @@ method with the following parameters to affect how Ghostscript renders the EPS.

**transparency**
If true, generates an RGBA image with a transparent background, instead of
the default behaviour of an RGB image with a white background.
the default behavior of an RGB image with a white background.


GIF
Expand All @@ -236,7 +236,7 @@ images. Seeking to later frames in a ``P`` image will change the image to
``P`` mode images are changed to ``RGB`` because each frame of a GIF may contain
its own individual palette of up to 256 colors. When a new frame is placed onto a
previous frame, those colors may combine to exceed the ``P`` mode limit of 256
colors. Instead, the image is converted to ``RGB`` handle this.
colors. Instead, the image is converted to ``RGB`` to handle this.

If you would prefer the first ``P`` image frame to be ``RGB`` as well, so that
every ``P`` frame is converted to ``RGB`` or ``RGBA`` mode, there is a setting
Expand Down Expand Up @@ -345,7 +345,7 @@ following options are available::
**palette**
Use the specified palette for the saved image. The palette should
be a bytes or bytearray object containing the palette entries in
RGBRGB... form. It should be no more than 768 bytes. Alternately,
RGBRGB... form. It should be no more than 768 bytes. Alternatively,
the palette can be passed in as an
:py:class:`PIL.ImagePalette.ImagePalette` object.

Expand Down Expand Up @@ -449,7 +449,7 @@ Saving
The :py:meth:`~PIL.Image.Image.save` method supports the following options:

**sizes**
A list of sizes including in this ico file; these are a 2-tuple,
A list of sizes included in this ico file; these are a 2-tuple,
``(width, height)``; Default to ``[(16, 16), (24, 24), (32, 32), (48, 48),
(64, 64), (128, 128), (256, 256)]``. Any sizes bigger than the original
size or 256 will be ignored.
Expand Down Expand Up @@ -1309,7 +1309,7 @@ The :py:meth:`~PIL.Image.Image.save` method can take the following keyword argum
.. versionadded:: 6.1.0

Added support for signed types (e.g. ``TIFF_SIGNED_LONG``) and multiple values.
Multiple values for a single tag must be to
Multiple values for a single tag must be passed to
:py:class:`~PIL.TiffImagePlugin.ImageFileDirectory_v2` as a tuple and
require a matching type in
:py:attr:`~PIL.TiffImagePlugin.ImageFileDirectory_v2.tagtype` tagtype.
Expand Down Expand Up @@ -1445,7 +1445,7 @@ will be saved, and the following options will also be available.
**kmin, kmax**
Minimum and maximum distance between consecutive key frames in
the output. The library may insert some key frames as needed
to satisfy this criteria. Note that these conditions should
to satisfy these criteria. Note that these conditions should
hold: kmax > kmin and kmin >= kmax / 2 + 1. Also, if kmax <= 0,
then key-frame insertion is disabled; and if kmax == 1, then all
frames will be key-frames (kmin value does not matter for these
Expand Down
2 changes: 1 addition & 1 deletion docs/handbook/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ disk, and calls an external display utility.
Image processing
----------------

The library contains basic image processing functionality, including point operations, filtering with a set of built-in convolution kernels, and colour space conversions.
The library contains basic image processing functionality, including point operations, filtering with a set of built-in convolution kernels, and color space conversions.

The library also supports image resizing, rotation and arbitrary affine transforms.

Expand Down
4 changes: 2 additions & 2 deletions docs/handbook/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ RGBA image and also using it as the mask would paste the opaque portion
of the image but not its transparent background.

The Python Imaging Library also allows you to work with the individual bands of
an multi-band image, such as an RGB image. The split method creates a set of
a multi-band image, such as an RGB image. The split method creates a set of
new images, each containing one band from the original multi-band image. The
merge function takes a mode and a tuple of images, and combines them into a new
image. The following sample swaps the three bands of an RGB image:
Expand Down Expand Up @@ -736,7 +736,7 @@ speed is usually more important than quality) and printing to a monochrome
laser printer (when only a grayscale version of the image is needed).

The :py:meth:`~PIL.Image.Image.draft` method manipulates an opened but not yet
loaded image so it as closely as possible matches the given mode and size. This
loaded image so that it matches the given mode and size as closely as possible. This
is done by reconfiguring the image decoder.

Reading in draft mode
Expand Down
16 changes: 8 additions & 8 deletions docs/handbook/writing-your-own-image-plugin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Pillow decodes files in two stages:

An image plugin should contain a format handler derived from the
:py:class:`PIL.ImageFile.ImageFile` base class. This class should provide an
``_open`` method, which reads the file header and set at least the internal
``_open`` method, which reads the file header and sets at least the internal
``_size`` and ``_mode`` attributes so that :py:attr:`~PIL.Image.Image.mode` and
:py:attr:`~PIL.Image.Image.size` are populated. To be able to load the file,
the method must also create a list of ``tile`` descriptors, which contain a
Expand Down Expand Up @@ -217,14 +217,14 @@ table describes some commonly used **raw modes**:
+-----------+-------------------------------------------------------------------+
| ``P`` | 8-bit palette-mapped image. |
+-----------+-------------------------------------------------------------------+
| ``RGB`` | 24-bit true colour, stored as (red, green, blue). |
| ``RGB`` | 24-bit true color, stored as (red, green, blue). |
+-----------+-------------------------------------------------------------------+
| ``BGR`` | 24-bit true colour, stored as (blue, green, red). |
| ``BGR`` | 24-bit true color, stored as (blue, green, red). |
+-----------+-------------------------------------------------------------------+
| ``RGBX`` | | 24-bit true colour, stored as (red, green, blue, pad). The pad |
| ``RGBX`` | | 24-bit true color, stored as (red, green, blue, pad). The pad |
| | | pixels may vary. |
+-----------+-------------------------------------------------------------------+
| ``RGB;L`` | | 24-bit true colour, line interleaved (first all red pixels, then|
| ``RGB;L`` | | 24-bit true color, line interleaved (first all red pixels, then |
| | | all green pixels, finally all blue pixels). |
+-----------+-------------------------------------------------------------------+

Expand Down Expand Up @@ -393,7 +393,7 @@ state structure, and a buffer of data to be transformed.
It is the codec's responsibility to pull as much data as possible out of the
buffer and return the number of bytes consumed. The next call to the codec will
include the previous unconsumed tail. The codec function will be called
multiple times as the data processed.
multiple times as the data is processed.

Alternatively, if ``pulls_fd`` or ``pushes_fd`` is set, then the decode or
encode function is called once, with an empty buffer. It is the codec's
Expand Down Expand Up @@ -436,7 +436,7 @@ Python-based file codec:
``_pushes_fd`` property) is set to ``True``, then ``decode`` and ``encode``
will only be called once. In the decoder, ``self.fd`` can be used to access
the file-like object. Using this will provide a codec with more freedom, but
that freedom may mean increased memory usage if entire file is held in
that freedom may mean increased memory usage if the entire file is held in
memory at once by the codec.

In ``decode``, once the data has been interpreted, ``set_as_raw`` can be
Expand All @@ -446,7 +446,7 @@ Python-based file codec:
is complete. This can be used to clean up any resources used by the codec.

If you set ``_pulls_fd`` or ``_pushes_fd`` to ``True`` however, then you
probably chose to perform any cleanup tasks at the end of ``decode`` or
probably chose to perform any cleanup tasks at the end of ``decode`` or
``encode``.

For an example :py:class:`PIL.ImageFile.PyDecoder`, see `DdsImagePlugin
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ExifTags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ EXIF tags.
>>> IFD.Exif.value
34665
>>> IFD(34665).name
'Exif
'Exif'

.. py:data:: LightSource

Expand Down
14 changes: 7 additions & 7 deletions docs/reference/Image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ This resizes the given image from ``(width, height)`` to ``(width/2, height/2)``

.. automethod:: PIL.Image.Image.rotate

This rotates the input image by ``theta`` degrees counter clockwise::
This rotates the input image by ``theta`` degrees counterclockwise::

from PIL import Image

with Image.open("hopper.jpg") as im:

# Rotate the image by 60 degrees counter clockwise
# Rotate the image by 60 degrees counterclockwise
theta = 60
# Angle is in degrees counter clockwise
# Angle is in degrees counterclockwise
im_rotated = im.rotate(angle=theta)

.. automethod:: PIL.Image.Image.save
Expand Down Expand Up @@ -272,7 +272,7 @@ Instances of the :py:class:`Image` class have the following attributes:

The filename or path of the source file. Only images created with the
factory function ``open`` have a filename attribute. If the input is a
file like object, the filename attribute is set to an empty string.
file-like object, the filename attribute is set to an empty string.

.. py:attribute:: Image.format
:type: Optional[str]
Expand Down Expand Up @@ -306,7 +306,7 @@ Instances of the :py:class:`Image` class have the following attributes:
.. py:attribute:: Image.palette
:type: Optional[PIL.ImagePalette.ImagePalette]

Colour palette table, if any. If mode is "P" or "PA", this should be an
Color palette table, if any. If mode is "P" or "PA", this should be an
instance of the :py:class:`~PIL.ImagePalette.ImagePalette` class.
Otherwise, it should be set to :data:`None`.

Expand All @@ -333,7 +333,7 @@ Instances of the :py:class:`Image` class have the following attributes:
Plugins may leave this attribute undefined if they don't support loading
animated images, even if the given format supports animated images.

Given that this attribute is not present for all images use
Given that this attribute is not present for all images, use
``getattr(image, "is_animated", False)`` to check if Pillow is aware of multiple
frames in an image regardless of its format.

Expand All @@ -348,7 +348,7 @@ Instances of the :py:class:`Image` class have the following attributes:
Plugins may leave this attribute undefined if they don't support loading
animated images, even if the given format supports animated images.

Given that this attribute is not present for all images use
Given that this attribute is not present for all images, use
``getattr(image, "n_frames", 1)`` to check the number of frames that Pillow is
aware of in an image regardless of its format.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ImageChops.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ At this time, most channel operations are only implemented for 8-bit images
Functions
---------

Most channel operations take one or two image arguments and returns a new
Most channel operations take one or two image arguments and return a new
image. Unless otherwise noted, the result of a channel operation is always
clipped to the range 0 to MAX (which is 255 for all modes supported by the
operations in this module).
Expand Down
10 changes: 5 additions & 5 deletions docs/reference/ImageCms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ can be easily displayed in a chromaticity diagram, for example).

The value is in the format ``((x, y, Y), (x, y, Y), (x, y, Y))``, if available.

.. py:attribute:: chromatic_adaption
.. py:attribute:: chromatic_adaptation
:type: tuple[tuple[tuple[float, float, float], tuple[float, float, float], tuple[float, float, float]], tuple[tuple[float, float, float], tuple[float, float, float], tuple[float, float, float]]] | None

The chromatic adaption matrix converts a color measured using the
The chromatic adaptation matrix converts a color measured using the
actual illumination conditions and relative to the actual adopted
white, to a color relative to the PCS adopted white, with
complete adaptation from the actual adopted white chromaticity to
Expand Down Expand Up @@ -316,21 +316,21 @@ can be easily displayed in a chromaticity diagram, for example).
.. py:attribute:: red_primary
:type: tuple[tuple[float, float, float], tuple[float, float, float]] | None

The XYZ-transformed of the RGB primary color red (1, 0, 0).
The XYZ-transform of the RGB primary color red (1, 0, 0).

The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.

.. py:attribute:: green_primary
:type: tuple[tuple[float, float, float], tuple[float, float, float]] | None

The XYZ-transformed of the RGB primary color green (0, 1, 0).
The XYZ-transform of the RGB primary color green (0, 1, 0).

The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.

.. py:attribute:: blue_primary
:type: tuple[tuple[float, float, float], tuple[float, float, float]] | None

The XYZ-transformed of the RGB primary color blue (0, 0, 1).
The XYZ-transform of the RGB primary color blue (0, 0, 1).

The value is in the format ``((X, Y, Z), (x, y, Y))``, if available.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ImageColor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The ImageColor module supports the following string formats:

* Common HTML color names. The :py:mod:`~PIL.ImageColor` module provides some
140 standard color names, based on the colors supported by the X Window
system and most web browsers. color names are case insensitive. For example,
system and most web browsers. Color names are case insensitive. For example,
``red`` and ``Red`` both specify pure red.

Functions
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/ImageDraw.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ contains font metrics, the latter raster data.
To load a bitmap font, use the load functions in the :py:mod:`~PIL.ImageFont`
module.

To load a OpenType/TrueType font, use the truetype function in the
To load an OpenType/TrueType font, use the truetype function in the
:py:mod:`~PIL.ImageFont` module. Note that this function depends on third-party
libraries, and may not available in all PIL builds.
libraries, and may not be available in all PIL builds.

Example: Draw partial opacity text
----------------------------------
Expand Down Expand Up @@ -264,7 +264,7 @@ Methods

.. py:method:: ImageDraw.circle(xy, radius, fill=None, outline=None, width=1)

Draws a circle with a given radius centering on a point.
Draws a circle with a given radius centered on a point.

.. versionadded:: 10.4.0

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ImageEnhance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ method:

Adjust image color balance.

This class can be used to adjust the colour balance of an image, in a
manner similar to the controls on a colour TV set. An
This class can be used to adjust the color balance of an image, in a
manner similar to the controls on a color TV set. An
:ref:`enhancement factor <enhancement-factor>` of 0.0 gives a black and
white image. A factor of 1.0 gives the original image.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ImageFilter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=================================

The :py:mod:`~PIL.ImageFilter` module contains definitions for a pre-defined set of
filters, which can be be used with the :py:meth:`Image.filter()
filters, which can be used with the :py:meth:`Image.filter()
<PIL.Image.Image.filter>` method.

Example: Filter an image
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/ImageGrab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ or the clipboard to a PIL image memory.

On Linux, if ``xdisplay`` is ``None`` and the default X11 display does not return
a snapshot of the screen, ``gnome-screenshot``, ``grim`` or ``spectacle`` will be
used as a fallback if they are installed. To disable this behaviour, pass
used as a fallback if they are installed. To disable this behavior, pass
``xdisplay=""`` instead.

.. versionadded:: 1.1.3 Windows support
Expand Down Expand Up @@ -65,7 +65,7 @@ or the clipboard to a PIL image memory.
or None if the clipboard does not contain image data or filenames.
Note that if a list is returned, the filenames may not represent image files.

On Mac, an image,
On macOS, an image,
or None if the clipboard does not contain image data.

On Linux, an image.
2 changes: 1 addition & 1 deletion docs/reference/ImageMorph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ applied to 1 or L mode images::

.. _morphology: https://en.wikipedia.org/wiki/Mathematical_morphology

In addition to applying operators, you can also analyse images.
In addition to applying operators, you can also analyze images.

You can inspect an image in isolation to determine which pixels are non-empty::

Expand Down
Loading
Loading