unstale

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 init

@unstale/cli on npm

pillow 1379 changes

Breaking changes 24

  • Duration and timestamp are removed from AVIF info after seek.

    13.0.0release notes

  • Invalid and non-finite radii are rejected.

    13.0.0release notes

  • The Makernote IFD constant is removed.

    13.0.0release notes

  • FITS data is treated as big-endian.

    13.0.0release notes

  • The undocumented GIF saving helper is removed.

    13.0.0release notes

  • When an ICO image is smaller than 16×16, saving preserves its original size by default.

    13.0.0release notes

  • When saving a frame without a matching size, the next smallest provided image is used.

    13.0.0release notes

  • Exporting Arrow arrays from non-contiguous images is rejected.

    13.0.0release notes

  • Calling quantize() with an empty palette now raises an error.

    13.0.0release notes

  • When height is scaled down significantly more than width, resizing now proceeds vertically first.

    13.0.0release notes

  • RGBA and LA resizing now uses reducing_gap.

    13.0.0release notes

  • Pen widths are used when drawing shape outlines.

    13.0.0release notes

  • Invalid arguments now raise ValueError instead of triggering an assertion.

    13.0.0release notes

  • Values of bits outside 1–8 now raise ValueError.

    13.0.0release notes

  • Creating an ImagePalette with an unsupported mode now raises an error.

    13.0.0release notes

  • Text is wrapped even when no scaling is required.

    13.0.0release notes

  • JPEG streams with scanlines that are too wide or have too many components are rejected.

    13.0.0release notes

  • The default max_nesting limit is set to 900.

    13.0.0release notes

  • Support for Python 3.10 is dropped; developers must use a supported Python version.

    13.0.0release notes

  • TIFFs whose unpacker row is wider than libtiff's decoded row are rejected.

    13.0.0release notes

  • The first of duplicate TIFF tags is retained.

    13.0.0release notes

  • Duration and timestamp are removed from WebP info after seek.

    13.0.0release notes

  • WMF dimensions are limited to 0–65535 when loading.

    13.0.0release notes

  • XMP info is no longer a tuple.

    13.0.0release notes

Security 4

  • Decompression bomb checks are added when seek opens a new format and after SPIDER seek.

    13.0.0release notes

  • Ghostscript is prevented from rendering beyond the decompression bomb limit.

    13.0.0release notes

  • A decompression bomb check is added for Windows clipboard images.

    13.0.0release notes

  • Retained TIFF tag data is bounded by the stream size.

    13.0.0release notes

Deprecations 3

  • The IM image format is deprecated.

    13.0.0release notes

  • ImageQt.align8to32() is deprecated in favour of the raw encoder stride.

    13.0.0release notes

  • JpegImageFile.load_djpeg is deprecated.

    13.0.0release notes

New APIs and options 3

  • Image.getxmp() gains a strip_namespaces argument.

    13.0.0release notes

  • Magic Kernel Sharp resizing modes are now supported.

    13.0.0release notes

  • PSDraw.text gains an escape argument.

    13.0.0release notes

Performance 5

Behavior and default changes 9

Fixes and other changes 31

  • Decoding an AVIF image no longer blocks all threads.

    13.0.0release notes

  • Truncated or corrupt gzip FITS data now raises OSError.

    13.0.0release notes

  • Invalid radii are rejected.

    13.0.0release notes

  • Converting from I;16N to I or F no longer clips 16-bit values.

    13.0.0release notes

  • Zero-dimension images can be passed to fromarrow().

    13.0.0release notes

  • Image.getbbox() is faster and is fixed for I;16 modes.

    13.0.0release notes

  • Zero-dimension images are supported by related image filters and offset operations.

    13.0.0release notes

  • ImageChops.offset is fixed for 16-bit modes and is faster.

    13.0.0release notes

  • ImageColor.getcolor() now handles premultiplied alpha modes.

    13.0.0release notes

  • The border type hint is corrected.

    13.0.0release notes

  • The background color is corrected when padding P mode images.

    13.0.0release notes

  • Transparency is preserved when padding and expanding images.

    13.0.0release notes

  • compact() returns zero when there are no points to remove.

    13.0.0release notes

  • The image position is restored after an error.

    13.0.0release notes

  • ImageStat variance is prevented from becoming negative.

    13.0.0release notes

  • Opening a JP2 image with an unrecognized mode now raises an error.

    13.0.0release notes

  • Unexpected end-of-file in a JPEG header is handled.

    13.0.0release notes

  • PDF page trees are walked iteratively, and page loops raise an error.

    13.0.0release notes

  • Support for PyPy 3.12 is added.

    13.0.0release notes

  • Truncated tRNS, gAMA, and cHRM chunks now raise ValueError.

    13.0.0release notes

  • The bits option is applied when saving L mode PNG images, without padding the palette when bits is specified.

    13.0.0release notes

  • PSD layer tiles are read from the correct file offset.

    13.0.0release notes

  • TIFF tag values are validated against libtiff's field definitions before being passed to TIFFSetField.

    13.0.0release notes

  • TIFF strip and tile buffers are cleared beyond previously decoded data.

    13.0.0release notes

  • TIFF ColorMap length is corrected when saving with libtiff.

    13.0.0release notes

  • TIFF seek no longer changes MicImageFile frame count or animation state.

    13.0.0release notes

  • TIFF scanline geometry tags are taken from the image rather than tiffinfo or EXIF.

    13.0.0release notes

  • A heap buffer overflow when saving TIFF to BytesIO is fixed.

    13.0.0release notes

  • TIFFs with unexpected tile sizes now raise OSError.

    13.0.0release notes

  • TIFF ColorMap length is checked against BitsPerSample.

    13.0.0release notes

  • The WebP canvas size is checked before creating a decoder.

    13.0.0release notes

