插件引用¶
BmpImagePlugin 模块¶
-
class
PIL.BmpImagePlugin.BmpImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFileWindows位图格式(BMP)的图像插件
-
BITFIELDS= 3¶
-
COMPRESSIONS= {'BITFIELDS': 3, 'JPEG': 4, 'PNG': 5, 'RAW': 0, 'RLE4': 2, 'RLE8': 1}¶
-
JPEG= 4¶
-
PNG= 5¶
-
RAW= 0¶
-
RLE4= 2¶
-
RLE8= 1¶
-
format= 'BMP'¶
-
format_description= 'Windows Bitmap'¶
-
k= 'PNG'¶
-
v= 5¶
-
-
class
PIL.BmpImagePlugin.DibImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.BmpImagePlugin.BmpImageFile-
format= 'DIB'¶
-
format_description= 'Windows Bitmap'¶
-
BufrStubImagePlugin 模块¶
CurImagePlugin 模块¶
-
class
PIL.CurImagePlugin.CurImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.BmpImagePlugin.BmpImageFile-
format= 'CUR'¶
-
format_description= 'Windows Cursor'¶
-
DcxImagePlugin 模块¶
-
class
PIL.DcxImagePlugin.DcxImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.PcxImagePlugin.PcxImageFile-
format= 'DCX'¶
-
format_description= 'Intel DCX'¶
-
property
is_animated¶
-
property
n_frames¶
-
EpsImagePlugin 模块¶
-
class
PIL.EpsImagePlugin.EpsImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFilepython图像库的eps文件分析器
-
format= 'EPS'¶
-
format_description= 'Encapsulated Postscript'¶
-
mode_map= {1: 'L', 2: 'LAB', 3: 'RGB', 4: 'CMYK'}¶
-
FitsStubImagePlugin 模块¶
FliImagePlugin 模块¶
-
class
PIL.FliImagePlugin.FliImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'FLI'¶
-
format_description= 'Autodesk FLI/FLC Animation'¶
-
property
is_animated¶
-
property
n_frames¶
-
FpxImagePlugin 模块¶
GbrImagePlugin 模块¶
GifImagePlugin 模块¶
-
class
PIL.GifImagePlugin.GifImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'GIF'¶
-
format_description= 'Compuserve GIF'¶
-
global_palette= None¶
-
property
is_animated¶
-
property
n_frames¶
-
GribStubImagePlugin 模块¶
Hdf5StubImagePlugin 模块¶
IcnsImagePlugin 模块¶
-
class
PIL.IcnsImagePlugin.IcnsFile(fobj)[源代码]¶ 基类:
object-
SIZES= {(16, 16, 1): [(b'icp4', <function read_png_or_jpeg2000>), (b'is32', <function read_32>), (b's8mk', <function read_mk>)], (16, 16, 2): [(b'ic11', <function read_png_or_jpeg2000>)], (32, 32, 1): [(b'icp5', <function read_png_or_jpeg2000>), (b'il32', <function read_32>), (b'l8mk', <function read_mk>)], (32, 32, 2): [(b'ic12', <function read_png_or_jpeg2000>)], (48, 48, 1): [(b'ih32', <function read_32>), (b'h8mk', <function read_mk>)], (64, 64, 1): [(b'icp6', <function read_png_or_jpeg2000>)], (128, 128, 1): [(b'ic07', <function read_png_or_jpeg2000>), (b'it32', <function read_32t>), (b't8mk', <function read_mk>)], (128, 128, 2): [(b'ic13', <function read_png_or_jpeg2000>)], (256, 256, 1): [(b'ic08', <function read_png_or_jpeg2000>)], (256, 256, 2): [(b'ic14', <function read_png_or_jpeg2000>)], (512, 512, 1): [(b'ic09', <function read_png_or_jpeg2000>)], (512, 512, 2): [(b'ic10', <function read_png_or_jpeg2000>)]}¶
-
-
class
PIL.IcnsImagePlugin.IcnsImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile对mac os.icns文件的pil映像支持。选择最佳分辨率,但如果在调用“load”之前改变大小属性,则可能加载不同大小的图像。
信息字典有一个键“大小”,它是ICN文件的大小列表。
-
format= 'ICNS'¶
-
format_description= 'Mac OS icns resource'¶
-
property
size¶
-
IcoImagePlugin 模块¶
-
class
PIL.IcoImagePlugin.IcoImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFilePIL只读图像支持Microsoft Windows.ico文件。
默认情况下,将加载文件中的最大分辨率图像。这可以通过在调用“load”之前更改“size”属性来更改。
信息字典有一个键“大小”,它是图标文件中可用大小的列表。
处理经典、XP和Vista图标格式。
保存时,使用PNG压缩。仅在Windows Vista中添加了对此的支持。
此插件是bryan davis<casadebender@gmail.com>重构的win32iconimageplugin版本。https://code.google.com/archive/p/casadebender/wikis/win32iconimageplugin.wiki
-
format= 'ICO'¶
-
format_description= 'Windows Icon'¶
-
property
size¶
-
ImImagePlugin 模块¶
-
class
PIL.ImImagePlugin.ImImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'IM'¶
-
format_description= 'IFUNC Image Memory'¶
-
property
is_animated¶
-
property
n_frames¶
-
ImtImagePlugin 模块¶
IptcImagePlugin 模块¶
-
class
PIL.IptcImagePlugin.IptcImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'IPTC'¶
-
format_description= 'IPTC/NAA'¶
-
JpegImagePlugin 模块¶
-
class
PIL.JpegImagePlugin.JpegImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
draft(mode, size)[源代码]¶ 配置 Mapfile 加载程序,使其返回尽可能与给定模式和大小匹配的映像版本。例如,可以使用此方法在加载彩色JPEG时将其转换为灰度。
如果进行了任何更改,则返回一个带有
mode和box原始图像的坐标在修改后的图像内。请注意,此方法修改了
Image物体就位。如果图像已加载,则此方法无效。注意:此方法不适用于大多数图像。它目前只为JPEG和MPO图像实现。
- 参数
mode -- 请求的模式。
size -- 请求的大小。
-
format= 'JPEG'¶
-
format_description= 'JPEG (ISO 10918)'¶
-
Jpeg2KImagePlugin 模块¶
McIdasImagePlugin 模块¶
MicImagePlugin 模块¶
PcdImagePlugin 模块¶
PcxImagePlugin 模块¶
PdfImagePlugin 模块¶
PixarImagePlugin 模块¶
PngImagePlugin 模块¶
-
PIL.PngImagePlugin.is_cid()¶ 匹配字符串开头的零个或多个字符。
-
class
PIL.PngImagePlugin.PngImageFile(fp=None, filename=None)[源代码] 基类:
PIL.ImageFile.ImageFile-
format= 'PNG'¶
-
format_description= 'Portable network graphics'¶
-
load_end()[源代码] 内部:读取完图像数据
-
load_prepare()[源代码] 内部:准备读取PNG文件
-
load_read(read_bytes)[源代码] 内部:读取更多图像数据
-
property
text¶
-
verify()[源代码] 验证PNG文件
-
PpmImagePlugin 模块¶
PsdImagePlugin 模块¶
-
class
PIL.PsdImagePlugin.PsdImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'PSD'¶
-
format_description= 'Adobe Photoshop'¶
-
property
is_animated¶
-
property
n_frames¶
-
SpiderImagePlugin 模块¶
-
class
PIL.SpiderImagePlugin.SpiderImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'SPIDER'¶
-
format_description= 'Spider 2D image'¶
-
property
is_animated¶
-
property
n_frames¶
-
SunImagePlugin 模块¶
TgaImagePlugin 模块¶
TiffImagePlugin 模块¶
-
class
PIL.TiffImagePlugin.AppendingTiffWriter(fn, new=False)[源代码]¶ 基类:
object-
Tags= {273, 288, 324, 519, 520, 521}¶
-
fieldSizes= [0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8]¶
-
-
class
PIL.TiffImagePlugin.IFDRational(value, denominator=1)[源代码]¶ 基类:
numbers.Rational实现一个Rational类,其中0/0是一个合法值,以匹配在野外使用的exif理性。
例如,DigitalZoomRatio-0.00/0.00表示未使用数码变焦。
-
property
denominator¶
-
property
numerator¶
-
property
-
PIL.TiffImagePlugin.ImageFileDirectory¶
-
class
PIL.TiffImagePlugin.ImageFileDirectory_v1(*args, **kwargs)[源代码]¶ 基类:
PIL.TiffImagePlugin.ImageFileDirectory_v2此类表示 legacy 接口到TIFF标记目录。
显示目录中标记的字典接口::
ifd = ImageFileDirectory_v1() ifd[key] = 'Some Data' ifd.tagtype[key] = TiffTags.ASCII print(ifd[key]) ('Some Data',)
还包含从TIFF图像文件中读取的标记类型字典,~pil.tiffImagePlugin.ImageFileDirectory_v1.tagType。
值作为元组返回。
3.0.0 版后已移除.
-
classmethod
from_v2(original)[源代码]¶ 返回一个
ImageFileDirectory_v1与原始中包含的数据相同的实例ImageFileDirectory_v2实例。
-
property
tagdata¶
-
to_v2()[源代码]¶ 返回一个
ImageFileDirectory_v2与原始中包含的数据相同的实例ImageFileDirectory_v1实例。
-
classmethod
-
class
PIL.TiffImagePlugin.ImageFileDirectory_v2(ifh=b'II*x00x00x00x00x00', prefix=None)[源代码]¶ 基类:
collections.abc.MutableMapping此类表示TIFF标记目录。为了加快速度,我们不会解码标签,除非有人要求。
显示目录中标记的字典接口::
ifd = ImageFileDirectory_v2() ifd[key] = 'Some Data' ifd.tagtype[key] = TiffTags.ASCII print(ifd[key]) 'Some Data'
单个值作为字符串或数字返回,序列作为值的元组返回。
每个项目的TIFF元数据类型存储在`~pil.tiffImagePlugin.ImageFileDirectory_v2.TagType`中的标记类型字典中。这些类型是从TIFF文件中读取、从添加的类型中猜测或手动添加的。
数据结构:
self.tagtype=
键:数字TIFF标记号
- 值:与来自的数据类型对应的整数
~PIL.TiffTags.TYPES`
3.0.0 新版功能.
-
property
legacy_api¶
-
load_double(data, legacy_api=True)¶
-
load_float(data, legacy_api=True)¶
-
load_long(data, legacy_api=True)¶
-
load_short(data, legacy_api=True)¶
-
load_signed_byte(data, legacy_api=True)¶
-
load_signed_long(data, legacy_api=True)¶
-
load_signed_short(data, legacy_api=True)¶
-
property
offset¶
-
property
prefix¶
-
write_double(*values)¶
-
write_float(*values)¶
-
write_long(*values)¶
-
write_short(*values)¶
-
write_signed_byte(*values)¶
-
write_signed_long(*values)¶
-
write_signed_short(*values)¶
WebPImagePlugin 模块¶
-
class
PIL.WebPImagePlugin.WebPImageFile(fp=None, filename=None)[源代码]¶ 基类:
PIL.ImageFile.ImageFile-
format= 'WEBP'¶
-
format_description= 'WebP image'¶
-
property
is_animated¶
-
property
n_frames¶
-