diff --git a/docs/deprecations.rst b/docs/deprecations.rst index c73e6b9296b..ef9231eb726 100644 --- a/docs/deprecations.rst +++ b/docs/deprecations.rst @@ -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 diff --git a/docs/handbook/concepts.rst b/docs/handbook/concepts.rst index 46f612be3b2..a5e83644bbf 100644 --- a/docs/handbook/concepts.rst +++ b/docs/handbook/concepts.rst @@ -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. @@ -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. @@ -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. diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 9b65e324de5..ad15bab6b57 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -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. @@ -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 @@ -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 @@ -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. @@ -1306,7 +1306,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. @@ -1442,7 +1442,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 diff --git a/docs/handbook/overview.rst b/docs/handbook/overview.rst index ab22b9807a1..2029811b0f3 100644 --- a/docs/handbook/overview.rst +++ b/docs/handbook/overview.rst @@ -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. diff --git a/docs/handbook/tutorial.rst b/docs/handbook/tutorial.rst index 28c0abe4437..d9efeae8950 100644 --- a/docs/handbook/tutorial.rst +++ b/docs/handbook/tutorial.rst @@ -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: @@ -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 diff --git a/docs/handbook/writing-your-own-image-plugin.rst b/docs/handbook/writing-your-own-image-plugin.rst index b615b5831b8..aef7a50cef9 100644 --- a/docs/handbook/writing-your-own-image-plugin.rst +++ b/docs/handbook/writing-your-own-image-plugin.rst @@ -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 @@ -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). | +-----------+-------------------------------------------------------------------+ @@ -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 diff --git a/docs/reference/Image.rst b/docs/reference/Image.rst index adee49228d2..e42c5f634ed 100644 --- a/docs/reference/Image.rst +++ b/docs/reference/Image.rst @@ -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 @@ -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] @@ -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`. @@ -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. @@ -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. diff --git a/docs/reference/ImageCms.rst b/docs/reference/ImageCms.rst index 4a21236775f..d4e411770ef 100644 --- a/docs/reference/ImageCms.rst +++ b/docs/reference/ImageCms.rst @@ -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 @@ -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. diff --git a/docs/reference/ImageColor.rst b/docs/reference/ImageColor.rst index 82bd359bc99..e73a63225e2 100644 --- a/docs/reference/ImageColor.rst +++ b/docs/reference/ImageColor.rst @@ -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 diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index d88e396e46e..3b23d92d8bb 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -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 diff --git a/docs/reference/ImageEnhance.rst b/docs/reference/ImageEnhance.rst index 334d1d4b228..f5e040e0936 100644 --- a/docs/reference/ImageEnhance.rst +++ b/docs/reference/ImageEnhance.rst @@ -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 ` of 0.0 gives a black and white image. A factor of 1.0 gives the original image. diff --git a/docs/reference/ImageGrab.rst b/docs/reference/ImageGrab.rst index 4138667850b..d74c4bcc35a 100644 --- a/docs/reference/ImageGrab.rst +++ b/docs/reference/ImageGrab.rst @@ -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 @@ -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. diff --git a/docs/reference/ImageMorph.rst b/docs/reference/ImageMorph.rst index f7a3027131e..eedc2be55c0 100644 --- a/docs/reference/ImageMorph.rst +++ b/docs/reference/ImageMorph.rst @@ -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:: diff --git a/docs/reference/PixelAccess.rst b/docs/reference/PixelAccess.rst index e4af94b9f18..831de9d36b7 100644 --- a/docs/reference/PixelAccess.rst +++ b/docs/reference/PixelAccess.rst @@ -49,7 +49,7 @@ Access using negative indexes is also possible. :: .. method:: __getitem__(self, xy: tuple[int, int]) -> float | tuple[int, ...] Returns the pixel at x,y. The pixel is returned as a single - value for single band images or a tuple for multi-band images. + value for single band images or a tuple for multiband images. :param xy: The pixel coordinate, given as (x, y). :returns: a pixel value for single band images, a tuple of diff --git a/docs/reference/TiffTags.rst b/docs/reference/TiffTags.rst index 6fe2071523b..bb628c11baf 100644 --- a/docs/reference/TiffTags.rst +++ b/docs/reference/TiffTags.rst @@ -67,13 +67,13 @@ 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 The ``TYPES`` dictionary maps the TIFF type short integer to a - human readable type name. + human-readable type name. .. py:data:: PIL.TiffTags.LIBTIFF_CORE :type: list diff --git a/docs/reference/arrow_support.rst b/docs/reference/arrow_support.rst index 8e8b86c8e4d..5dbff396e88 100644 --- a/docs/reference/arrow_support.rst +++ b/docs/reference/arrow_support.rst @@ -46,7 +46,7 @@ Memory allocator Pillow's default memory allocator, the :ref:`block_allocator`, allocates up to a 16 MB block for images by default. Larger images -overflow into additional blocks. Arrow requires a single continuous +overflow into additional blocks. Arrow requires a single contiguous memory allocation, so images allocated in multiple blocks cannot be exported in the Arrow format. diff --git a/docs/reference/c_extension_debugging.rst b/docs/reference/c_extension_debugging.rst index c17806b69b8..256d1bd9241 100644 --- a/docs/reference/c_extension_debugging.rst +++ b/docs/reference/c_extension_debugging.rst @@ -1,4 +1,4 @@ -C extension debugging on Linux, with GBD/Valgrind +C extension debugging on Linux, with GDB/Valgrind ================================================= Install the tools diff --git a/docs/releasenotes/11.1.0.rst b/docs/releasenotes/11.1.0.rst index 4888ddf56d3..095e154f9e7 100644 --- a/docs/releasenotes/11.1.0.rst +++ b/docs/releasenotes/11.1.0.rst @@ -22,7 +22,7 @@ Pillow 11.0.0 added writing XMP data to JPEG and MPO images:: im.save("out.jpg") However, this meant that XMP data was automatically kept from an opened image, -which is inconsistent with the rest of Pillow's behaviour. This functionality +which is inconsistent with the rest of Pillow's behavior. This functionality has been removed. To write XMP data, the ``xmp`` argument can still be used for JPEG files:: diff --git a/docs/releasenotes/11.2.1.rst b/docs/releasenotes/11.2.1.rst index aea2893aab2..d60cc71e061 100644 --- a/docs/releasenotes/11.2.1.rst +++ b/docs/releasenotes/11.2.1.rst @@ -16,7 +16,7 @@ Undefined shift when loading compressed DDS images ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When loading some compressed DDS formats, an integer was bitshifted by 24 places to -generate the 32 bits of the lookup table. This was undefined behaviour, and has been +generate the 32 bits of the lookup table. This was undefined behavior, and has been present since Pillow 3.4.0. Deprecations diff --git a/docs/releasenotes/12.1.0.rst b/docs/releasenotes/12.1.0.rst index 9740b700842..83aed2c1217 100644 --- a/docs/releasenotes/12.1.0.rst +++ b/docs/releasenotes/12.1.0.rst @@ -18,7 +18,7 @@ API changes ImageMorph build_default_lut() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To match the behaviour of :py:meth:`~PIL.ImageMorph.LutBuilder.build_lut`, +To match the behavior of :py:meth:`~PIL.ImageMorph.LutBuilder.build_lut`, :py:meth:`~PIL.ImageMorph.LutBuilder.build_default_lut()` now returns the new LUT. API additions