pillow 12109 changes

Breaking changes 18

  • FontFile classes now perform decompression bomb checks.

    12.3.0release notes

  • Non-image modes are no longer supported by ImageCms.

    12.3.0release notes

  • ImageMath.unsafe_eval() no longer sets eval() globals.

    12.3.0release notes

  • macOS retina screenshots are no longer resized by default.

    12.3.0release notes

  • 1 mode images are no longer saved as TGA with run-length encoding.

    12.3.0release notes

  • Raises ValueError if the tag value is not bytes.

    12.3.0release notes

  • Raises ValueError if the tag value is not bytes.

    12.3.0release notes

  • Rejects non-numeric elements in list coordinates.

    12.2.0release notes

  • Always calls StubHandler open() when opening a StubImageFile.

    12.2.0release notes

  • Resizes tall images vertically first.

    12.2.0release notes

  • Deleting an EXIF IFD tag now also deletes its IFD data.

    12.0.0release notes

  • FreeType versions 2.9.0 and earlier are no longer supported.

    12.0.0release notes

  • Quantizing RGB images now fills the alpha channel.

    12.0.0release notes

  • ImageMorph operations must have length 1.

    12.0.0release notes

  • Negative offsets are no longer allowed with memory mapping.

    12.0.0release notes

  • Support for PyPy3.10 was dropped.

    12.0.0release notes

  • Support for Python 3.9 was dropped, so applications need a supported Python version to use this release.

    12.0.0release notes

  • Converting RGBA to PA now uses RGB-to-P quantization.

    12.0.0release notes

Security 21

  • A decompression bomb check is now applied to GdImageFile.

    12.3.0release notes

  • Pillow BdfFontFile: Image.new() called without _decompression_bomb_check() — bomb protection bypass via font loading

    12.3.0security advisory

  • Pillow: Controlled heap out-of-bounds write in Pillow ImageCmsTransform.apply() via output mode mismatch

    12.3.0security advisory

  • Pillow: Decompression Bomb DoS via PdfParser.PdfStream.decode()

    12.3.0security advisory

  • Pillow EpsImagePlugin negative %%BeginBinary byte count causes infinite loop denial of service

    12.3.0security advisory

  • Pillow: FontFile.compile(): Image.new() called without _decompression_bomb_check()

    12.3.0security advisory

  • Pillow GdImageFile._open(): image dimensions accepted without _decompression_bomb_check()

    12.3.0security advisory

  • Pillow: Heap out-of-bounds write Image.paste() / Image.crop() via signed coordinate overflow

    12.3.0security advisory

  • Pillow: Heap out-of-bounds write in ImageFilter.RankFilter via integer overflow in ImagingExpand

    12.3.0security advisory

  • Pillow JPEG2000 tiled decode retains a growing scratch buffer and can be used for denial of service

    12.3.0security advisory

  • Pillow: Out-of-bounds read via attacker-controlled row stride on Pillow's mmap path (McIdas AREA files)

    12.3.0security advisory

  • Pillow PcfFontFile._load_bitmaps(): Image.frombytes() called without _decompression_bomb_check() — bomb protection bypass via PCF font loading

    12.3.0security advisory

  • Pillow TGA RLE encoder can serialize up to ~57 KB of adjacent heap data into generated images

    12.3.0security advisory

  • Pillow: WindowsViewer.get_command() OS command injection via unescaped shell path

    12.3.0security advisory

  • FITS GZIP decompression bomb in Pillow

    12.2.0security advisory

  • Pillow has a heap buffer overflow with nested list coordinates

    12.2.0security advisory

  • Pillow has a PDF Parsing Trailer Infinite Loop (DoS)

    12.2.0security advisory

  • Pillow has an integer overflow when processing fonts

    12.2.0security advisory

  • Pillow has an OOB Write with Invalid PSD Tile Extents (Integer Overflow)

    12.2.0security advisory

  • Pillow affected by out-of-bounds write when loading PSD images

    12.1.1security advisory

  • The length of read operations is now limited when loading PIL font data.

    12.0.0release notes

