6.0.0
Backwards Incompatible Changes
Python 3.4 dropped
Python 3.4 is EOL since 2019-03-16 and no longer supported. We will not be creatingbinaries, testing, or retaining compatibility with this version. The final version ofPillow for Python 3.4 is 5.4.1.
Removed deprecated PIL.OleFileIO
PIL.OleFileIO was removed as a vendored file and in Pillow 4.0.0 (2017-01) in favour ofthe upstream olefile Python package, and replaced with an ImportError
. Thedeprecated file has now been removed from Pillow. If needed, install from PyPI (eg.pip install olefile
).
Removed deprecated ImageOps functions
Several undocumented functions in ImageOps
were deprecated in Pillow 4.3.0 (2017-10)and have now been removed: gaussian_blur
, gblur
, unsharp_mask
, usm
andbox_blur
. Use the equivalent operations in ImageFilter
instead.
Removed deprecated VERSION
VERSION
(the old PIL version, always 1.1.7) has been removed. Use version
instead.
API Changes
Deprecations
Python 2.7
Python 2.7 reaches end-of-life on 2020-01-01.
Pillow 7.0.0 will be released on 2020-01-01 and will drop support for Python 2.7, makingPillow 6.x the last series to support Python 2.
PyQt4 and PySide
Qt 4 reached end-of-life on 2015-12-19. Its Python bindings are also EOL: PyQt4 since2018-08-31 and PySide since 2015-10-14.
Support for PyQt4 and PySide has been deprecated from ImageQt
and will be removed ina future version. Please upgrade to PyQt5 or PySide2.
PIL.*ImagePlugin.version attributes
These version constants have been deprecated and will be removed in a futureversion.
BmpImagePlugin.version
CurImagePlugin.version
DcxImagePlugin.version
EpsImagePlugin.version
FliImagePlugin.version
FpxImagePlugin.version
GdImageFile.version
GifImagePlugin.version
IcoImagePlugin.version
ImImagePlugin.version
ImtImagePlugin.version
IptcImagePlugin.version
Jpeg2KImagePlugin.version
JpegImagePlugin.version
McIdasImagePlugin.version
MicImagePlugin.version
MpegImagePlugin.version
MpoImagePlugin.version
MspImagePlugin.version
PalmImagePlugin.version
PcdImagePlugin.version
PcxImagePlugin.version
PdfImagePlugin.version
PixarImagePlugin.version
PngImagePlugin.version
PpmImagePlugin.version
PsdImagePlugin.version
SgiImagePlugin.version
SunImagePlugin.version
TgaImagePlugin.version
TiffImagePlugin.version
WmfImagePlugin.version
XbmImagePlugin.version
XpmImagePlugin.version
XVThumbImagePlugin.version
Use PIL.version
instead.
ImageCms.CmsProfile attributes
Some attributes in ImageCms.CmsProfile
have been deprecated since Pillow 3.2.0. From6.0.0, they issue a DeprecationWarning
:
Deprecated | Use instead |
---|---|
color_space | Padded xcolor_space |
pcs | Padded connection_space |
product_copyright | Unicode copyright |
product_desc | Unicode profile_description |
product_description | Unicode profile_description |
product_manufacturer | Unicode manufacturer |
product_model | Unicode model |
MIME type improvements
Previously, all JPEG2000 images had the MIME type “image/jpx”. This has now beencorrected. After the file format drivers have been loaded, Image.MIME["JPEG2000"]
will return “image/jp2”. ImageFile.get_format_mimetype
will return “image/jpx” ifa JPX profile is present, or “image/jp2” otherwise.
Previously, all SGI images had the MIME type “image/rgb”. This has now beencorrected. After the file format drivers have been loaded, Image.MIME["SGI"]
will return “image/sgi”. ImageFile.get_format_mimetype
will return “image/rgb” ifRGB image data is present, or “image/sgi” otherwise.
MIME types have been added to the PPM format. After the file format drivers have beenloaded, Image.MIME["PPM"]
will now return the generic “image/x-portable-anymap”.ImageFile.get_format_mimetype
will return a MIME type specific to the color type.
The TGA, PCX and ICO formats also now have MIME types: “image/x-tga”, “image/x-pcx” and“image/x-icon” respectively.
API Additions
DIB file format
Pillow now supports reading and writing the Device Independent Bitmap file format.
Image.quantize
The dither
option is now a customisable parameter (was previously hardcoded to 1
).This parameter takes the same values used in convert()
.
New language parameter
These text-rendering functions now accept a language
parameter to requestlanguage-specific glyphs and ligatures from the font:
ImageDraw.ImageDraw.multiline_text()
ImageDraw.ImageDraw.multiline_textsize()
ImageDraw.ImageDraw.text()
ImageDraw.ImageDraw.textsize()
ImageFont.ImageFont.getmask()
ImageFont.ImageFont.getsize_multiline()
ImageFont.ImageFont.getsize()
Added EXIF class
getexif()
has been added, which returns anExif
instance. Values can be retrieved and set like adictionary. When saving JPEG, PNG or WEBP, the instance can be passed as anexif
argument to include any changes in the output image.
Added ImageOps.exif_transpose
exif_transpose()
returns a copy of an image, transposedaccording to its EXIF Orientation tag.
PNG EXIF data
EXIF data can now be read from and saved to PNG images. However, unlike other imageformats, EXIF data is not guaranteed to be present in info
until load()
has been called.
Other Changes
Reading new DDS image format
Pillow can now read uncompressed RGB data from DDS images.
Reading TIFF with old-style JPEG compression
Added support reading TIFF files with old-style JPEG compression through LibTIFF. AllYCbCr TIFF images are now always read as RGB.
TIFF compression codecs
Support has been added for the LZMA, Zstd and WebP TIFF compression codecs.
Improved support for transposing I;16 images
I;16, I;16L and I;16B are now supported image modes for alltranspose()
operations.