Skip to content

Latest commit

 

History

History
101 lines (70 loc) · 2.77 KB

10.2.0.rst

File metadata and controls

101 lines (70 loc) · 2.77 KB

10.2.0

Backwards Incompatible Changes

TODO

TODO

Deprecations

ImageFile.raise_oserror

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.

TODO

TODO

API Changes

Zero or negative font size error

When creating a :py~PIL.ImageFont.FreeTypeFont instance, either directly or through :py~PIL.ImageFont.truetype, if the font size is zero or less, a :pyValueError will now be raised.

API Additions

Added DdsImagePlugin enums

:py~PIL.DdsImagePlugin.DDSD, :py~PIL.DdsImagePlugin.DDSCAPS, :py~PIL.DdsImagePlugin.DDSCAPS2, :py~PIL.DdsImagePlugin.DDPF, :py~PIL.DdsImagePlugin.DXGI_FORMAT and :py~PIL.DdsImagePlugin.D3DFMT enums have been added to :pyPIL.DdsImagePlugin.

JPEG RGB color space

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 :pyOSError.

JPEG restart marker interval

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.

JPEG tables-only streamtype

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.

Security

TODO

TODO

Other Changes

Added DDS BC4U and DX10 BC1 and BC4 reading

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.

Optimized ImageStat.Stat count and extrema

Calculating the :py~PIL.ImageStat.Stat.count and :py~PIL.ImageStat.Stat.extrema statistics is now faster. After the histogram is created in st = ImageStat.Stat(im), st.count is 3x as fast on average and st.extrema is 12x as fast on average.

Encoder errors now report error detail as string

:pyOSError exceptions from image encoders now include a textual description of the error instead of a numeric error code.