From c2728a1133868df6f64a816ee767acd7af5b03a1 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 28 Sep 2026 11:21:18 +1000 Subject: [PATCH 1/3] Correct bullet point syntax --- docs/releasenotes/13.0.0.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/releasenotes/13.0.0.rst b/docs/releasenotes/13.0.0.rst index 5ec4c3d1485..012eedd9a6e 100644 --- a/docs/releasenotes/13.0.0.rst +++ b/docs/releasenotes/13.0.0.rst @@ -179,10 +179,11 @@ Several of the libraries bundled in the macOS and Linux wheels were built withou compiler optimisation. The Windows wheels were not affected. These libraries are now compiled with ``-O2``. Compared to Pillow 12.3.0, the wheels -- decode JPEG 2000 images 2 to 3 times faster and encode them about twice as fast, -- LZW-compressed TIFF images are read and written about twice as fast, -- text rendering with :py:mod:`~PIL.ImageFont` is up to 3 times faster, and -- :py:mod:`~PIL.ImageCms` transforms are up to 3 times faster. + +* decode JPEG 2000 images 2 to 3 times faster and encode them about twice as fast, +* LZW-compressed TIFF images are read and written about twice as fast, +* text rendering with :py:mod:`~PIL.ImageFont` is up to 3 times faster, and +* :py:mod:`~PIL.ImageCms` transforms are up to 3 times faster. PNG, JPEG, WebP and AVIF are unaffected, as those libraries were already built with optimisation. From f8cb0e9bcd4413ee84c4ef8b1f04b0b452e7ec65 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 28 Sep 2026 11:21:54 +1000 Subject: [PATCH 2/3] Rearrange release notes --- docs/releasenotes/13.0.0.rst | 110 +++++++++++++++++------------------ 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/docs/releasenotes/13.0.0.rst b/docs/releasenotes/13.0.0.rst index 012eedd9a6e..417e35f3b13 100644 --- a/docs/releasenotes/13.0.0.rst +++ b/docs/releasenotes/13.0.0.rst @@ -107,6 +107,13 @@ TODO API additions ============= +New resizing filters +^^^^^^^^^^^^^^^^^^^^ + +Two new filters are available for :py:meth:`~PIL.Image.Image.resize` and +:py:meth:`~PIL.Image.Image.thumbnail`: ``Image.Resampling.MKS2013`` and +``Image.Resampling.MKS2021``. These are versions of the Magic Kernel Sharp filter. + Added ``strip_namespaces`` argument to ``Image.getxmp()`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -116,13 +123,6 @@ namespace URI prefix as before. If set to ``False``, each tag's full ``{namespace-uri}local-name`` form is kept instead, avoiding collisions between tags that share a local name across different namespaces. -New resizing filters -^^^^^^^^^^^^^^^^^^^^ - -Two new filters are available for :py:meth:`~PIL.Image.Image.resize` and -:py:meth:`~PIL.Image.Image.thumbnail`: ``Image.Resampling.MKS2013`` and -``Image.Resampling.MKS2021``. These are versions of the Magic Kernel Sharp filter. - Added ``escape`` argument to ``PSDraw.text()`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -134,24 +134,30 @@ escape sequences. Other changes ============= -Clean up TIFF encoders before closing their output files -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Python 3.15 +^^^^^^^^^^^ -TIFF saving now explicitly cleans up the libtiff encoder, including when saving -raises an exception. Previously, delayed encoder destruction could access a closed -file descriptor after it had been reused for another file, disturbing that file's -position or contents. +Pillow 12.3.0 had wheels built against Python 3.15 beta, available as a preview +to help projects prepare for 3.15, and to ensure Pillow could be used +immediately at the release of 3.15.0 final (2026-10-01, :pep:`790`). -:py:meth:`~PIL.Image.Image.tobytes` also now explicitly cleans up its encoder on -both success and failure, rather than relying on object destruction. +Pillow 13.0.0 now officially supports Python 3.15. -PNG palettes are no longer padded when saving with the ``bits`` argument +Faster JPEG 2000, TIFF, FreeType and LittleCMS in macOS and Linux wheels ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -When saving a ``P`` mode image as a PNG with the ``bits`` argument, Pillow used to pad -the ``PLTE`` chunk with zeroes up to ``2 ** bits`` entries. The ``PLTE`` chunk now only -contains as many entries as the image's palette actually has, matching the behavior -already used when ``bits`` is not specified. +Several of the libraries bundled in the macOS and Linux wheels were built without +compiler optimisation. The Windows wheels were not affected. + +These libraries are now compiled with ``-O2``. Compared to Pillow 12.3.0, the wheels + +* decode JPEG 2000 images 2 to 3 times faster and encode them about twice as fast, +* LZW-compressed TIFF images are read and written about twice as fast, +* text rendering with :py:mod:`~PIL.ImageFont` is up to 3 times faster, and +* :py:mod:`~PIL.ImageCms` transforms are up to 3 times faster. + +PNG, JPEG, WebP and AVIF are unaffected, as those libraries were already built with +optimisation. Wheels now use HarfBuzz for hinting ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -172,31 +178,6 @@ installed on the system with the expected name (e.g. ``libharfbuzz.so.0``). All wheels are now linked against the HarfBuzz that Pillow ships, which may slightly change how text is rendered in scripts that rely on the auto-hinter. -Faster JPEG 2000, TIFF, FreeType and LittleCMS in macOS and Linux wheels -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Several of the libraries bundled in the macOS and Linux wheels were built without -compiler optimisation. The Windows wheels were not affected. - -These libraries are now compiled with ``-O2``. Compared to Pillow 12.3.0, the wheels - -* decode JPEG 2000 images 2 to 3 times faster and encode them about twice as fast, -* LZW-compressed TIFF images are read and written about twice as fast, -* text rendering with :py:mod:`~PIL.ImageFont` is up to 3 times faster, and -* :py:mod:`~PIL.ImageCms` transforms are up to 3 times faster. - -PNG, JPEG, WebP and AVIF are unaffected, as those libraries were already built with -optimisation. - -Python 3.15 -^^^^^^^^^^^ - -Pillow 12.3.0 had wheels built against Python 3.15 beta, available as a preview -to help projects prepare for 3.15, and to ensure Pillow could be used -immediately at the release of 3.15.0 final (2026-10-01, :pep:`790`). - -Pillow 13.0.0 now officially supports Python 3.15. - Preserved transparency when padding or expanding images in ImageOps ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -205,26 +186,45 @@ Preserved transparency when padding or expanding images in ImageOps pixels in L, P and RGB images previously became opaque when a border was added. New palette colors are allocated without using reserved transparency entries. -Restore image position if ImageSequence.all_frames() fails -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Fixed ImageStat variance rounding +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -If processing a frame in :py:func:`~PIL.ImageSequence.all_frames` raises an exception, -the given image will now seek back to its original frame. +Fixed a floating-point rounding error that may have produced a negative variance in +:py:attr:`~PIL.ImageStat.Stat.var`. Fixed ImageChops.offset() for 16-bit images ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :py:meth:`~PIL.ImageChops.offset` now works correctly for 16-bit-per-channel images. -Fixed ImageStat variance rounding -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Fixed a floating-point rounding error that may have produced a negative variance in -:py:attr:`~PIL.ImageStat.Stat.var`. - Fixed histograms for masked LA, La and PA images ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When :py:meth:`~PIL.Image.Image.histogram` was given a mask for a two-band image (LA, La or PA), the second band was incorrectly derived from the first band of the input image, rather than the alpha band. + +PNG palettes are no longer padded when saving with the ``bits`` argument +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When saving a ``P`` mode image as a PNG with the ``bits`` argument, Pillow used to pad +the ``PLTE`` chunk with zeroes up to ``2 ** bits`` entries. The ``PLTE`` chunk now only +contains as many entries as the image's palette actually has, matching the behavior +already used when ``bits`` is not specified. + +Restore image position if ImageSequence.all_frames() fails +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If processing a frame in :py:func:`~PIL.ImageSequence.all_frames` raises an exception, +the given image will now seek back to its original frame. + +Clean up TIFF encoders before closing their output files +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +TIFF saving now explicitly cleans up the libtiff encoder, including when saving +raises an exception. Previously, delayed encoder destruction could access a closed +file descriptor after it had been reused for another file, disturbing that file's +position or contents. + +:py:meth:`~PIL.Image.Image.tobytes` also now explicitly cleans up its encoder on +both success and failure, rather than relying on object destruction. From 71ee1bd70a8d60ac14b00707c374ad8db2973ebb Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 28 Sep 2026 11:29:46 +1000 Subject: [PATCH 3/3] Update wording --- docs/releasenotes/13.0.0.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/releasenotes/13.0.0.rst b/docs/releasenotes/13.0.0.rst index 417e35f3b13..b9906b7f19d 100644 --- a/docs/releasenotes/13.0.0.rst +++ b/docs/releasenotes/13.0.0.rst @@ -152,9 +152,9 @@ compiler optimisation. The Windows wheels were not affected. These libraries are now compiled with ``-O2``. Compared to Pillow 12.3.0, the wheels * decode JPEG 2000 images 2 to 3 times faster and encode them about twice as fast, -* LZW-compressed TIFF images are read and written about twice as fast, -* text rendering with :py:mod:`~PIL.ImageFont` is up to 3 times faster, and -* :py:mod:`~PIL.ImageCms` transforms are up to 3 times faster. +* read and write LZW-compressed TIFF images about twice as fast, +* render text with :py:mod:`~PIL.ImageFont` up to 3 times faster, and +* apply :py:mod:`~PIL.ImageCms` transforms up to 3 times faster. PNG, JPEG, WebP and AVIF are unaffected, as those libraries were already built with optimisation.