Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
Pillow (PIL Fork) 12.0.0 documentation
Light LogoDark Logo
Pillow (PIL Fork) 12.0.0 documentation
Back to top

9.5.0 (2023-04-01)

Security

Clear PPM half token after use

Image files that are small on disk are often prevented from expanding to bebig images consuming a large amount of resources simply because they lack thedata to populate those resources.

PpmImagePlugin might hold onto the last data read for a pixel value in case thepixel value has not been finished yet. However, that data was not being clearedafterwards, meaning that infinite data could be available to fill any imagesize. This has been present since Pillow 9.2.0.

That data is now cleared after use.

Saving TIFF tag ImageSourceData

If Pillow incorrectly saved the TIFF tag ImageSourceData as ASCII instead ofUNDEFINED, a segmentation fault was triggered.

The correct tag type will now be used by default instead.

Deprecations

PSFile

ThePSFile class has been deprecated and willbe removed in Pillow 11 (2024-10-15). This class was only made as a helper tobe used internally, so there is no replacement. If you need this functionalitythough, it is a very short class that can easily be recreated in your own code.

API additions

QOI file format

Pillow can now read images in Quite OK Image format.

Addeddpi argument when saving PDFs

When saving a PDF, resolution could already be specified using theresolution argument. Now, a tuple of(x_resolution,y_resolution) canbe provided asdpi. If both are provided,dpi will overrideresolution.

Addedcorners argument toImageDraw.rounded_rectangle()

ImageDraw.rounded_rectangle() now accepts a keyword argument ofcorners. This a tuple of Booleans, specifying whether to round each corner,(top_left,top_right,bottom_right,bottom_left).

JPEG2000 comments and PLT marker

When opening a JPEG2000 image, the comment may now be read intoinfo. Thecomment keyword argument can be usedto save it back again.

If OpenJPEG 2.4.0 or later is available and theplt keyword argumentis present and true when saving JPEG2000 images, tell the encoder to generatePLT markers.

Other changes

Added support for saving PDFs in RGBA mode

Using the JPXDecode filter, PDFs can now be saved in RGBA mode.

Improved I;16N support

Support has been added for I;16N access, packing and unpacking. Conversion toand from L mode has also been added.

BGR;* modes

It is now possible to create new BGR;15, BGR;16 and BGR;24 images. Conversely, BGR;32has been removed from ImageMode and its associated methods, dropping the little supportPillow had for the mode.

With that, all modes listed underModes can now be used to create a newimage.

On this page

[8]ページ先頭

©2009-2025 Movatter.jp