Plugin reference¶
BmpImagePlugin Module¶
-
class
PIL.BmpImagePlugin.BmpImageFile(fp=None, filename=None)[source]¶ Bases:
PIL.ImageFile.ImageFileImage plugin for the Windows Bitmap format (BMP)
-
BITFIELDS= 3¶
-
COMPRESSIONS= {'JPEG': 4, 'RLE4': 2, 'BITFIELDS': 3, 'RLE8': 1, 'PNG': 5, 'RAW': 0}¶
-
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.ImageFileEPS 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-
data()¶
-
format= 'GIF'¶
-
format_description= 'Compuserve GIF'¶
-
global_palette= None¶
-
is_animated¶
-
load_end()¶
-
n_frames¶
-
seek(frame)¶
-
tell()¶
-
GribStubImagePlugin Module¶
Hdf5StubImagePlugin Module¶
IcnsImagePlugin Module¶
-
class
PIL.IcnsImagePlugin.IcnsFile(fobj)[source]¶ Bases:
object-
SIZES= {(32, 32, 2): [(b'ic12', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (256, 256, 1): [(b'ic08', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (128, 128, 2): [(b'ic13', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (64, 64, 1): [(b'icp6', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (128, 128, 1): [(b'ic07', <function read_png_or_jpeg2000 at 0xf5577bfc>), (b'it32', <function read_32t at 0xf557777c>), (b't8mk', <function read_mk at 0xf5577bb4>)], (256, 256, 2): [(b'ic14', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (32, 32, 1): [(b'icp5', <function read_png_or_jpeg2000 at 0xf5577bfc>), (b'il32', <function read_32 at 0xf5577b6c>), (b'l8mk', <function read_mk at 0xf5577bb4>)], (48, 48, 1): [(b'ih32', <function read_32 at 0xf5577b6c>), (b'h8mk', <function read_mk at 0xf5577bb4>)], (16, 16, 1): [(b'icp4', <function read_png_or_jpeg2000 at 0xf5577bfc>), (b'is32', <function read_32 at 0xf5577b6c>), (b's8mk', <function read_mk at 0xf5577bb4>)], (16, 16, 2): [(b'ic11', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (512, 512, 1): [(b'ic09', <function read_png_or_jpeg2000 at 0xf5577bfc>)], (512, 512, 2): [(b'ic10', <function read_png_or_jpeg2000 at 0xf5577bfc>)]}¶
-
bestsize()¶
-
dataforsize(size)¶ Get an icon resource as {channel: array}. Note that the arrays are bottom-up like windows bitmaps and will likely need to be flipped or transposed in some way.
-
getimage(size=None)¶
-
itersizes()¶
-
-
class
PIL.IcnsImagePlugin.IcnsImageFile(fp=None, filename=None)[source]¶ Bases:
PIL.ImageFile.ImageFilePIL 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.ImageFilePIL 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¶
MpegImagePlugin Module¶
MspImagePlugin Module¶
PcdImagePlugin Module¶
PcxImagePlugin Module¶
PdfImagePlugin Module¶
PixarImagePlugin Module¶
PngImagePlugin Module¶
-
class
PIL.PngImagePlugin.ChunkStream(fp)[source]¶ Bases:
object-
call(cid, pos, length)¶ Call the appropriate chunk handler
-
close()¶
-
crc(cid, data)¶ Read and verify checksum
-
crc_skip(cid, data)¶ Read checksum. Used if the C module is not present
-
push(cid, pos, length)¶
-
read()¶ Fetch a new chunk. Returns header information.
-
verify(endchunk=b'IEND')¶
-
-
class
PIL.PngImagePlugin.PngImageFile(fp=None, filename=None)[source]¶ Bases:
PIL.ImageFile.ImageFile-
format= 'PNG'¶
-
format_description= 'Portable network graphics'¶
-
load_end()¶ internal: finished reading image data
-
load_prepare()¶ internal: prepare to read PNG file
-
load_read(read_bytes)¶ internal: read more image data
-
verify()¶ Verify PNG file
-
-
class
PIL.PngImagePlugin.PngInfo[source]¶ Bases:
objectPNG chunk container (for use with save(pnginfo=))
-
add(cid, data)[source]¶ Appends an arbitrary chunk. Use with caution.
Parameters: - cid – a byte string, 4 bytes long.
- data – a byte string of the encoded data
-
add_itxt(key, value, lang='', tkey='', zip=False)[source]¶ Appends an iTXt chunk.
Parameters: - key – latin-1 encodable text key name
- value – value for this key
- lang – language code
- tkey – UTF-8 version of the key name
- zip – compression flag
-
add_text(key, value, zip=0)[source]¶ Appends a text chunk.
Parameters: - key – latin-1 encodable text key name
- value – value for this key, text or an
PIL.PngImagePlugin.iTXtinstance - zip – compression flag
-
-
class
PIL.PngImagePlugin.PngStream(fp)[source]¶ Bases:
PIL.PngImagePlugin.ChunkStream-
check_text_memory(chunklen)¶
-
chunk_IDAT(pos, length)¶
-
chunk_IEND(pos, length)¶
-
chunk_IHDR(pos, length)¶
-
chunk_PLTE(pos, length)¶
-
chunk_gAMA(pos, length)¶
-
chunk_iCCP(pos, length)¶
-
chunk_iTXt(pos, length)¶
-
chunk_pHYs(pos, length)¶
-
chunk_tEXt(pos, length)¶
-
chunk_tRNS(pos, length)¶
-
chunk_zTXt(pos, length)¶
-
-
PIL.PngImagePlugin.getchunks(im, **params)[source]¶ Return a list of PNG chunks representing this image.
-
class
PIL.PngImagePlugin.iTXt[source]¶ Bases:
strSubclass of string to allow iTXt chunks to look like strings while keeping their extra information
-
PIL.PngImagePlugin.is_cid()¶ Matches zero or more characters at the beginning of the string.
PpmImagePlugin Module¶
PsdImagePlugin Module¶
SgiImagePlugin Module¶
SpiderImagePlugin Module¶
-
class
PIL.SpiderImagePlugin.SpiderImageFile(fp=None, filename=None)[source]¶ Bases:
PIL.ImageFile.ImageFile-
convert2byte(depth=255)¶
-
format= 'SPIDER'¶
-
format_description= 'Spider 2D image'¶
-
is_animated¶
-
n_frames¶
-
seek(frame)¶
-
tell()¶
-
tkPhotoImage()¶
-
SunImagePlugin Module¶
TgaImagePlugin Module¶
TiffImagePlugin Module¶
-
class
PIL.TiffImagePlugin.ImageFileDirectory(prefix=b'II')[source]¶ Bases:
collections.abc.MutableMappingThis 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 ImageFileDirectory[key] = value value = ImageFileDirectory[key]
Also contains a dictionary of tag types as read from the tiff image file, ‘ImageFileDirectory.tagtype’
Data Structures: ‘public’ * self.tagtype = {} Key: numerical tiff tag number
Value: integer corresponding to the data type from TiffTags.TYPES‘internal’ * self.tags = {} Key: numerical tiff tag number
- Value: Decoded data, Generally a tuple.
- If set from __setval__ – always a tuple
- Numeric types – always a tuple
- String type – not a tuple, returned as string
- Undefined data – not a tuple, returned as bytes
- Byte – not a tuple, returned as byte.
- self.tagdata = {} Key: numerical tiff tag number
Value: undecoded byte string from file
Tags will be found in either self.tags or self.tagdata, but not both. The union of the two should contain all the tags from the Tiff image file. External classes shouldn’t reference these unless they’re really sure what they’re doing.
-
load_dispatch= {1: (1, <function ImageFileDirectory.load_byte at 0xf5413854>), 2: (1, <function ImageFileDirectory.load_string at 0xf541389c>), 3: (2, <function ImageFileDirectory.load_short at 0xf54138e4>), 4: (4, <function ImageFileDirectory.load_long at 0xf541392c>), 5: (8, <function ImageFileDirectory.load_rational at 0xf5413974>), 7: (1, <function ImageFileDirectory.load_undefined at 0xf5413a4c>), 11: (4, <function ImageFileDirectory.load_float at 0xf54139bc>), 12: (8, <function ImageFileDirectory.load_double at 0xf5413a04>)}¶