

Image moduleImageChops (“channel operations”) moduleImageCms moduleImageColor moduleImageDraw moduleImageEnhance moduleImageFile moduleImageFilter moduleImageFont moduleImageGrab moduleImageMath moduleImageMorph moduleImageOps moduleImagePalette moduleImagePath moduleImageQt moduleImageSequence moduleImageShow moduleImageStat moduleImageText moduleImageTk moduleImageTransform moduleImageWin module (Windows-only)ExifTags moduleTiffTags moduleJpegPresets modulePSDraw modulePixelAccess classfeatures moduleThis release is dedicated to the memory of Fredrik Lundh, aka Effbot, who died inNovember 2021. Fredrik created PIL in 1995 and he was instrumental in the earlysuccess of Python.
Fredrik was an early Python contributor (e.g. Elementtree and the ‘re’module) and his enthusiasm for the language and community were inspiringfor all who encountered him or his work. He spent countless hours oncomp.lang.python answering questions from newbies and advanced users alike.
He also co-founded an early Python startup, Secret Labs AB, which amongother software released an IDE named PythonWorks. Fredrik also created thePython Imaging Library (PIL) which is still THE way to interact with imagesin Python, now most often through its Pillow fork. His effbot.org site wasa valuable resource for generations of Python users, especially its Tkinterdocumentation.
Thank you, Fredrik.
JpegImagePlugin may append an EOF marker to the end of a truncated file, so thatthe last segment of the data will still be processed by the decoder.
If the EOF marker is not detected as such however, this could lead to an infiniteloop whereJpegImagePlugin keeps trying to end the file.
To prevent attempts to slow down loading times for images, if an image has consecutiveduplicate tiles that only differ by their offset, only load the last tile. Credit toGoogle’sOSS-Fuzz project for finding this issue.
To limitPIL.ImageMath to working with images, Pillowwill now restrict the builtins available toPIL.ImageMath.eval(). This willhelp prevent problems arising if users evaluate arbitrary expressions, such asImageMath.eval("exec(exit())").
CVE 2022-22815 (CWE 126) andCVE 2022-22816 (CWE 665) were found wheninitializingImagePath.Path.
Pillow has dropped support for Python 3.6, which reached end-of-life on 2021-12-23.
PILLOW_VERSION has been removed. Use__version__ instead.
Support for FreeType 2.7 has been removed; FreeType 2.8 is the minimum supported.
We recommend upgrading to at leastFreeType 2.10.4, which fixed a severevulnerability introduced in FreeType 2.6 (CVE 2020-15999).
Thecommand parameter has been removed. Use a subclass ofPIL.ImageShow.Viewer instead.
Image._showxv has been removed. Useshow()instead. If custom behaviour is required, useregister() to adda customViewer class.
IOError was merged intoOSError in Python 3.3. So,ImageFile.raise_ioerrorhas been removed. UseImageFile.raise_oserror instead.
An optional linewidth parameter has been added toImageDraw.Draw.polygon.
Ifxdg-open is present on Linux, this newPIL.ImageShow.Viewer subclasswill be registered. It displays images using the application selected by the system.
It is higher in priority than the other defaultPIL.ImageShow.Viewerinstances, so it will be preferred byim.show() orImageShow.show().
Support has been added for the “title” argument inDisplayViewer, so that whenim.show() orImageShow.show() use thedisplay command line tool, the “title”argument will also now be supported, e.g.im.show(title="MyImage") andImageShow.show(im,title="MyImage").
Since each frame of a GIF can have up to 256 colors, after the first frame it ispossible for there to be too many colors to fit in a P mode image. To allow for this,seeking to any subsequent GIF frame will now convert the image to RGB or RGBA,depending on whether or not the first frame had transparency.
The Pillow wheels from PyPI for macOS and Linux have switched from libjpeg tolibjpeg-turbo. It is a fork of libjpeg, popular for its speed.
Because different JPEG decoders load images differently, JPEG pixels may bealtered slightly with this change.
TrueType fonts may now be pickled and unpickled. For example:
importpicklefromPILimportImageFontfont=ImageFont.truetype("arial.ttf",size=30)pickled_font=pickle.dumps(font,protocol=pickle.HIGHEST_PROTOCOL)# Later...unpickled_font=pickle.loads(pickled_font)
TGA images with top right or bottom right orientations are now supported.