Plugin reference¶
BmpImagePlugin Module¶
- class PIL.BmpImagePlugin.BmpImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
Image plugin for the Windows Bitmap format (BMP)
- BITFIELDS = 3¶
- COMPRESSIONS = {'RLE4': 2, 'JPEG': 4, 'BITFIELDS': 3, 'RAW': 0, 'RLE8': 1, 'PNG': 5}¶
- JPEG = 4¶
- PNG = 5¶
- RAW = 0¶
- RLE4 = 2¶
- RLE8 = 1¶
- format = 'BMP'¶
- format_description = 'Windows Bitmap'¶
- class PIL.BmpImagePlugin.DibImageFile(fp=None, filename=None)[source]¶
Bases: PIL.BmpImagePlugin.BmpImageFile
- format = 'DIB'¶
- format_description = 'Windows Bitmap'¶
BufrStubImagePlugin Module¶
CurImagePlugin Module¶
- class PIL.CurImagePlugin.CurImageFile(fp=None, filename=None)[source]¶
Bases: PIL.BmpImagePlugin.BmpImageFile
- format = 'CUR'¶
- format_description = 'Windows Cursor'¶
DcxImagePlugin Module¶
EpsImagePlugin Module¶
- class PIL.EpsImagePlugin.EpsImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
EPS File Parser for the Python Imaging Library
- format = 'EPS'¶
- format_description = 'Encapsulated Postscript'¶
- mode_map = {1: 'L', 2: 'LAB', 3: 'RGB'}¶
FitsStubImagePlugin Module¶
FliImagePlugin Module¶
FpxImagePlugin Module¶
GbrImagePlugin Module¶
GifImagePlugin Module¶
- class PIL.GifImagePlugin.GifImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
- format = 'GIF'¶
- format_description = 'Compuserve GIF'¶
- global_palette = None¶
GribStubImagePlugin Module¶
Hdf5StubImagePlugin Module¶
IcnsImagePlugin Module¶
- class PIL.IcnsImagePlugin.IcnsFile(fobj)[source]¶
Bases: object
- SIZES = {(256, 256, 1): [('ic08', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (128, 128, 2): [('ic13', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (64, 64, 1): [('icp6', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (128, 128, 1): [('ic07', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>), ('it32', <function read_32t at 0x3fff76baa140>), ('t8mk', <function read_mk at 0x3fff76baa230>)], (32, 32, 1): [('icp5', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>), ('il32', <function read_32 at 0x3fff76baa1b8>), ('l8mk', <function read_mk at 0x3fff76baa230>)], (16, 16, 2): [('ic11', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (512, 512, 2): [('ic10', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (512, 512, 1): [('ic09', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (48, 48, 1): [('ih32', <function read_32 at 0x3fff76baa1b8>), ('h8mk', <function read_mk at 0x3fff76baa230>)], (256, 256, 2): [('ic14', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)], (16, 16, 1): [('icp4', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>), ('is32', <function read_32 at 0x3fff76baa1b8>), ('s8mk', <function read_mk at 0x3fff76baa230>)], (32, 32, 2): [('ic12', <function read_png_or_jpeg2000 at 0x3fff76baa2a8>)]}¶
- class PIL.IcnsImagePlugin.IcnsImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
PIL image support for Mac OS .icns files. Chooses the best resolution, but will possibly load a different size image if you mutate the size attribute before calling ‘load’.
The info dictionary has a key ‘sizes’ that is a list of sizes that the icns file has.
- format = 'ICNS'¶
- format_description = 'Mac OS icns resource'¶
IcoImagePlugin Module¶
- class PIL.IcoImagePlugin.IcoImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
PIL read-only image support for Microsoft Windows .ico files.
By default the largest resolution image in the file will be loaded. This can be changed by altering the ‘size’ attribute before calling ‘load’.
The info dictionary has a key ‘sizes’ that is a list of the sizes available in the icon file.
Handles classic, XP and Vista icon formats.
This plugin is a refactored version of Win32IconImagePlugin by Bryan Davis <casadebender@gmail.com>. https://code.google.com/p/casadebender/wiki/Win32IconImagePlugin
- format = 'ICO'¶
- format_description = 'Windows Icon'¶
ImImagePlugin Module¶
ImtImagePlugin Module¶
IptcImagePlugin Module¶
JpegImagePlugin Module¶
Jpeg2KImagePlugin Module¶
McIdasImagePlugin Module¶
MicImagePlugin Module¶
MspImagePlugin Module¶
PcdImagePlugin Module¶
PcxImagePlugin Module¶
PdfImagePlugin Module¶
PixarImagePlugin Module¶
PngImagePlugin Module¶
- PIL.PngImagePlugin.getchunks(im, **params)[source]¶
Return a list of PNG chunks representing this image.
- PIL.PngImagePlugin.is_cid()¶
match(string[, pos[, endpos]]) –> match object or None. Matches zero or more characters at the beginning of the string
- class PIL.PngImagePlugin.PngImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
- format = 'PNG'¶
- format_description = 'Portable network graphics'¶
PpmImagePlugin Module¶
PsdImagePlugin Module¶
SgiImagePlugin Module¶
SpiderImagePlugin Module¶
- class PIL.SpiderImagePlugin.SpiderImageFile(fp=None, filename=None)[source]¶
Bases: PIL.ImageFile.ImageFile
- format = 'SPIDER'¶
- format_description = 'Spider 2D image'¶
SunImagePlugin Module¶
TgaImagePlugin Module¶
TiffImagePlugin Module¶
- PIL.TiffImagePlugin.ImageFileDirectory¶
alias of ImageFileDirectory_v1
- class PIL.TiffImagePlugin.ImageFileDirectory_v1(*args, **kwargs)[source]¶
Bases: PIL.TiffImagePlugin.ImageFileDirectory_v2
This class represents the legacy interface to a TIFF tag directory.
Exposes a dictionary interface of the tags in the directory:
ifd = ImageFileDirectory_v1() ifd[key] = 'Some Data' ifd.tagtype[key] = 2 print ifd[key] ('Some Data',)
Also contains a dictionary of tag types as read from the tiff image file, ~PIL.TiffImagePlugin.ImageFileDirectory_v1.tagtype.
Values are returned as a tuple.
Deprecated since version 3.0.0.
- classmethod from_v2(original)[source]¶
Returns an ImageFileDirectory_v1 instance with the same data as is contained in the original ImageFileDirectory_v2 instance.
Returns: ImageFileDirectory_v1
- tagdata¶
- to_v2()[source]¶
Returns an ImageFileDirectory_v2 instance with the same data as is contained in the original ImageFileDirectory_v1 instance.
Returns: ImageFileDirectory_v2
- class PIL.TiffImagePlugin.ImageFileDirectory_v2(ifh='II*x00x00x00x00x00', prefix=None)[source]¶
Bases: _abcoll.MutableMapping
This class represents a TIFF tag directory. To speed things up, we don’t decode tags unless they’re asked for.
Exposes a dictionary interface of the tags in the directory:
ifd = ImageFileDirectory_v2() ifd[key] = 'Some Data' ifd.tagtype[key] = 2 print(ifd[key]) 'Some Data'
Individual values are returned as the strings or numbers, sequences are returned as tuples of the values.
The tiff metadata type of each item is stored in a dictionary of tag types in ~PIL.TiffImagePlugin.ImageFileDirectory_v2.tagtype. The types are read from a tiff file, guessed from the type added, or added manually.
Data Structures:
- self.tagtype = {}
- Key: numerical tiff tag number
- Value: integer corresponding to the data type from ~PIL.TiffTags.TYPES
New in version 3.0.0.
- as_dict()[source]¶
Return a dictionary of the image’s tags.
use dict(ifd) instead.
Deprecated since version 3.0.0.
- 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)¶
- named()[source]¶
Returns: dict of name|key: value Returns the complete tag dictionary, with named tags where possible.
- offset¶
- 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)¶
- self.tagtype = {}