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

4.3.0 (2017-10-02)

API changes

Deprecations

Several undocumented functions in ImageOps have been deprecated:gaussian_blur,gblur,unsharp_mask,usm andbox_blur. Use the equivalent operations inImageFilterinstead. These functions will be removed in a future release.

TIFF metadata changes

  • TIFF tags with unknown type/quantity now default to being barevalues if they are 1 element, where previously they would be asingle element tuple. This is only with the new api, not the legacyapi. This normalizes the handling of fields, so that the metadatawith inferred or image specified counts are handled the same asmetadata with count specified in the TIFF spec.

  • ThePhotoshopInfo,XMP, andJPEGTables tags now have adefined type (bytes) and a count of 1.

  • TheImageJMetaDataByteCounts tag now has an arbitrary number ofitems, as there can be multiple items, one for UTF-8, and one forUTF-16.

Core Image API changes

These are internal functions that should not have been used by usercode, but they were accessible from the python layer.

Debugging code withinImage.core.grabclipboard was removed. It had beenmarked aswillberemovedinfutureversions since PIL. When enabled, itidentified the format of the clipboard data.

ThePIL.Image.core.copy andPIL.Image.Image.im.copy2 methodshave been removed.

ThePIL.Image.core.getcount methods have been removed, usePIL.Image.core.get_stats()['new_count'] property instead.

API additions

Get one channel from image

A new methodPIL.Image.Image.getchannel() has been added toreturn a single channel by index or name. For example,image.getchannel("A") will return alpha channel as separate image.getchannel should work up to 6 times faster thanimage.split()[0] in previous Pillow versions.

Box blur

A new filter,PIL.ImageFilter.BoxBlur, has beenadded. This is a filter with similar results to a Gaussian blur, butis much faster.

Partial resampling

Added new argumentbox forPIL.Image.Image.resize(). Thisargument defines a source rectangle from within the source image to beresized. This is very similar to theimage.crop(box).resize(size)sequence except thatbox can be specified with subpixel accuracy.

New transpose operation

TheImage.TRANSVERSE operation has been added toPIL.Image.Image.transpose(). This is equivalent to a transposeoperation about the opposite diagonal.

Multiband filters

There is a newPIL.ImageFilter.MultibandFilter base classfor image filters that can run on all channels of an image in oneoperation. The originalPIL.ImageFilter.Filter classremains for image filters that can process only single band images, orrequire splitting of channels prior to filtering.

Other changes

Loading 16-bit TIFF images

Pillow now can read 16-bit multichannel TIFF files including fileswith alpha transparency. The image data is truncated to 8-bitprecision.

Pillow now can read 16-bit signed integer single channel TIFFfiles. The image data is promoted to 32-bit for storage andprocessing.

SGI images

Pillow can now read and write uncompressed 16-bit multichannel SGIimages to and from RGB and RGBA formats. The image data is truncatedto 8-bit precision.

Pillow can now read RLE encoded SGI images in both 8 and 16-bitprecision.

Performance

This release contains several performance improvements:

  • Many memory bandwidth-bounded operations such as crop, image allocation,conversion, split into bands and merging from bands are up to 2x faster.

  • Upscaling of multichannel images (such as RGB) is accelerated by 5-10%

  • JPEG loading is accelerated up to 15% and JPEG saving up to 20% whenusing a recent version of libjpeg-turbo.

  • Image.transpose has been accelerated 15% or more by using a cachefriendly algorithm.

  • ImageFilters based on Kernel convolution are significantly fasterdue to the newMultibandFilter feature.

  • All memory allocation for images is now done in blocks, rather thanfalling back to an allocation for each scan line for images largerthan the block size.

CMYK conversion

The basic CMYK->RGB conversion has been tweaked to match the formulafrom Google Chrome. This produces an image that is generally lighterthan the previous formula, and more in line with what color managedapplications produce.

On this page

[8]ページ先頭

©2009-2025 Movatter.jp