pypi / pillow
pillow
What changed in pillow 12 to 13, from its official release notes, upgrade guides and advisories. Also covers types-pillow. Sources checked 2026-10-18.
42 breaking25 security9 deprecations11 new APIs and options20 performance17 behavior and defaults64 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpillow 1379 changes
Breaking changes 24
Duration and timestamp are removed from AVIF info after seek.
Invalid and non-finite radii are rejected.
The Makernote IFD constant is removed.
FITS data is treated as big-endian.
The undocumented GIF saving helper is removed.
When an ICO image is smaller than 16×16, saving preserves its original size by default.
When saving a frame without a matching size, the next smallest provided image is used.
Exporting Arrow arrays from non-contiguous images is rejected.
Calling quantize() with an empty palette now raises an error.
When height is scaled down significantly more than width, resizing now proceeds vertically first.
RGBA and LA resizing now uses reducing_gap.
Pen widths are used when drawing shape outlines.
Invalid arguments now raise ValueError instead of triggering an assertion.
Values of bits outside 1–8 now raise ValueError.
Creating an ImagePalette with an unsupported mode now raises an error.
Text is wrapped even when no scaling is required.
JPEG streams with scanlines that are too wide or have too many components are rejected.
The default max_nesting limit is set to 900.
Support for Python 3.10 is dropped; developers must use a supported Python version.
TIFFs whose unpacker row is wider than libtiff's decoded row are rejected.
The first of duplicate TIFF tags is retained.
Duration and timestamp are removed from WebP info after seek.
WMF dimensions are limited to 0–65535 when loading.
XMP info is no longer a tuple.
Security 4
Decompression bomb checks are added when seek opens a new format and after SPIDER seek.
Ghostscript is prevented from rendering beyond the decompression bomb limit.
A decompression bomb check is added for Windows clipboard images.
Retained TIFF tag data is bounded by the stream size.
Deprecations 3
The IM image format is deprecated.
ImageQt.align8to32() is deprecated in favour of the raw encoder stride.
JpegImageFile.load_djpeg is deprecated.
New APIs and options 3
Image.getxmp() gains a strip_namespaces argument.
Magic Kernel Sharp resizing modes are now supported.
PSDraw.text gains an escape argument.
Performance 5
Image.filter() is faster for I;16* modes.
getpixel() and get_flattened_data() are faster.
Image.offset is faster.
ImageChops.difference() is faster.
PDF object IDs are assigned in constant time.
Behavior and default changes 9
Explicit BASIC layout is respected in font_variant().
ImageMath operations now accept floating point constants.
ImageOps invert, posterize, and solarize now support P images.
ImageOps can now create images with zero dimensions.
Font handling now supports pathlib paths.
Pillow adds support for Python 3.15.
Zero-length members in tar files are supported.
Greyscale TIFFs with ExtraSamples 0 or 1 are supported.
XBM headers now allow C comments.
Fixes and other changes 31
Decoding an AVIF image no longer blocks all threads.
Truncated or corrupt gzip FITS data now raises OSError.
Invalid radii are rejected.
Converting from I;16N to I or F no longer clips 16-bit values.
Zero-dimension images can be passed to fromarrow().
Image.getbbox() is faster and is fixed for I;16 modes.
Zero-dimension images are supported by related image filters and offset operations.
ImageChops.offset is fixed for 16-bit modes and is faster.
ImageColor.getcolor() now handles premultiplied alpha modes.
The border type hint is corrected.
The background color is corrected when padding P mode images.
Transparency is preserved when padding and expanding images.
compact() returns zero when there are no points to remove.
The image position is restored after an error.
ImageStat variance is prevented from becoming negative.
Opening a JP2 image with an unrecognized mode now raises an error.
Unexpected end-of-file in a JPEG header is handled.
PDF page trees are walked iteratively, and page loops raise an error.
Support for PyPy 3.12 is added.
Truncated tRNS, gAMA, and cHRM chunks now raise ValueError.
The bits option is applied when saving L mode PNG images, without padding the palette when bits is specified.
PSD layer tiles are read from the correct file offset.
TIFF tag values are validated against libtiff's field definitions before being passed to TIFFSetField.
TIFF strip and tile buffers are cleared beyond previously decoded data.
TIFF ColorMap length is corrected when saving with libtiff.
TIFF seek no longer changes MicImageFile frame count or animation state.
TIFF scanline geometry tags are taken from the image rather than tiffinfo or EXIF.
A heap buffer overflow when saving TIFF to BytesIO is fixed.
TIFFs with unexpected tile sizes now raise OSError.
TIFF ColorMap length is checked against BitsPerSample.
The WebP canvas size is checked before creating a decoder.
pillow 12109 changes
Breaking changes 18
FontFile classes now perform decompression bomb checks.
Non-image modes are no longer supported by ImageCms.
ImageMath.unsafe_eval() no longer sets eval() globals.
macOS retina screenshots are no longer resized by default.
1 mode images are no longer saved as TGA with run-length encoding.
Raises ValueError if the tag value is not bytes.
Raises ValueError if the tag value is not bytes.
Rejects non-numeric elements in list coordinates.
Always calls StubHandler open() when opening a StubImageFile.
Resizes tall images vertically first.
Deleting an EXIF IFD tag now also deletes its IFD data.
FreeType versions 2.9.0 and earlier are no longer supported.
Quantizing RGB images now fills the alpha channel.
ImageMorph operations must have length 1.
Negative offsets are no longer allowed with memory mapping.
Support for PyPy3.10 was dropped.
Support for Python 3.9 was dropped, so applications need a supported Python version to use this release.
Converting RGBA to PA now uses RGB-to-P quantization.
Security 21
A decompression bomb check is now applied to GdImageFile.
Pillow
BdfFontFile:Image.new()called without_decompression_bomb_check()— bomb protection bypass via font loadingPillow: Controlled heap out-of-bounds write in Pillow
ImageCmsTransform.apply()via output mode mismatchPillow: Decompression Bomb DoS via PdfParser.PdfStream.decode()
Pillow EpsImagePlugin negative %%BeginBinary byte count causes infinite loop denial of service
Pillow:
FontFile.compile():Image.new()called without_decompression_bomb_check()Pillow
GdImageFile._open(): image dimensions accepted without_decompression_bomb_check()Pillow: Heap out-of-bounds write
Image.paste()/Image.crop()via signed coordinate overflowPillow: Heap out-of-bounds write in
ImageFilter.RankFiltervia integer overflow inImagingExpandPillow JPEG2000 tiled decode retains a growing scratch buffer and can be used for denial of service
Pillow: Out-of-bounds read via attacker-controlled row stride on Pillow's mmap path (McIdas AREA files)
Pillow
PcfFontFile._load_bitmaps():Image.frombytes()called without_decompression_bomb_check()— bomb protection bypass via PCF font loadingPillow TGA RLE encoder can serialize up to ~57 KB of adjacent heap data into generated images
Pillow: WindowsViewer.get_command() OS command injection via unescaped shell path
FITS GZIP decompression bomb in Pillow
Pillow has a heap buffer overflow with nested list coordinates
Pillow has a PDF Parsing Trailer Infinite Loop (DoS)
Pillow has an integer overflow when processing fonts
Pillow has an OOB Write with Invalid PSD Tile Extents (Integer Overflow)
Pillow affected by out-of-bounds write when loading PSD images
The length of read operations is now limited when loading PIL font data.
Deprecations 6
A new method is available as the preferred alternative to getdata().
getdata() is deprecated in favour of get_flattened_data().
Image._show is deprecated; developers using this API should plan to stop relying on it.
The mode parameter is deprecated only when it changes the data type.
The product_info attribute is deprecated.
The product_name attribute is deprecated.
New APIs and options 8
An abstract BaseImageFont class is added.
ImageFont can also be used with ImageText.
ImageFont can also be used with ImageText.
Adds FontFile.to_imagefont().
Adds the Exif tag FrameRate.
Adds text wrapping through ImageText.Text.wrap().
Font variation styles can now be duplicated.
On macOS, ImageGrab.grab() can now receive a window ID.
Performance 15
alpha_composite is faster.
Image.blend() is faster.
Image.fill() is faster.
Image.filter() is faster.
Image.getchannel() is faster.
Image.linear_gradient() is faster.
Image.merge() is faster.
Image.putalpha() is faster.
Image.radial_gradient() is faster.
Image.resample() is faster.
Image.split() is faster.
ImageChops operations are faster.
matrix is faster.
negative is faster.
quantize is faster.
Behavior and default changes 8
Opening and saving L mode AVIF images is supported with libavif 1.3.0 or newer.
Adds support for reading JPEG2000 images with CMYK palettes.
Saving APNG images now supports float durations.
build_default_lut() now returns the LUT.
MorphOp now allows 1 mode images.
Writing IFD, SIGNED_RATIONAL, and InkNames TIFF tags is now supported.
alpha_composite now supports LA images.
Saving variable length rational TIFF tags is supported by default.
Fixes and other changes 33
The XOR mask is now applied to 1 and L mode CUR images.
Raises ValueError if the tile size is not 64px by 64px.
Raises ValueError when P;2L or P;4L data is truncated.
Raises ValueError if the border format is unsupported.
Raises OverflowError if the number of vertices is too large.
Parsing PSD layers no longer raises an error for an unknown channel ID.
The type hint for xy now allows lists.
Size and rank are validated when initializing RankFilter, and large filter sizes are validated.
Corrects the error check when encoding AVIF images.
Corrects BMP pixel data offsets when palette entries have different sizes.
Fixes BMP RLE delta escape reading from the wrong file position.
Encoding an empty image raises ValueError.
Raises an error if the ImageGrab subprocess returns a non-zero return code.
Closes the file handle only when ImagePalette.save() opened it internally.
Does not use palettes from grayscale or bilevel colorspaces when reading JPEG2000 images.
Raises EOFError when seeking too far in PSD data.
Fills the alpha channel when a TGA v2 extension area specifies no alpha.
Ignores unspecified extra samples for TIFF separate planar configuration.
Raises an error when a trailer chain loops back on itself.
Fixes an unexpected error when saving images with zero dimensions.
Fixed an out-of-bounds write when tile extents are invalid.
Patched libavif for compatibility with svt-av1 4.0, which matters when building Pillow with that version.
A ZeroDivisionError in DdsImagePlugin is fixed.
All non-zero transparency values are now read as 255.
Encoder options are now applied when saving multiple PNG frames.
Parsing EPS metadata now seeks past BeginBinary data.
Pasting an image onto itself at a lower position now copies from the bottom.
RGBA palettes are now supported when expanding images.
A ZeroDivisionError in ImageStat was fixed.
Reading RGB and CMYK IPTC images was fixed.
Python 3.14 is supported.
Loading rotated PCD images was fixed, including setting the correct size after opening.
Two-band histograms now use the correct bands.