5.0.0
Backwards Incompatible Changes
Python 3.3 Dropped
Python 3.3 is EOL and no longer supported due to moving testing from nose,which is deprecated, to pytest, which doesn’t support Python 3.3. We will notbe creating binaries, testing, or retaining compatibility with this version.The final version of Pillow for Python 3.3 is 4.3.0.
Decompression Bombs now raise Exceptions
Pillow has previously emitted warnings for images that areunexpectedly large and may be a denial of service. These warnings arenow upgraded to DecompressionBombError
s for images that are twicethe size of images that trigger the DecompressionBombWarning
. Thedefault threshold is 128Mpx, or 0.5GB for an RGB
or RGBA
image. This can be disabled or changed by settingImage.MAX_IMAGE_PIXELS = None
.
Scripts
The scripts formerly installed by Pillow have been split into aseparate package, pillow-scripts, living athttps://github.com/python-pillow/pillow-scripts .
API Changes
OleFileIO.py
The olefile module is no longer a required dependency when installing Pillow.Support for plugins requiring olefile will not be loaded if it is notinstalled. This allows library consumers to avoid installing this dependencyif they choose. Some library consumers have little interest in the formatsupport and would like to keep dependencies to a minimum.
Further, the vendored version was removed in Pillow 4.0.0 and replaced with adeprecation warning that PIL.OleFileIO would be removed in a future version.This warning has been upgraded to an import error pending future removal.
Check parameter on _save
Several image plugins supported a named check
parameter on theirnominally private _save
method to preflight if the image could besaved in that format. That parameter has been removed.
API Additions
Image.transform
A new named parameter, fillcolor
, has been added toImage.transform
. This color specifies the background color to use inthe area outside the transformed area in the output image. Thisparameter takes the same color specifications as used in Image.new
.
GIF Disposal
Multiframe GIF images now take an optional disposal parameter tospecify the disposal option for changed pixels.
Other Changes
Compressed TIFF Images
Previously, there were some compression modes (JPEG, Packbits, andLZW) that were supported with Pillow’s internal TIFF decoder. Allcompressed TIFFs are now read using the libtiff
decoder, as itimplements the compression schemes more correctly.
Libraqm is now Dynamically Linked
The libraqm dependency for complex text scripts is now linkeddynamically at runtime rather than at packaging time. This allows usto release binaries with support for libraqm if it is installed on theuser’s machine.
Source Layout Changes
The Pillow source is now stored within the src
directory of thedistribution. This prevents accidental imports of the PIL directorywhen running Python from the project directory.
Setup.py Changes
Multiarch support on Linux should be more robust, especially on Debianderivatives on ARM platforms. Debian’s multiarch platformconfiguration is run in preference to the sniffing of machine platformand architecture.