本页列出了不推荐使用的Pillow功能,或在过去的主要版本中删除的Pillow功能,并给出了替代使用的选项。
以下是被视为已弃用的功能。在适当的情况下,a DeprecationWarning
发行。
6.0.0 版后已移除.
python 2.7在2020-01-01达到了生命终结。
Pillow7.0.0将于2020-01-01发布,并将放弃对python 2.7的支持,使Pillow6.x成为支持python 2的最后一个系列。
6.0.0 版后已移除.
qt 4在2015-12-19达到了寿命终止。它的python绑定也是eol:pyqt4(自2018-08-31)和pyside(自2015-10-14)。
对pyqt4和pyside的支持已从弃用 ImageQt
将在将来的版本中删除。请升级到pyqt5或pyside2。
6.0.0 版后已移除.
个别插件的版本常量已被弃用,将在将来的版本中删除。使用 PIL.__version__
相反。
已弃用 | 已弃用 | 已弃用 |
---|---|---|
BmpImagePlugin.__version__ |
Jpeg2KImagePlugin.__version__ |
PngImagePlugin.__version__ |
CurImagePlugin.__version__ |
JpegImagePlugin.__version__ |
PpmImagePlugin.__version__ |
DcxImagePlugin.__version__ |
McIdasImagePlugin.__version__ |
PsdImagePlugin.__version__ |
EpsImagePlugin.__version__ |
MicImagePlugin.__version__ |
SgiImagePlugin.__version__ |
FliImagePlugin.__version__ |
MpegImagePlugin.__version__ |
SunImagePlugin.__version__ |
FpxImagePlugin.__version__ |
MpoImagePlugin.__version__ |
TgaImagePlugin.__version__ |
GdImageFile.__version__ |
MspImagePlugin.__version__ |
TiffImagePlugin.__version__ |
GifImagePlugin.__version__ |
PalmImagePlugin.__version__ |
WmfImagePlugin.__version__ |
IcoImagePlugin.__version__ |
PcdImagePlugin.__version__ |
XbmImagePlugin.__version__ |
ImImagePlugin.__version__ |
PcxImagePlugin.__version__ |
XpmImagePlugin.__version__ |
ImtImagePlugin.__version__ |
PdfImagePlugin.__version__ |
XVThumbImagePlugin.__version__ |
IptcImagePlugin.__version__ |
PixarImagePlugin.__version__ |
5.3.0 版后已移除.
设置TIFF图像的图像大小(例如 im.size = (256, 256)
发布一个 DeprecationWarning
:
Setting the size of a TIFF image directly is deprecated, and will
be removed in a future version. Use the resize method instead.
5.2.0 版后已移除.
PILLOW_VERSION
has been deprecated and will be removed in the next
major release. Use __version__
instead.
不推荐使用的功能只有在经过适当的不推荐期之后才能在主要版本中删除。
已在版本6.0.0中删除。
VERSION
(the old PIL version, always 1.1.7) has been removed. Use
__version__
instead.
已在版本6.0.0中删除。
在 ImageOps
已被删除。使用等价物 ImageFilter
而是:
远离的 | 代替使用 |
---|---|
ImageOps.box_blur |
ImageFilter.BoxBlur |
ImageOps.gaussian_blur |
ImageFilter.GaussianBlur |
ImageOps.gblur |
ImageFilter.GaussianBlur |
ImageOps.usm |
ImageFilter.UnsharpMask |
ImageOps.unsharp_mask |
ImageFilter.UnsharpMask |
已在版本6.0.0中删除。
pil.olefileio作为自动文件和枕头4.0.0(2017-01)删除,以支持上游olefile python包,并替换为 ImportError
5.0.0(2018-01年)。不推荐使用的文件现在已从枕头中删除。如果需要,从PYPI安装(例如 pip install olefile
)