Skip to content
Merged
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
6 changes: 3 additions & 3 deletions docs/handbook/image-file-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,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 @@ -346,7 +346,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 @@ -1307,7 +1307,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
10 changes: 5 additions & 5 deletions docs/handbook/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ 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
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
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:

Splitting and merging bands
Expand All @@ -259,15 +259,15 @@ Geometrical transforms
The :py:class:`PIL.Image.Image` class contains methods to
:py:meth:`~PIL.Image.Image.resize` and :py:meth:`~PIL.Image.Image.rotate` an
image. The former takes a tuple giving the new size, the latter the angle in
degrees counter-clockwise.
degrees counterclockwise.

Simple geometry transforms
^^^^^^^^^^^^^^^^^^^^^^^^^^

::

out = im.resize((128, 128))
out = im.rotate(45) # degrees counter-clockwise
out = im.rotate(45) # degrees counterclockwise

.. image:: rotated_hopper_90.webp
:align: center
Expand Down
6 changes: 3 additions & 3 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 @@ -377,7 +377,7 @@ The setup function needs to call ``PyImaging_DecoderNew`` or

**pulls_fd**/**pushes_fd**
If the decoder has ``pulls_fd`` or the encoder has ``pushes_fd`` set to 1,
``state->fd`` will be a pointer to the Python file like object. The codec may
``state->fd`` will be a pointer to the Python file-like object. The codec may
use the functions in ``codec_fd.c`` to read or write directly with the file
like object rather than have the data pushed through a buffer.

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 Down
12 changes: 6 additions & 6 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 @@ -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
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 @@ -47,7 +47,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
2 changes: 1 addition & 1 deletion docs/reference/ImageGrab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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/TiffTags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ metadata tag numbers, names, and type information.
'ImageDescription'

This dictionary contains a superset of the tags in :py:data:`~PIL.TiffTags.TAGS_V2`, common
EXIF tags, and other well known metadata tags.
EXIF tags, and other well-known metadata tags.

.. py:data:: PIL.TiffTags.TYPES
:type: dict
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/c_extension_debugging.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C extension debugging on Linux, with GBD/Valgrind
C extension debugging on Linux, with GDB/Valgrind
=================================================

Install the tools
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,7 @@ def rotate(
copy of this image, rotated the given number of degrees counter
clockwise around its centre.

:param angle: In degrees counter clockwise.
:param angle: In degrees counterclockwise.
:param resample: An optional resampling filter. This can be
one of :py:data:`Resampling.NEAREST` (use nearest neighbour),
:py:data:`Resampling.BILINEAR` (linear interpolation in a 2x2
Expand Down
2 changes: 1 addition & 1 deletion src/PIL/ImageCms.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class ImageCmsProfile:
def __init__(self, profile: str | SupportsRead[bytes] | core.CmsProfile) -> None:
"""
:param profile: Either a string representing a filename,
a file like object containing a profile or a
a file-like object containing a profile or a
low-level profile object

"""
Expand Down