NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #43 most downloaded on PyPI
Python Imaging Library (fork)
Latest stable
13.0.0
Last release 1 months ago
16 Oct 2026
Ships on a steady schedule
a new release about every 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
16 years old
108 releases · first in 2010
Drag across the ruler to compare, or tap a release to open it.
Deprecate fromarray mode argument #9018 [ @radarhere ]
https://pillow.readthedocs.io/en/stable/releasenotes/11.3.0.html
Makefile #8933 [@hugovk]match parameter to pytest.warns() #9038 [@hugovk]make [-C docs] htmllive to rebuild and reload HTML files #8913 [@hugovk]Your coding agent can read these notes before it upgrades. Set up the MCP server →
There is a heap buffer overflow when writing a sufficiently large (>64k encoded with default settings) image in the DDS format due to writing into a buffer without checking for available space.
This only affects users who save untrusted data as a compressed DDS image.
Unclear how large the potential write could be. It is likely limited by process segfault, so it's not necessarily deterministic. It may be practically unbounded.
Unclear if there's a restriction on the bytes that could be emitted. It's likely that the only restriction is that the bytes would be emitted in chunks of 8 or 16.
This was introduced in Pillow 11.2.0 when the feature was added.
The mode parameter in ~PIL.Image.fromarray() has been deprecated. The mode can be automatically determined from the object's shape and type instead.
Note
Since pixel values do not contain information about palettes or color spaces, part of this functionality was restored in Pillow 12.0.0. The parameter can be used to place grayscale L mode data within a P mode image, or read RGB data as YCbCr for example.
In order to fit the 32 bits of I mode images into PNG, when PNG images can only contain at most 16 bits for a channel, Pillow has been clipping the values. Rather than quietly changing the data, this is now deprecated. Instead, the image can be converted to another mode before saving:
from PIL import Image
im = Image.new("I", (1, 1))
im.convert("I;16").save("out.png")
Support has been added for saving QOI images. colorspace can be used to specify the colorspace as sRGB with linear alpha, e.g. im.save("out.qoi", colorspace="sRGB"). By default, all channels will be linear.
~PIL.ImageGrab.grab is now able to use GNOME Screenshot, grim or Spectacle on Linux in order to take a snapshot of the screen.
Pillow only supports libavif 1.0.0 or later. In order to prevent errors when building from source, if a user happens to have an earlier libavif on their system, Pillow will now ignore it.
Support for reading and writing AVIF images is now included in Pillow's wheels, except for Windows ARM64 and iOS. libaom is available as an encoder and dav1d as a decoder. (Thank you Frankie Dintino and Andrew Murray!)
Pillow now provides wheels that can be used on iOS ARM64 devices, and on the iOS simulator on ARM64 and x86_64. Currently, only Python 3.13 wheels are available. (Thank you Russell Keith-Magee and Andrew Murray!)
To help other projects prepare for Python 3.14, wheels are now built for the 3.14 beta as a preview. This is not official support for Python 3.14, but rather an opportunity for you to test how Pillow works with the beta and report any problems.
Replace deprecated classifier with licence expression (PEP 639) #8850 [ @hugovk ]
https://pillow.readthedocs.io/en/stable/releasenotes/11.2.1.html
make clean or pip in tox #8754 [@hugovk]Note truncated.
Warning
The release of Pillow 11.2.0 was halted prematurely, due to hitting PyPI's project size limit and concern over the size of Pillow wheels containing libavif. The PyPI limit has now been increased and Pillow 11.2.1 has been released instead, without libavif included in the wheels. To avoid confusion, the incomplete 11.2.0 release has been removed from PyPI.
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 present since Pillow 3.4.0.
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 PIL.ImageFile.ImageFile instance.
Previously, save_all was required in order to use append_images. Now, save_all will default to True if append_images is not empty and the format supports saving multiple frames:
im.save("out.gif", append_images=ims)
In addition to "left", "center" and "right", multiline text can also be aligned using "justify" in ~PIL.ImageDraw:
from PIL import Image, ImageDraw
im = Image.new("RGB", (50, 25))
draw = ImageDraw.Draw(im)
draw.multiline_text((0, 0), "Multiline\ntext 1", align="justify")
draw.multiline_textbbox((0, 0), "Multiline\ntext 2", align="justify")
When using ~PIL.ImageGrab.grab, a specific window can be selected using the HWND:
from PIL import ImageGrab ImageGrab.grab(window=hwnd)
You can check if Pillow has been built against the MozJPEG version of the libjpeg library, and what version of MozJPEG is being used:
from PIL import features
features.check_feature("mozjpeg") # True or False
features.version_feature("mozjpeg") # "4.1.1" for example, or None
Compressed DDS images can now be saved using a pixel_format argument. DXT1, DXT3, DXT5, BC2, BC3 and BC5 are supported:
im.save("out.dds", pixel_format="DXT1")
Arrow is an in-memory data exchange format that is the spiritual successor to the NumPy array interface. It provides for zero-copy access to columnar data, which in our case is Image data.
To create an image with zero-copy shared memory from an object exporting the arrow_c_array interface protocol:
from PIL import Image import pyarrow as pa arr = pa.array([0]*(5*5*4), type=pa.uint8()) im = Image.fromarrow(arr, 'RGBA', (5, 5))
Pillow images can also be converted to Arrow objects:
from PIL import Image
import pyarrow as pa
im = Image.open('hopper.jpg')
arr = pa.array(im)
Pillow can now read and write AVIF images when built from source with libavif 1.0.0 or later.
Apply security fixes to GitHub Actions #8526 [ @hugovk ]
https://pillow.readthedocs.io/en/stable/releasenotes/11.1.0.html
gcov: true for codecov-action@v4 #8521 [@hugovk]ExifTags.IFD.Makernote has been deprecated. Instead, use ExifTags.IFD.MakerNote.
Pillow 11.0.0 added writing XMP data to JPEG and MPO images:
im.info["xmp"] = b"test"
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 has been removed. To write XMP data, the xmp argument can still be used for JPEG files:
im.save("out.jpg", xmp=b"test")
To save XMP data to the second frame of an MPO image, encoderinfo can now be used:
second_im.encoderinfo = {"xmp": b"test"}
im.save("out.mpo", save_all=True, append_images=[second_im])
You can check if Pillow has been built against the zlib-ng version of the zlib library, and what version of zlib-ng is being used:
from PIL import features
features.check_feature("zlib_ng") # True or False
features.version_feature("zlib_ng") # "2.2.2" for example, or None
TIFF images can now be saved as BigTIFF using a big_tiff argument:
im.save("out.tiff", big_tiff=True)
When opening a JPEG 2000 image, the comment may now be read into ~PIL.Image.Image.info for J2K images, not just JP2 images.
With OpenJPEG 2.5.3 or later, Pillow can now save CMYK images as JPEG 2000 files.
C99 is now the minimum version of C required to compile Pillow from source.
Wheels are now built against zlib-ng for improved speed. In tests, saving a PNG was found to be more than twice as fast at higher compression levels.
Deprecate ICNS (width, height, scale) sizes in favour of load(scale) #8352 [ @radarhere ]
https://pillow.readthedocs.io/en/stable/releasenotes/11.0.0.html
pytest.mark.parametrize #8295 [@akx]Note truncated.
Update licence to MIT-CMU #8460 [hugovk]
Conditionally define ImageCms type hint to avoid requiring core #8197 [radarhere]
Support writing LONG8 offsets in AppendingTiffWriter #8417 [radarhere]
Use ImageFile.MAXBLOCK when saving TIFF images #8461 [radarhere]
Do not close provided file handles with libtiff when saving #8458 [radarhere]
Support ImageFilter.BuiltinFilter for I;16* images #8438 [radarhere]
Use ImagingCore.ptr instead of ImagingCore.id #8341 [homm, radarhere, hugovk]
Updated EPS mode when opening images without transparency #8281 [Yay295, radarhere]
Use transparency when combining P frames from APNGs #8443 [radarhere]
Support all resampling filters when resizing I;16* images #8422 [radarhere]
Free memory on early return #8413 [radarhere]
Cast int before potentially exceeding INT_MAX #8402 [radarhere]
Check image value before use #8400 [radarhere]
Improved copying imagequant libraries #8420 [radarhere]
Use Capsule for WebP saving #8386 [homm, radarhere]
Fixed writing multiple StripOffsets to TIFF #8317 [Yay295, radarhere]
Fix dereference before checking for NULL in ImagingTransformAffine #8398 [PavlNekrasov]
Use transposed size after opening for TIFF images #8390 [radarhere, homm]
Improve ImageFont error messages #8338 [yngvem, radarhere, hugovk]
Mention MAX_TEXT_CHUNK limit in PNG error message #8391 [radarhere]
Cast Dib handle to int #8385 [radarhere]
Accept float stroke widths #8369 [radarhere]
Deprecate ICNS (width, height, scale) sizes in favour of load(scale) #8352 [radarhere]
Improved handling of RGBA palettes when saving GIF images #8366 [radarhere]
Deprecate isImageType #8364 [radarhere]
Support converting more modes to LAB by converting to RGBA first #8358 [radarhere]
Deprecate support for FreeType 2.9.0 #8356 [hugovk, radarhere]
Removed unused TiffImagePlugin IFD_LEGACY_API #8355 [radarhere]
Handle duplicate EXIF header #8350 [zakajd, radarhere]
Return early from BoxBlur if either width or height is zero #8347 [radarhere]
Check text is either string or bytes #8308 [radarhere]
Added writing XMP bytes to JPEG #8286 [radarhere]
Support JPEG2000 RGBA palettes #8256 [radarhere]
Expand C image to match GIF frame image size #8237 [radarhere]
Allow saving I;16 images as PPM #8231 [radarhere]
When IFD is missing, connect get_ifd() dictionary to Exif #8230 [radarhere]
Skip truncated ICO mask if LOAD_TRUNCATED_IMAGES is enabled #8180 [radarhere]
Treat unknown JPEG2000 colorspace as unspecified #8343 [radarhere]
Updated error message when saving WebP with invalid width or height #8322 [radarhere, hugovk]
Remove warning if NumPy failed to raise an error during conversion #8326 [radarhere]
If left and right sides meet in ImageDraw.rounded_rectangle(), do not draw rectangle to fill gap #8304 [radarhere]
Remove WebP support without anim, mux/demux, and with buggy alpha #8213 [homm, radarhere]
Add missing TIFF CMYK;16B reader #8298 [homm]
Remove all WITH_* flags from _imaging.c and other flags #8211 [homm]
Improve ImageDraw2 shape methods #8265 [radarhere]
Lock around usages of imaging memory arenas #8238 [lysnikolaou]
Deprecate JpegImageFile huffman_ac and huffman_dc #8274 [radarhere]
Deprecate ImageMath lambda_eval and unsafe_eval options argument #8242 [radarhere]
Changed ContainerIO to subclass IO #8240 [radarhere]
Move away from APIs that use borrowed references under the free-threaded build #8216 [hugovk, lysnikolaou]
Allow size argument to resize() to be a NumPy array #8201 [radarhere]
Drop support for Python 3.8 #8183 [hugovk, radarhere]
Add support for Python 3.13 #8181 [hugovk, radarhere]
Fix incompatibility with NumPy 1.20 #8187 [neutrinoceros, radarhere]
Remove PSFile, PyAccess and USE_CFFI_ACCESS #8182 [hugovk, radarhere]
Pillow has dropped support for Python 3.8, which reached end-of-life in October 2024.
The latest version of Python 3.12 only supports macOS versions 10.13 and later, and so Pillow has also updated the deployment target for its prebuilt Python 3.12 wheels.
The !PSFile class was removed in Pillow 11 (2024-10-15). This class was only made as a helper to be used internally, so there is no replacement. If you need this functionality though, it is a very short class that can easily be recreated in your own code.
Since Pillow's C API is now faster than PyAccess on PyPy, PyAccess has been removed. Pillow's C API will now be used on PyPy instead.
Image.USE_CFFI_ACCESS, for switching from the C API to PyAccess, was similarly removed.
An unused setting, TiffImagePlugin.IFD_LEGACY_API, has been removed.
Support for WebP 0.4 and earlier has been removed; WebP 0.5 is the minimum supported.
Support for FreeType 2.9.0 is deprecated and will be removed in Pillow 12.0.0 (2025-10-15), when FreeType 2.9.1 will be the minimum supported.
We recommend upgrading to at least FreeType 2.10.4, which fixed a severe vulnerability introduced in FreeType 2.6 (2020-15999).
Image.core.ImagingCore.id and Image.core.ImagingCore.unsafe_ptrs have been deprecated and will be removed in Pillow 12 (2025-10-15). They were used for obtaining raw pointers to ImagingCore internals. To interact with C code, you can use Image.Image.getim(), which returns a Capsule object.
Setting an ICNS image size to (width, height, scale) before loading has been deprecated. Instead, load(scale) can be used.
Image.isImageType(im) has been deprecated. Use isinstance(im, Image.Image) instead.
The options parameter in ~PIL.ImageMath.lambda_eval() and ~PIL.ImageMath.unsafe_eval() has been deprecated. One or more keyword arguments can be used instead.
The huffman_ac and huffman_dc dictionaries on JPEG images were unused. They have been deprecated, and will be removed in Pillow 12 (2025-10-15).
features.check("transp_webp"), features.check("webp_mux") and features.check("webp_anim") are now deprecated. They will always return True if the WebP module is installed, until they are removed in Pillow 12.0.0 (2025-10-15).
The default resampling filter for I;16, I;16L, I;16B and I;16N has been changed from Image.NEAREST to Image.BICUBIC, to match the majority of modes.
XMP data can now be saved to JPEG files using an xmp argument:
im.save("out.jpg", xmp=b"test")
The data can also be set through ~PIL.Image.Image.info, for use when saving either JPEG or MPO images:
im.info["xmp"] = b"test"
im.save("out.jpg")
Pillow 10.4.0 had wheels built against Python 3.13 beta, available as a preview to help others prepare for 3.13, and to ensure Pillow could be used immediately at the release of 3.13.0 final (2024-10-07, 719).
Pillow 11.0.0 now officially supports Python 3.13.
Support has also been added for the experimental free-threaded mode of 703.
Python 3.13 only supports macOS versions 10.13 and later.
Some compiling flags like WITH_THREADING, WITH_IMAGECHOPS, and other WITH_* were removed. These flags were not available through the build system, but they could be edited in the C source.
Deprecate non-image ImageCms modes #8031 [ @radarhere ]
https://pillow.readthedocs.io/en/stable/releasenotes/10.4.0.html
ImageFont.freetype support for XDG directories on Linux #8135 [@mamg22]make release-test: no more eggs #7957 [@hugovk]Makefile #8109 [@hugovk]macos-13 or macos-14 instead of macos-latest #8010 [@hugovk]Note truncated.
Raise FileNotFoundError if show_file() path does not exist #8178 [radarhere]
Improved reading 16-bit TGA images with colour #7965 [Yay295, radarhere]
Deprecate non-image ImageCms modes #8031 [radarhere]
Fixed processing multiple JPEG EXIF markers #8127 [radarhere]
Do not preserve EXIFIFD tag by default when saving TIFF images #8110 [radarhere]
Added ImageFont.load_default_imagefont() #8086 [radarhere]
Added Image.WARN_POSSIBLE_FORMATS #8063 [radarhere]
Remove zero-byte end padding when parsing any XMP data #8171 [radarhere]
Do not detect Ultra HDR images as MPO #8056 [radarhere]
Raise SyntaxError specific to JP2 #8146 [Yay295, radarhere]
Do not use first frame duration for other frames when saving APNG images #8104 [radarhere]
Consider I;16 pixel size when using a 1 mode mask #8112 [radarhere]
When saving multiple PNG frames, convert to mode rather than raw mode #8087 [radarhere]
Added byte support to FreeTypeFont #8141 [radarhere]
Allow float center for rotate operations #8114 [radarhere]
Do not read layers immediately when opening PSD images #8039 [radarhere]
Restore original thread state #8065 [radarhere]
Read IM and TIFF images as RGB, rather than RGBX #7997 [radarhere]
Only preserve TIFF IPTC_NAA_CHUNK tag if type is BYTE or UNDEFINED #7948 [radarhere]
Clarify ImageDraw2 error message when size is missing #8165 [radarhere]
Support unpacking more rawmodes to RGBA palettes #7966 [radarhere]
Removed support for Qt 5 #8159 [radarhere]
Improve ImageFont.freetype support for XDG directories on Linux #8135 [mamg22, radarhere]
Improved consistency of XMP handling #8069 [radarhere]
Use pkg-config to help find libwebp and raqm #8142 [radarhere]
Accept 't' suffix for libtiff version #8126, #8129 [radarhere]
Deprecate ImageDraw.getdraw hints parameter #8124 [radarhere, hugovk]
Added ImageDraw circle() #8085 [void4, hugovk, radarhere]
Add mypy target to Makefile #8077 [Yay295]
Added more modes to Image.MODES #7984 [radarhere]
Deprecate BGR;15, BGR;16 and BGR;24 modes #7978 [radarhere, hugovk]
Fix ImagingAccess for I;16N on big-endian #7921 [Yay295, radarhere]
Support reading P mode TIFF images with padding #7996 [radarhere]
Deprecate support for libtiff < 4 #7998 [radarhere, hugovk]
Corrected ImageShow UnixViewer command #7987 [radarhere]
Use functools.cached_property in ImageStat #7952 [nulano, hugovk, radarhere]
Add support for reading BITMAPV2INFOHEADER and BITMAPV3INFOHEADER #7956 [Cirras, radarhere]
Support reading CMYK JPEG2000 images #7947 [radarhere]
If an attacker has control over the path passed to ImageShow.WindowsViewer.show_file(), they may be able to execute arbitrary shell commands.
To prevent this, a FileNotFoundError will be raised if the path does not exist as a file. To provide a consistent experience, the error has been added to all ~PIL.ImageShow viewers.
The experimental BGR;15, BGR;16 and BGR;24 modes have been deprecated.
The use in .ImageCms of input modes and output modes that are not Pillow image modes has been deprecated. Defaulting to "L" or "1" if the mode cannot be mapped is also deprecated.
Support for LibTIFF earlier than version 4 has been deprecated. Upgrade to a newer version of LibTIFF instead.
The hints parameter in ~PIL.ImageDraw.getdraw() has been deprecated.
Added ~PIL.ImageDraw.ImageDraw.circle. It provides the same functionality as ~PIL.ImageDraw.ImageDraw.ellipse, but instead of taking a bounding box, it takes a center point and radius.
To help others prepare for Python 3.13, wheels have been built against the 3.13 beta as a preview. This is not official support for Python 3.13, but simply an opportunity for users to test how Pillow works with the beta and report any problems.
CVE-2024-28219: Use strncpy to avoid buffer overflow #7928 [@hugovk]
https://pillow.readthedocs.io/en/stable/releasenotes/10.3.0.html
functools.lru_cache for hopper() #7912 [@hugovk]WebPAnimDecoderGetNext #7782 [@evanmiller]setup.py #7760 [@hugovk]Image.py #7924 [@hugovk]py.typed and Typing :: Typed to support type checking #7822 [@radarhere]io.BytesIO in type hints #7750 [@hugovk][pre-commit.ci] pre-commit autoupdate and fix deprecations #7780 [@pre-commit-ci]
Install mypy from requirements file #7813 [@hugovk]
Pin codecov/codecov-action to v3.1.5 #7776 [@hugovk]
Update actions/cache action to v4 #7735 [@renovate]
Update dependency cibuildwheel to v2.16.4 #7758 [@renovate]
Update dependency cibuildwheel to v2.16.5 #7767 [@renovate]
Update dependency cibuildwheel to v2.17.0 #7869 [@renovate]
Update dependency mypy to v1.8.0 #7851 [@renovate]
Update dependency mypy to v1.9.0 #7866 [@renovate]
Update github-actions to v4 #7770 [@renovate]
Update release-drafter/release-drafter action to v6 #7774 [@renovate]
Updated Ghostscript to 10.3.0 #7887 [@radarhere]
Updated giflib on macOS to 5.2.2 #7815 [@radarhere]
Updated harfbuzz to 8.3.1 #7886 [@radarhere]
Updated harfbuzz to 8.4.0 #7917 [@radarhere]
Updated libimagequant to 4.3.0 #7749 [@radarhere]
Updated libjpeg-turbo to 3.0.2 #7752 [@radarhere]
Updated libpng to 1.6.43 #7768 [@radarhere]
Updated libxcb to 1.16.1 #7853 [@radarhere]
Updated openjpeg to 2.5.2 #7837 [@radarhere]
Updated xorgproto to 2024.1 #7907 [@radarhere]
Updated zlib to 1.3.1 #7746 [@radarhere]
Use setup_module() to open images so they aren't opened if skipped #7911 [@Yay295]
Skip AppVeyor builds for irrelevant files #7909 [@hugovk]
Revert "Pin Python 3.13 on Windows to a3" #7878 [@radarhere]
Restored testing of non-TrueType default font #7748 [@radarhere]
Parametrize test_seek_mode functions #7847 [@Yay295]
Do not use packaged MinGW pip #7844 [@radarhere]
Parametrize test_p_from_rgb_rgba() #7835 [@Yay295]
Require coverage.py 7.4.2+ for COVERAGE_CORE: sysmon #7825 [@hugovk]
Set COVERAGE_CORE: sysmon for faster tests on 3.12+ #7820 [@hugovk]
Build docs for Python changes #7819 [@nulano]
Install mypy from requirements file #7813 [@hugovk]
Pin Python 3.13 on Windows to a3 #7805 [@radarhere]
Removed platform argument from setup-cygwin action #7775 [@radarhere]
Pin to Python 3.9.16-1 #7762 [@radarhere]
Test on macOS M1 where available #7766 [@hugovk]
CI: Cache libimagequant on Linux builds #7741 [@hugovk]
Do not support using test-image-results to upload images after test failures #7739 [@radarhere]
Sort imports in Tests/ #7736 [@hugovk]
Skip non-wheel CI runs for tags: Windows #7692 [@hugovk]
CVE-2024-28219: Use strncpy to avoid buffer overflow #7928 [radarhere, hugovk]
Deprecate eval(), replacing it with lambda_eval() and unsafe_eval() #7927 [radarhere, hugovk]
Raise ValueError if seeking to greater than offset-sized integer in TIFF #7883 [radarhere]
Add --report argument to __main__.py to omit supported formats #7818 [nulano, radarhere, hugovk]
Added RGB to I;16, I;16L, I;16B and I;16N conversion #7918, #7920 [radarhere]
Fix editable installation with custom build backend and configuration options #7658 [nulano, radarhere]
Fix putdata() for I;16N on big-endian #7209 [Yay295, hugovk, radarhere]
Determine MPO size from markers, not EXIF data #7884 [radarhere]
Improved conversion from RGB to RGBa, LA and La #7888 [radarhere]
Support FITS images with GZIP_1 compression #7894 [radarhere]
Use I;16 mode for 9-bit JPEG 2000 images #7900 [scaramallion, radarhere]
Raise ValueError if kmeans is negative #7891 [radarhere]
Remove TIFF tag OSUBFILETYPE when saving using libtiff #7893 [radarhere]
Raise ValueError for negative values when loading P1-P3 PPM images #7882 [radarhere]
Added reading of JPEG2000 palettes #7870 [radarhere]
Added alpha_quality argument when saving WebP images #7872 [radarhere]
Fixed joined corners for ImageDraw rounded_rectangle() non-integer dimensions #7881 [radarhere]
Stop reading EPS image at EOF marker #7753 [radarhere]
PSD layer co-ordinates may be negative #7706 [radarhere]
Use subprocess with CREATE_NO_WINDOW flag in ImageShow WindowsViewer #7791 [radarhere]
When saving GIF frame that restores to background color, do not fill identical pixels #7788 [radarhere]
Fixed reading PNG iCCP compression method #7823 [radarhere]
Allow writing IFDRational to UNDEFINED tag #7840 [radarhere]
Fix logged tag name when loading Exif data #7842 [radarhere]
Use maximum frame size in IHDR chunk when saving APNG images #7821 [radarhere]
Prevent opening P TGA images without a palette #7797 [radarhere]
Use palette when loading ICO images #7798 [radarhere]
Use consistent arguments for load_read and load_seek #7713 [radarhere]
Turn off nullability warnings for macOS SDK #7827 [radarhere]
Fix shift-sign issue in Convert.c #7838 [r-barnes, radarhere]
Open 16-bit grayscale PNGs as I;16 #7849 [radarhere]
Handle truncated chunks at the end of PNG images #7709 [lajiyuan, radarhere]
Match mask size to pasted image size in GifImagePlugin #7779 [radarhere]
Release GIL while calling WebPAnimDecoderGetNext #7782 [evanmiller, radarhere]
Fixed reading FLI/FLC images with a prefix chunk #7804 [twolife]
Update wl-paste handling and return None for some errors in grabclipboard() on Linux #7745 [nik012003, radarhere]
Remove execute bit from setup.py #7760 [hugovk]
Do not support using test-image-results to upload images after test failures #7739 [radarhere]
Changed ImageMath.ops to be static #7721 [radarhere]
Fix APNG info after seeking backwards more than twice #7701 [esoma, radarhere]
Deprecate ImageCms constants and versions() function #7702 [nulano, radarhere]
Added PerspectiveTransform #7699 [radarhere]
Add support for reading and writing grayscale PFM images #7696 [nulano, hugovk]
Add LCMS2 flags to ImageCms #7676 [nulano, radarhere, hugovk]
Rename x64 to AMD64 in winbuild #7693 [nulano]
!DANGER!
ImageMath.eval() uses Python's eval() function to process the expression string, and carries the security risks of doing so. A direct replacement for this is the new ~PIL.ImageMath.unsafe_eval, but that carries the same risks. It is not recommended to process expressions without considering this. ~PIL.ImageMath.lambda_eval is a more secure alternative.
In _imagingcms.c, two strcpy calls were able to copy too much data into fixed length strings. This has been fixed by using strncpy instead.
A number of constants and a function in .ImageCms have been deprecated. This includes a table of flags based on LittleCMS version 1 which has been replaced with a new class .ImageCms.Flags based on LittleCMS 2 flags.
Deprecated |
Use instead |
|---|---|
ImageCms.DESCRIPTION |
No replacement |
ImageCms.VERSION |
PIL.__version__ |
ImageCms.FLAGS["MATRIXINPUT"] |
.ImageCms.Flags.CLUT_POST_LINEARIZATION |
ImageCms.FLAGS["MATRIXOUTPUT"] |
.ImageCms.Flags.FORCE_CLUT |
ImageCms.FLAGS["MATRIXONLY"] |
No replacement |
ImageCms.FLAGS["NOWHITEONWHITEFIXUP"] |
.ImageCms.Flags.NOWHITEONWHITEFIXUP |
ImageCms.FLAGS["NOPRELINEARIZATION"] |
.ImageCms.Flags.CLUT_PRE_LINEARIZATION |
ImageCms.FLAGS["GUESSDEVICECLASS"] |
.ImageCms.Flags.GUESSDEVICECLASS |
ImageCms.FLAGS["NOTCACHE"] |
.ImageCms.Flags.NOCACHE |
ImageCms.FLAGS["NOTPRECALC"] |
.ImageCms.Flags.NOOPTIMIZE |
ImageCms.FLAGS["NULLTRANSFORM"] |
.ImageCms.Flags.NULLTRANSFORM |
ImageCms.FLAGS["HIGHRESPRECALC"] |
.ImageCms.Flags.HIGHRESPRECALC |
ImageCms.FLAGS["LOWRESPRECALC"] |
.ImageCms.Flags.LOWRESPRECALC |
ImageCms.FLAGS["GAMUTCHECK"] |
.ImageCms.Flags.GAMUTCHECK |
ImageCms.FLAGS["WHITEBLACKCOMPENSATION"] |
.ImageCms.Flags.BLACKPOINTCOMPENSATION |
ImageCms.FLAGS["BLACKPOINTCOMPENSATION"] |
.ImageCms.Flags.BLACKPOINTCOMPENSATION |
ImageCms.FLAGS["SOFTPROOFING"] |
.ImageCms.Flags.SOFTPROOFING |
ImageCms.FLAGS["PRESERVEBLACK"] |
.ImageCms.Flags.NONEGATIVES |
ImageCms.FLAGS["NODEFAULTRESOURCEDEF"] |
.ImageCms.Flags.NODEFAULTRESOURCEDEF |
ImageCms.FLAGS["GRIDPOINTS"] |
.ImageCms.Flags.GRIDPOINTS() |
ImageCms.versions() |
PIL.features.version_module with feature="littlecms2", sys.version or sys.version_info, and PIL.__version__ |
ImageMath.eval() has been deprecated. Use ~PIL.ImageMath.lambda_eval or ~PIL.ImageMath.unsafe_eval instead. See earlier security notes for more information.
When saving WebP images, an alpha_quality argument can be passed to the encoder. It is an integer value between 0 to 100, where values other than 100 will provide lossy compression.
When calling ~PIL.Image.Image.quantize, a negative kmeans will now raise a ValueError, unless a palette is supplied to make the value redundant.
If a P1-P3 PPM image contains a negative value, a ValueError will now be raised.
~PIL.ImageTransform.PerspectiveTransform has been added, meaning that all of the ~PIL.Image.Transform values now have a corresponding subclass of ~PIL.ImageTransform.Transform.
Support has been added for reading and writing grayscale (Pf format) Portable FloatMap (PFM) files containing F data.
Python's Global Interpreter Lock is now released when fetching WebP frames from the libwebp decoder.
Pillow now has type hints for a large part of its modules, and the package includes a py.typed file and the Typing :: Typed Trove classifier.
Add CVE-2023-44271 to release notes #7520 [@hugovk]
https://pillow.readthedocs.io/en/stable/releasenotes/10.2.0.html
ImageFile.raise_oserror() #7609 [@bgilbert]keep_rgb option when saving JPEG to prevent conversion of RGB colorspace #7553 [@bgilbert]ImageColor using functools.lru_cache #7657 [@hugovk]ImageMode.getmode using functools.lru_cache #7641 [@hugovk]isinstance check #7623 [@hugovk]unistd.h #7535 [@hugovk]streamtype=1 option for tables-only JPEG encoding #7491 [@bgilbert]setup.cfg to pyproject.toml #7484 [@hugovk]ImageColor and ImageMode optimisations, and type hints #7665 [@hugovk]streamtype option #7601 [@bgilbert]pypi Sphinx role #7505 [@hugovk]assert False with pytest.fail() #7546 [@hugovk]target-version from requires-python in pyproject.toml #7530 [@hugovk]__future__ import from fuzz_font.py and fuzz_pillow.py #7649 [@radarhere]__future__ import to beginning of file #7637 [@radarhere]from __future__ import annotations using Ruff/isort #7631 [@hugovk]Add keep_rgb option when saving JPEG to prevent conversion of RGB colorspace #7553 [bgilbert, radarhere]
Trim glyph size in ImageFont.getmask() #7669, #7672 [radarhere, nulano]
Deprecate IptcImagePlugin helpers #7664 [nulano, hugovk, radarhere]
Allow uncompressed TIFF images to be saved in chunks #7650 [radarhere]
Concatenate multiple JPEG EXIF markers #7496 [radarhere]
Changed IPTC tile tuple to match other plugins #7661 [radarhere]
Do not assign new fp attribute when exiting context manager #7566 [radarhere]
Support arbitrary masks for uncompressed RGB DDS images #7589 [radarhere, akx]
Support setting ROWSPERSTRIP tag #7654 [radarhere]
Apply ImageFont.MAX_STRING_LENGTH to ImageFont.getmask() #7662 [radarhere]
Optimise ImageColor using functools.lru_cache #7657 [hugovk]
Restricted environment keys for ImageMath.eval() #7655 [wiredfool, radarhere]
Optimise ImageMode.getmode using functools.lru_cache #7641 [hugovk, radarhere]
Fix incorrect color blending for overlapping glyphs #7497 [ZachNagengast, nulano, radarhere]
Attempt memory mapping when tile args is a string #7565 [radarhere]
Fill identical pixels with transparency in subsequent frames when saving GIF #7568 [radarhere]
Corrected duration when combining multiple GIF frames into single frame #7521 [radarhere]
Handle disposing GIF background from outside palette #7515 [radarhere]
Seek past the data when skipping a PSD layer #7483 [radarhere]
Import plugins relative to the module #7576 [deliangyang, jaxx0n]
Translate encoder error codes to strings; deprecate ImageFile.raise_oserror() #7609 [bgilbert, radarhere]
Support reading BC4U and DX10 BC1 images #6486 [REDxEYE, radarhere, hugovk]
Optimize ImageStat.Stat.extrema #7593 [florath, radarhere]
Handle pathlib.Path in FreeTypeFont #7578 [radarhere, hugovk, nulano]
Added support for reading DX10 BC4 DDS images #7603 [sambvfx, radarhere]
Optimized ImageStat.Stat.count #7599 [florath]
Correct PDF palette size when saving #7555 [radarhere]
Fixed closing file pointer with olefile 0.47 #7594 [radarhere]
Raise ValueError when TrueType font size is not greater than zero #7584, #7587 [akx, radarhere]
If absent, do not try to close fp when closing image #7557 [RaphaelVRossi, radarhere]
Allow configuring JPEG restart marker interval on save #7488 [bgilbert, radarhere]
Decrement reference count for PyObject #7549 [radarhere]
Implement streamtype=1 option for tables-only JPEG encoding #7491 [bgilbert, radarhere]
If save_all PNG only has one frame, do not create animated image #7522 [radarhere]
Fixed frombytes() for images with a zero dimension #7493 [radarhere]
To protect against potential DOS attacks when using arbitrary strings as text input, Pillow will now raise a ValueError if the number of characters passed into PIL.ImageFont.ImageFont.getmask is over a certain limit, PIL.ImageFont.MAX_STRING_LENGTH.
This threshold can be changed by setting PIL.ImageFont.MAX_STRING_LENGTH. It can be disabled by setting ImageFont.MAX_STRING_LENGTH = None.
A decompression bomb check has also been added to PIL.ImageFont.ImageFont.getmask.
To protect against potential DOS attacks when using PIL fonts, PIL.ImageFont.ImageFont now trims the size of individual glyphs so that they do not extend beyond the bitmap image.
If an attacker has control over the keys passed to the environment argument of !PIL.ImageMath.eval, they may be able to execute arbitrary code. To prevent this, keys matching the names of builtins and keys containing double underscores will now raise a ValueError.
ImageFile.raise_oserror() has been deprecated and will be removed in Pillow 12.0.0 (2025-10-15). The function is undocumented and is only useful for translating error codes returned by a codec's decode() method, which ImageFile already does automatically.
The functions IptcImageFile.dump and IptcImageFile.i, and the constant IptcImageFile.PAD have been deprecated and will be removed in Pillow 12.0.0 (2025-10-15). These are undocumented helper functions intended for internal use, so there is no replacement. They can each be replaced by a single line of code using builtin functions in Python.
When creating a ~PIL.ImageFont.FreeTypeFont instance, either directly or through ~PIL.ImageFont.truetype, if the font size is zero or less, a ValueError will now be raised.
~PIL.DdsImagePlugin.DDSD, ~PIL.DdsImagePlugin.DDSCAPS, ~PIL.DdsImagePlugin.DDSCAPS2, ~PIL.DdsImagePlugin.DDPF, ~PIL.DdsImagePlugin.DXGI_FORMAT and ~PIL.DdsImagePlugin.D3DFMT enums have been added to PIL.DdsImagePlugin.
When saving JPEG files, keep_rgb can now be set to True. This will store RGB images in the RGB color space instead of being converted to YCbCr automatically by libjpeg. When this option is enabled, attempting to chroma-subsample RGB images with the subsampling option will raise an OSError.
When saving JPEG files, restart_marker_blocks and restart_marker_rows can now be used to emit restart markers whenever the specified number of MCU blocks or rows have been produced.
When saving JPEG files, streamtype can now be set to 1, for tables-only. This will output only the quantization and Huffman tables for the image.
Support has been added to read the BC4U format of DDS images.
Support has also been added to read DX10 BC1 and BC4, whether UNORM or TYPELESS.
All masks are now supported when reading DDS images with uncompressed RGB data, allowing for bit counts other than 24 and 32.
When saving TIFF images, the TIFF tag RowsPerStrip can now be one of the tags set by the user, rather than always being calculated by Pillow.
The color calculations of ~PIL.ImageColor.getrgb and ~PIL.ImageColor.getcolor are now cached using functools.lru_cache. Cached calls of getrgb are 3.1 - 91.4 times as fast and getcolor are 5.1 - 19.6 times as fast.
The lookups made by ~PIL.ImageMode.getmode are now cached using functools.lru_cache instead of a custom cache. Cached calls are 1.2 times as fast.
Calculating the ~PIL.ImageStat.Stat.count and ~PIL.ImageStat.Stat.extrema statistics is now faster. After the histogram is created in st = ImageStat.Stat(im), st.count is 3 times as fast on average and st.extrema is 12 times as fast on average.
OSError exceptions from image encoders now include a textual description of the error instead of a numeric error code.
Work has begun to add type annotations to Pillow, including:
~PIL.ContainerIO
~PIL.FontFile, ~PIL.BdfFontFile and ~PIL.PcfFontFile
~PIL.ImageChops
~PIL.ImageMode
~PIL.ImageSequence
~PIL.ImageTransform
~PIL.TarIO
https://pillow.readthedocs.io/en/stable/releasenotes/10.1.0.html
https://pillow.readthedocs.io/en/stable/releasenotes/10.1.0.html
Added TrueType default font to allow for different sizes #7354 [radarhere]
Fixed invalid argument warning #7442 [radarhere]
Added ImageOps cover method #7412 [radarhere, hugovk]
Catch struct.error from truncated EXIF when reading JPEG DPI #7458 [radarhere]
Consider default image when selecting mode for PNG save_all #7437 [radarhere]
Support BGR;15, BGR;16 and BGR;24 access, unpacking and putdata #7303 [radarhere]
Added CMYK to RGB unpacker #7310 [radarhere]
Improved flexibility of XMP parsing #7274 [radarhere]
Support reading 8-bit YCbCr TIFF images #7415 [radarhere]
Allow saving I;16B images as PNG #7302 [radarhere]
Corrected drawing I;16 points and writing I;16 text #7257 [radarhere]
Set blue channel to 128 for BC5S #7413 [radarhere]
Increase flexibility when reading IPTC fields #7319 [radarhere]
Set C palette to be empty by default #7289 [radarhere]
Added gs_binary to control Ghostscript use on all platforms #7392 [radarhere]
Read bounding box information from the trailer of EPS files if specified #7382 [nopperl, radarhere]
Added reading 8-bit color DDS images #7426 [radarhere]
Added has_transparency_data #7420 [radarhere, hugovk]
Fixed bug when reading BC5S DDS images #7401 [radarhere]
Prevent TIFF orientation from being applied more than once #7383 [radarhere]
Use previous pixel alpha for QOI_OP_RGB #7357 [radarhere]
Added BC5U reading #7358 [radarhere]
Allow getpixel() to accept a list #7355 [radarhere, homm]
Allow GaussianBlur and BoxBlur to accept a sequence of x and y radii #7336 [radarhere]
Expand JPEG buffer size when saving optimized or progressive #7345 [radarhere]
Added session type check for Linux in ImageGrab.grabclipboard() #7332 [TheNooB2706, radarhere, hugovk]
Allow "loop=None" when saving GIF images #7329 [radarhere]
Fixed transparency when saving P mode images to PDF #7323 [radarhere]
Added saving LA images as PDFs #7299 [radarhere]
Set SMaskInData to 1 for PDFs with alpha #7316, #7317 [radarhere]
Changed Image mode property to be read-only by default #7307 [radarhere]
Silence exceptions in _repr_jpeg_ and _repr_png_ #7266 [mtreinish, radarhere]
Do not use transparency when saving GIF if it has been removed when normalizing mode #7284 [radarhere]
Fix missing symbols when libtiff depends on libjpeg #7270 [heitbaum]
If you attempt to set the mode of an image directly, e.g. im.mode = "RGBA", you will now receive an AttributeError. This is not about removing existing functionality, but instead about raising an explicit error to prevent later consequences. The convert method is the correct way to change an image's mode.
~PIL.Image.Image.getpixel now accepts a list of coordinates, as well as a tuple.
from PIL import Image
im = Image.new("RGB", (1, 1))
im.getpixel((0, 0))
im.getpixel([0, 0])
~PIL.ImageFilter.BoxBlur and ~PIL.ImageFilter.GaussianBlur now allow a sequence of x and y radii to be specified, rather than a single number for both dimensions.
from PIL import ImageFilter ImageFilter.BoxBlur((2, 5)) ImageFilter.GaussianBlur((2, 5))
EpsImagePlugin.gs_windows_binary stores the name of the Ghostscript executable on Windows. EpsImagePlugin.gs_binary has now been added for all platforms, and can be used to customise the name of the executable, or disable use entirely through EpsImagePlugin.gs_binary = False.
Images now have ~PIL.Image.Image.has_transparency_data to indicate whether the image has transparency data, whether in the form of an alpha channel, a palette with an alpha channel, or a "transparency" key in the ~PIL.Image.Image.info dictionary.
Even if this attribute is true, the image might still appear solid, if all of the values shown within are opaque.
Returns a resized version of the image, so that the requested size is covered, while maintaining the original aspect ratio.
See relative-resize for a comparison between this and similar ImageOps methods.
Pillow has had a "better than nothing" default font, which can only be drawn at one font size. Now, if FreeType support is available, a version of Aileron Regular is loaded, which can be drawn at chosen font sizes.
The following size and font_size arguments can now be used to specify a font size for this new builtin font:
ImageFont.load_default(size=24) draw.text((0, 0), "test", font_size=24) draw.textlength((0, 0), "test", font_size=24) draw.textbbox((0, 0), "test", font_size=24) draw.multiline_text((0, 0), "test", font_size=24) draw.multiline_textbbox((0, 0), "test", font_size=24)
Pillow 10.0.0 had wheels built against Python 3.12 beta, available as a preview to help others prepare for 3.12, and to ensure Pillow could be used immediately at the release of 3.12.0 final (2023-10-02, 693).
Pillow 10.1.0 now officially supports Python 3.12.
Support has been added to read BC5U DDS files as RGB images, and PALETTEINDEXED8 DDS files as P mode images.
TIFF images with unsigned integer data, 8 bits per sample and a photometric interpretation of YCbCr can now be read.
https://pillow.readthedocs.io/en/stable/releasenotes/10.0.1.html
https://pillow.readthedocs.io/en/stable/releasenotes/10.0.1.html
Updated libwebp to 1.3.2 #7395 [radarhere]
Updated zlib to 1.3 #7344 [radarhere]
This release provides an updated install script and updated wheels to include libwebp 1.3.2, preventing a potential heap buffer overflow in WebP.
The release of zlib 1.3 caused one of the tests in the Pillow test suite to fail.
Remove deprecated ImageFont.getsize and related functions for Pillow 10.0.0 #7080 [@radarhere]
https://pillow.readthedocs.io/en/stable/releasenotes/10.0.0.html
grabclipboard() to use PNG compression on macOS #7219 [@abey79]Image.open() seeks to the start of file objects #7097 [@radarhere]Fixed deallocating mask images #7246 [radarhere]
Added ImageFont.MAX_STRING_LENGTH #7244 [radarhere, hugovk]
Fix Windows build with pyproject.toml #7230 [hugovk, nulano, radarhere]
Do not close provided file handles with libtiff #7199 [radarhere]
Convert to HSV if mode is HSV in getcolor() #7226 [radarhere]
Added alpha_only argument to getbbox() #7123 [radarhere. hugovk]
Prioritise speed in _repr_png_ #7242 [radarhere]
Do not use CFFI access by default on PyPy #7236 [radarhere]
Limit size even if one dimension is zero in decompression bomb check #7235 [radarhere]
Use --config-settings instead of deprecated --global-option #7171 [radarhere]
Better C integer definitions #6645 [Yay295, hugovk]
Fixed finding dependencies on Cygwin #7175 [radarhere]
Changed grabclipboard() to use PNG instead of JPG compression on macOS #7219 [abey79, radarhere]
Added in_place argument to ImageOps.exif_transpose() #7092 [radarhere]
Fixed calling putpalette() on L and LA images before load() #7187 [radarhere]
Fixed saving TIFF multiframe images with LONG8 tag types #7078 [radarhere]
Fixed combining single duration across duplicate APNG frames #7146 [radarhere]
Remove temporary file when error is raised #7148 [radarhere]
Do not use temporary file when grabbing clipboard on Linux #7200 [radarhere]
If the clipboard fails to open on Windows, wait and try again #7141 [radarhere]
Fixed saving multiple 1 mode frames to GIF #7181 [radarhere]
Replaced absolute PIL import with relative import #7173 [radarhere]
Replaced deprecated Py_FileSystemDefaultEncoding for Python >= 3.12 #7192 [radarhere]
Improved wl-paste mimetype handling in ImageGrab #7094 [rrcgat, radarhere]
Added _repr_jpeg_() for IPython display_jpeg #7135 [n3011, radarhere, nulano]
Use "/sbin/ldconfig" if ldconfig is not found #7068 [radarhere]
Prefer screenshots using XCB over gnome-screenshot #7143 [nulano, radarhere]
Fixed joined corners for ImageDraw rounded_rectangle() odd dimensions #7151 [radarhere]
Support reading signed 8-bit TIFF images #7111 [radarhere]
Added width argument to ImageDraw regular_polygon #7132 [radarhere]
Support I mode for ImageFilter.BuiltinFilter #7108 [radarhere]
Raise error from stderr of Linux ImageGrab.grabclipboard() command #7112 [radarhere]
Added unpacker from I;16B to I;16 #7125 [radarhere]
Support float font sizes #7107 [radarhere]
Use later value for duplicate xref entries in PdfParser #7102 [radarhere]
Load before getting size in __getstate__ #7105 [bigcat88, radarhere]
Fixed type handling for include and lib directories #7069 [adisbladis, radarhere]
Remove deprecations for Pillow 10.0.0 #7059, #7080 [hugovk, radarhere]
Drop support for soon-EOL Python 3.7 #7058 [hugovk, radarhere]
When performing decompression bomb checks, Pillow did not reject images with excessive width and zero height, or zero width and excessive height. That has now been fixed.
This effectively dates to the PIL fork, since problem images would still have been processed before Pillow started checking for decompression bombs.
To protect against potential DOS attacks when using arbitrary strings as text input, Pillow will now raise a ValueError if the number of characters passed into ImageFont methods is over a certain limit, PIL.ImageFont.MAX_STRING_LENGTH.
This threshold can be changed by setting PIL.ImageFont.MAX_STRING_LENGTH. It can be disabled by setting ImageFont.MAX_STRING_LENGTH = None.
im.category has been removed, along with the related Image.NORMAL, Image.SEQUENCE and Image.CONTAINER attributes.
To determine if an image has multiple frames or not, getattr(im, "is_animated", False) can be used instead.
Support for Tk/Tcl 8.4 has been removed.
Since deprecation in Pillow 8.3.0, the convert_dict_qtables method no longer performed any operations on the data given to it, and has been removed.
Before Pillow 8.3.0, ImagePalette required palette data of particular lengths by default, and the size parameter could be used to override that. Pillow 8.3.0 removed the default required length, also removing the need for the size parameter.
The file argument in ~PIL.ImageShow.Viewer.show_file() has been removed and replaced by path.
In effect, viewer.show_file("test.jpg") will continue to work unchanged.
A number of constants have been removed. Instead, enum.IntEnum classes have been added.
Removed |
Use instead |
|---|---|
Image.LINEAR |
Image.BILINEAR or Image.Resampling.BILINEAR |
Image.CUBIC |
Image.BICUBIC or Image.Resampling.BICUBIC |
Image.ANTIALIAS |
Image.LANCZOS or Image.Resampling.LANCZOS |
ImageCms.INTENT_PERCEPTUAL |
ImageCms.Intent.PERCEPTUAL |
ImageCms.INTENT_RELATIVE_COLORMETRIC |
ImageCms.Intent.RELATIVE_COLORMETRIC |
ImageCms.INTENT_SATURATION |
ImageCms.Intent.SATURATION |
ImageCms.INTENT_ABSOLUTE_COLORIMETRIC |
ImageCms.Intent.ABSOLUTE_COLORIMETRIC |
ImageCms.DIRECTION_INPUT |
ImageCms.Direction.INPUT |
ImageCms.DIRECTION_OUTPUT |
ImageCms.Direction.OUTPUT |
ImageCms.DIRECTION_PROOF |
ImageCms.Direction.PROOF |
ImageFont.LAYOUT_BASIC |
ImageFont.Layout.BASIC |
ImageFont.LAYOUT_RAQM |
ImageFont.Layout.RAQM |
BlpImagePlugin.BLP_FORMAT_JPEG |
BlpImagePlugin.Format.JPEG |
BlpImagePlugin.BLP_ENCODING_UNCOMPRESSED |
BlpImagePlugin.Encoding.UNCOMPRESSED |
BlpImagePlugin.BLP_ENCODING_DXT |
BlpImagePlugin.Encoding.DXT |
BlpImagePlugin.BLP_ENCODING_UNCOMPRESSED_RAW_RGBA |
BlpImagePlugin.Encoding.UNCOMPRESSED_RAW_RGBA |
BlpImagePlugin.BLP_ALPHA_ENCODING_DXT1 |
BlpImagePlugin.AlphaEncoding.DXT1 |
BlpImagePlugin.BLP_ALPHA_ENCODING_DXT3 |
BlpImagePlugin.AlphaEncoding.DXT3 |
BlpImagePlugin.BLP_ALPHA_ENCODING_DXT5 |
BlpImagePlugin.AlphaEncoding.DXT5 |
FtexImagePlugin.FORMAT_DXT1 |
FtexImagePlugin.Format.DXT1 |
FtexImagePlugin.FORMAT_UNCOMPRESSED |
FtexImagePlugin.Format.UNCOMPRESSED |
PngImagePlugin.APNG_DISPOSE_OP_NONE |
PngImagePlugin.Disposal.OP_NONE |
PngImagePlugin.APNG_DISPOSE_OP_BACKGROUND |
PngImagePlugin.Disposal.OP_BACKGROUND |
PngImagePlugin.APNG_DISPOSE_OP_PREVIOUS |
PngImagePlugin.Disposal.OP_PREVIOUS |
PngImagePlugin.APNG_BLEND_OP_SOURCE |
PngImagePlugin.Blend.OP_SOURCE |
PngImagePlugin.APNG_BLEND_OP_OVER |
PngImagePlugin.Blend.OP_OVER |
The stub image plugin FitsStubImagePlugin has been removed. FITS images can be read without a handler through ~PIL.FitsImagePlugin instead.
Several functions for computing the size and offset of rendered text have been removed:
Removed |
Use instead |
|---|---|
FreeTypeFont.getsize() and FreeTypeFont.getoffset() |
.FreeTypeFont.getbbox and .FreeTypeFont.getlength |
FreeTypeFont.getsize_multiline() |
.ImageDraw.multiline_textbbox |
ImageFont.getsize() |
.ImageFont.getbbox and .ImageFont.getlength |
TransposedFont.getsize() |
.TransposedFont.getbbox and .TransposedFont.getlength |
ImageDraw.textsize() and ImageDraw.multiline_textsize() |
.ImageDraw.textbbox, .ImageDraw.textlength and .ImageDraw.multiline_textbbox |
ImageDraw2.Draw.textsize() |
.ImageDraw2.Draw.textbbox and .ImageDraw2.Draw.textlength |
The undocumented fill parameter of .FreeTypeFont.getmask2 has been removed.
The box parameter was unused and has been removed.
Qt 5 reached end-of-life on 2020-12-08 for open-source users (and will reach EOL on 2023-12-08 for commercial licence holders).
Support for PyQt5 and PySide2 has been removed from ImageQt. Upgrade to PyQt6 or PySide6 instead.
This undocumented method has been removed.
Since Pillow's C API is now faster than PyAccess on PyPy, !PyAccess has been deprecated and will be removed in Pillow 11.0.0 (2024-10-15). Pillow's C API will now be used by default on PyPy instead.
Image.USE_CFFI_ACCESS, for switching from the C API to PyAccess, is similarly deprecated.
An optional line width parameter has been added to ImageDraw.Draw.regular_polygon.
~PIL.Image.Image.getbbox now accepts a keyword argument of alpha_only. This is an optional flag, defaulting to True. If True and the image has an alpha channel, trim transparent pixels. Otherwise, trim pixels when all channels are zero.
32-bit wheels are no longer provided.
In addition to display() and display_png, display_jpeg() can now also be used to display images in IPython:
from PIL import Image
from IPython.display import display_jpeg
im = Image.new("RGB", (100, 100), (255, 0, 0))
display_jpeg(im)
TIFF images with signed integer data, 8 bits per sample and a photometric interpretation of BlackIsZero can now be read.
Refactor EpsImagePlugin and deprecate PSFile #6879 [@Yay295]
https://pillow.readthedocs.io/en/stable/releasenotes/9.5.0.html
Added ImageSourceData to TAGS_V2 #7053 [radarhere]
Clear PPM half token after use #7052 [radarhere]
Removed absolute path to ldconfig #7044 [radarhere]
Support custom comments and PLT markers when saving JPEG2000 images #6903 [joshware, radarhere, hugovk]
Load before getting size in __array_interface__ #7034 [radarhere]
Support creating BGR;15, BGR;16 and BGR;24 images, but drop support for BGR;32 #7010 [radarhere]
Consider transparency when applying APNG blend mask #7018 [radarhere]
Round duration when saving animated WebP images #6996 [radarhere]
Added reading of JPEG2000 comments #6909 [radarhere]
Decrement reference count #7003 [radarhere, nulano]
Allow libtiff_support_custom_tags to be missing #7020 [radarhere]
Improved I;16N support #6834 [radarhere]
Added QOI reading #6852 [radarhere, hugovk]
Added saving RGBA images as PDFs #6925 [radarhere]
Do not raise an error if os.environ does not contain PATH #6935 [radarhere, hugovk]
Close OleFileIO instance when closing or exiting FPX or MIC #7005 [radarhere]
Added __int__ to IFDRational for Python >= 3.11 #6998 [radarhere]
Added memoryview support to Dib.frombytes() #6988 [radarhere, nulano]
Close file pointer copy in the libtiff encoder if still open #6986 [fcarron, radarhere]
Raise an error if ImageDraw co-ordinates are incorrectly ordered #6978 [radarhere]
Added "corners" argument to ImageDraw rounded_rectangle() #6954 [radarhere]
Added memoryview support to frombytes() #6974 [radarhere]
Allow comments in FITS images #6973 [radarhere]
Support saving PDF with different X and Y resolutions #6961 [jvanderneutstulen, radarhere, hugovk]
Fixed writing int as UNDEFINED tag #6950 [radarhere]
Raise an error if EXIF data is too long when saving JPEG #6939 [radarhere]
Handle more than one directory returned by pkg-config #6896 [sebastic, radarhere]
Do not retry past formats when loading all formats for the first time #6902 [radarhere]
Do not retry specified formats if they failed when opening #6893 [radarhere]
Do not unintentionally load TIFF format at first #6892 [radarhere]
Stop reading when EPS line becomes too long #6897 [radarhere]
Allow writing IFDRational to BYTE tag #6890 [radarhere]
Raise ValueError for BoxBlur filter with negative radius #6874 [hugovk, radarhere]
Support arbitrary number of loaded modules on Windows #6761 [javidcf, radarhere, nulano]
Image files that are small on disk are often prevented from expanding to be big images consuming a large amount of resources simply because they lack the data to populate those resources.
PpmImagePlugin might hold onto the last data read for a pixel value in case the pixel value has not been finished yet. However, that data was not being cleared afterwards, meaning that infinite data could be available to fill any image size. This has been present since Pillow 9.2.0.
That data is now cleared after use.
If Pillow incorrectly saved the TIFF tag ImageSourceData as ASCII instead of UNDEFINED, a segmentation fault was triggered.
The correct tag type will now be used by default instead.
The !PSFile class has been deprecated and will be removed in Pillow 11 (2024-10-15). This class was only made as a helper to be used internally, so there is no replacement. If you need this functionality though, it is a very short class that can easily be recreated in your own code.
Pillow can now read images in Quite OK Image format.
When saving a PDF, resolution could already be specified using the resolution argument. Now, a tuple of (x_resolution, y_resolution) can be provided as dpi. If both are provided, dpi will override resolution.
.ImageDraw.rounded_rectangle now accepts a keyword argument of corners. This a tuple of Booleans, specifying whether to round each corner, (top_left, top_right, bottom_right, bottom_left).
When opening a JPEG2000 image, the comment may now be read into ~PIL.Image.Image.info. The comment keyword argument can be used to save it back again.
If OpenJPEG 2.4.0 or later is available and the plt keyword argument is present and true when saving JPEG2000 images, tell the encoder to generate PLT markers.
Using the JPXDecode filter, PDFs can now be saved in RGBA mode.
Support has been added for I;16N access, packing and unpacking. Conversion to and from L mode has also been added.
It is now possible to create new BGR;15, BGR;16 and BGR;24 images. Conversely, BGR;32 has been removed from ImageMode and its associated methods, dropping the little support Pillow had for the mode.
With that, all modes listed under concept-modes can now be used to create a new image.
One column per quarter.