Deprecations 6

  • A new method is available as the preferred alternative to getdata().

    12.1.0release notes

  • getdata() is deprecated in favour of get_flattened_data().

    12.1.0release notes

  • Image._show is deprecated; developers using this API should plan to stop relying on it.

    12.0.0release notes

  • The mode parameter is deprecated only when it changes the data type.

    12.0.0release notes

  • The product_info attribute is deprecated.

    12.0.0release notes

  • The product_name attribute is deprecated.

    12.0.0release notes

New APIs and options 8

Performance 15

Behavior and default changes 8

  • Opening and saving L mode AVIF images is supported with libavif 1.3.0 or newer.

    12.3.0release notes

  • Adds support for reading JPEG2000 images with CMYK palettes.

    12.2.0release notes

  • Saving APNG images now supports float durations.

    12.1.0release notes

  • build_default_lut() now returns the LUT.

    12.1.0release notes

  • MorphOp now allows 1 mode images.

    12.1.0release notes

  • Writing IFD, SIGNED_RATIONAL, and InkNames TIFF tags is now supported.

    12.1.0release notes

  • alpha_composite now supports LA images.

    12.0.0release notes

  • Saving variable length rational TIFF tags is supported by default.

    12.0.0release notes

Fixes and other changes 33

  • The XOR mask is now applied to 1 and L mode CUR images.

    12.3.0release notes

  • Raises ValueError if the tile size is not 64px by 64px.

    12.3.0release notes

  • Raises ValueError when P;2L or P;4L data is truncated.

    12.3.0release notes

  • Raises ValueError if the border format is unsupported.

    12.3.0release notes

  • Raises OverflowError if the number of vertices is too large.

    12.3.0release notes

  • Parsing PSD layers no longer raises an error for an unknown channel ID.

    12.3.0release notes

  • The type hint for xy now allows lists.

    12.3.0release notes

  • Size and rank are validated when initializing RankFilter, and large filter sizes are validated.

    12.3.0release notes

  • Corrects the error check when encoding AVIF images.

    12.2.0release notes

  • Corrects BMP pixel data offsets when palette entries have different sizes.

    12.2.0release notes

  • Fixes BMP RLE delta escape reading from the wrong file position.

    12.2.0release notes

  • Encoding an empty image raises ValueError.

    12.2.0release notes

  • Raises an error if the ImageGrab subprocess returns a non-zero return code.

    12.2.0release notes

  • Closes the file handle only when ImagePalette.save() opened it internally.

    12.2.0release notes

  • Does not use palettes from grayscale or bilevel colorspaces when reading JPEG2000 images.

    12.2.0release notes

  • Raises EOFError when seeking too far in PSD data.

    12.2.0release notes

  • Fills the alpha channel when a TGA v2 extension area specifies no alpha.

    12.2.0release notes

  • Ignores unspecified extra samples for TIFF separate planar configuration.

    12.2.0release notes

  • Raises an error when a trailer chain loops back on itself.

    12.2.0release notes

  • Fixes an unexpected error when saving images with zero dimensions.

    12.2.0release notes

  • Fixed an out-of-bounds write when tile extents are invalid.

    12.1.1release notes

  • Patched libavif for compatibility with svt-av1 4.0, which matters when building Pillow with that version.

    12.1.1release notes

  • A ZeroDivisionError in DdsImagePlugin is fixed.

    12.1.0release notes

  • All non-zero transparency values are now read as 255.

    12.1.0release notes

  • Encoder options are now applied when saving multiple PNG frames.

    12.1.0release notes

  • Parsing EPS metadata now seeks past BeginBinary data.

    12.0.0release notes

  • Pasting an image onto itself at a lower position now copies from the bottom.

    12.0.0release notes

  • RGBA palettes are now supported when expanding images.

    12.0.0release notes

  • A ZeroDivisionError in ImageStat was fixed.

    12.0.0release notes

  • Reading RGB and CMYK IPTC images was fixed.

    12.0.0release notes

  • Python 3.14 is supported.

    12.0.0release notes

  • Loading rotated PCD images was fixed, including setting the correct size after opening.

    12.0.0release notes

  • Two-band histograms now use the correct bands.

    12.0.0release notes