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 = {'BITFIELDS': 3, 'JPEG': 4, 'PNG': 5, 'RAW': 0, 'RLE4': 2, 'RLE8': 1}
  • JPEG = 4
  • PNG = 5
  • RAW = 0
  • RLE4 = 2
  • RLE8 = 1
  • format = 'BMP'
  • formatdescription = 'Windows Bitmap'_
  • k = 'PNG'
  • v = 5

BufrStubImagePlugin Module

  • class PIL.BufrStubImagePlugin.BufrStubImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.StubImageFile

    • format = 'BUFR'
    • formatdescription = 'BUFR'_
  • PIL.BufrStubImagePlugin.registerhandler(_handler)[source]
  • Install application-specific BUFR image handler.

Parameters:handler – Handler object.

CurImagePlugin Module

DcxImagePlugin Module

  • class PIL.DcxImagePlugin.DcxImageFile(fp=None, filename=None)[source]
  • Bases: PIL.PcxImagePlugin.PcxImageFile

    • format = 'DCX'
    • formatdescription = 'Intel DCX'_
    • is_animated
    • n_frames
    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

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'
  • formatdescription = 'Encapsulated Postscript'_
  • load(scale=1)[source]
  • Load image data based on tile list

  • loadseek(args, *kwargs_)[source]

  • modemap = {1: 'L', 2: 'LAB', 3: 'RGB', 4: 'CMYK'}_
  • PIL.EpsImagePlugin.Ghostscript(tile, size, fp, scale=1)[source]
  • Render an image using Ghostscript
  • class PIL.EpsImagePlugin.PSFile(fp)[source]
  • Bases: object

Wrapper for bytesio object that treats either CR or LF as end of line.

  • PIL.EpsImagePlugin.has_ghostscript()[source]

FitsStubImagePlugin Module

  • class PIL.FitsStubImagePlugin.FITSStubImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.StubImageFile

    • format = 'FITS'
    • formatdescription = 'FITS'_
  • PIL.FitsStubImagePlugin.registerhandler(_handler)[source]
  • Install application-specific FITS image handler.

Parameters:handler – Handler object.

FliImagePlugin Module

  • class PIL.FliImagePlugin.FliImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'FLI'
    • formatdescription = 'Autodesk FLI/FLC Animation'_
    • is_animated
    • n_frames
    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

FpxImagePlugin Module

  • class PIL.FpxImagePlugin.FpxImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'FPX'
    • formatdescription = 'FlashPix'_
    • load()[source]
    • Load image data based on tile list

GbrImagePlugin Module

  • class PIL.GbrImagePlugin.GbrImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'GBR'
    • formatdescription = 'GIMP brush file'_
    • load()[source]
    • Load image data based on tile list

GifImagePlugin Module

  • class PIL.GifImagePlugin.GifImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • data()[source]
    • format = 'GIF'
    • formatdescription = 'Compuserve GIF'_
    • globalpalette = None_
    • is_animated
    • load_end()[source]
    • n_frames
    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

  • PIL.GifImagePlugin.getinterlace(_im)[source]
  • PIL.GifImagePlugin.getdata(im, offset=(0, 0), **params)[source]
  • Legacy Method

Return a list of strings representing this image.The first string is a local image header, the rest containsencoded image data.

Parameters:

  • im – Image object
  • offset – Tuple of (x, y) pixels. Defaults to (0,0)
  • **params – E.g. duration or other encoder info parametersReturns:
    List of Bytes containing gif encoded frame data
  • PIL.GifImagePlugin.getheader(im, palette=None, info=None)[source]
  • Legacy Method to get Gif data from image.

Warning:: May modify image data.

Parameters:

  • im – Image object
  • palette – bytes object containing the source palette, or ….
  • info – encoderinfoReturns:
    tuple of(list of header items, optimized palette)

GribStubImagePlugin Module

  • class PIL.GribStubImagePlugin.GribStubImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.StubImageFile

    • format = 'GRIB'
    • formatdescription = 'GRIB'_
  • PIL.GribStubImagePlugin.registerhandler(_handler)[source]
  • Install application-specific GRIB image handler.

Parameters:handler – Handler object.

Hdf5StubImagePlugin Module

  • class PIL.Hdf5StubImagePlugin.HDF5StubImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.StubImageFile

    • format = 'HDF5'
    • formatdescription = 'HDF5'_
  • PIL.Hdf5StubImagePlugin.registerhandler(_handler)[source]
  • Install application-specific HDF5 image handler.

Parameters:handler – Handler object.

IcnsImagePlugin Module

  • class PIL.IcnsImagePlugin.IcnsFile(fobj)[source]
  • Bases: object

    • SIZES = {(16, 16, 1): [(b'icp4', ), (b'is32', ), (b's8mk', )], (16, 16, 2): [(b'ic11', )], (32, 32, 1): [(b'icp5', ), (b'il32', ), (b'l8mk', )], (32, 32, 2): [(b'ic12', )], (48, 48, 1): [(b'ih32', ), (b'h8mk', )], (64, 64, 1): [(b'icp6', )], (128, 128, 1): [(b'ic07', ), (b'it32', ), (b't8mk', )], (128, 128, 2): [(b'ic13', )], (256, 256, 1): [(b'ic08', )], (256, 256, 2): [(b'ic14', )], (512, 512, 1): [(b'ic09', )], (512, 512, 2): [(b'ic10', )]}
    • bestsize()[source]
    • dataforsize(size)[source]
    • Get an icon resource as {channel: array}. Note thatthe arrays are bottom-up like windows bitmaps and will likelyneed to be flipped or transposed in some way.

    • getimage(size=None)[source]

    • itersizes()[source]
  • 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 loada different size image if you mutate the size attributebefore calling ‘load’.

The info dictionary has a key ‘sizes’ that is a listof sizes that the icns file has.

  • format = 'ICNS'
  • formatdescription = 'Mac OS icns resource'_
  • load()[source]
  • Load image data based on tile list

  • size

  • PIL.IcnsImagePlugin.nextheader(fobj)[source]
  • PIL.IcnsImagePlugin.read32(_fobj, start_length, size)[source]
  • Read a 32bit RGB icon resource. Seems to be either uncompressed oran RLE packbits-like scheme.
  • PIL.IcnsImagePlugin.read32t(_fobj, start_length, size)[source]
  • PIL.IcnsImagePlugin.readmk(_fobj, start_length, size)[source]
  • PIL.IcnsImagePlugin.readpng_or_jpeg2000(_fobj, start_length, size)[source]

IcoImagePlugin Module

  • class PIL.IcoImagePlugin.IcoFile(buf)[source]
  • Bases: object

    • frame(idx)[source]
    • Get an image from frame idx

    • getentryindex(size, bpp=False)[source]

    • getimage(size, bpp=False)[source]
    • Get an image from the icon

    • sizes()[source]

    • Get a list of all available icon sizes and color depths.
  • 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. Thiscan be changed by altering the ‘size’ attribute before calling ‘load’.

The info dictionary has a key ‘sizes’ that is a list of the sizes availablein the icon file.

Handles classic, XP and Vista icon formats.

When saving, PNG compression is used. Support for this was only added inWindows Vista.

This plugin is a refactored version of Win32IconImagePlugin by Bryan Davis<casadebender@gmail.com>.https://code.google.com/archive/p/casadebender/wikis/Win32IconImagePlugin.wiki

  • format = 'ICO'
  • formatdescription = 'Windows Icon'_
  • load()[source]
  • Load image data based on tile list

  • load_seek()[source]

  • size

ImImagePlugin Module

  • class PIL.ImImagePlugin.ImImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'IM'
    • formatdescription = 'IFUNC Image Memory'_
    • is_animated
    • n_frames
    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

ImtImagePlugin Module

  • class PIL.ImtImagePlugin.ImtImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'IMT'
    • formatdescription = 'IM Tools'_

IptcImagePlugin Module

  • class PIL.IptcImagePlugin.IptcImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • field()[source]
    • format = 'IPTC'
    • formatdescription = 'IPTC/NAA'_
    • getint(key)[source]
    • load()[source]
    • Load image data based on tile list
  • PIL.IptcImagePlugin.getiptcinfo(im)[source]
  • Get IPTC information from TIFF, JPEG, or IPTC file.

Parameters:im – An image containing IPTC data.Returns:A dictionary containing IPTC information, or None ifno IPTC information block was found.

JpegImagePlugin Module

  • PIL.JpegImagePlugin.APP(self, marker)[source]
  • PIL.JpegImagePlugin.COM(self, marker)[source]
  • PIL.JpegImagePlugin.DQT(self, marker)[source]
  • class PIL.JpegImagePlugin.JpegImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • draft(mode, size)[source]
    • Configures the image file loader so it returns a version of theimage that as closely as possible matches the given mode andsize. For example, you can use this method to convert a colorJPEG to greyscale while loading it.

If any changes are made, returns a tuple with the chosen mode andbox with coordinates of the original image within the altered one.

Note that this method modifies the Image objectin place. If the image has already been loaded, this method has noeffect.

Note: This method is not implemented for most images. It iscurrently implemented only for JPEG and MPO images.

Parameters:

  1. - **mode** The requested mode.
  2. - **size** The requested size.
  • format = 'JPEG'
  • formatdescription = 'JPEG (ISO 10918)'_
  • load_djpeg()[source]
  • loadread(_read_bytes)[source]
  • internal: read more image dataFor premature EOF and LOAD_TRUNCATED_IMAGES adds EOI markerso libjpeg can finish decoding
  • PIL.JpegImagePlugin.SOF(self, marker)[source]
  • PIL.JpegImagePlugin.Skip(self, marker)[source]
  • PIL.JpegImagePlugin.convertdict_qtables(_qtables)[source]
  • PIL.JpegImagePlugin.getsampling(_im)[source]
  • PIL.JpegImagePlugin.jpegfactory(_fp=None, filename=None)[source]

Jpeg2KImagePlugin Module

  • class PIL.Jpeg2KImagePlugin.Jpeg2KImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'JPEG2000'
    • formatdescription = 'JPEG 2000 (ISO 15444)'_
    • load()[source]
    • Load image data based on tile list

    • reduce

    • Returns a copy of the image reduced by factor times.If the size of the image is not dividable by the factor,the resulting size will be rounded up.

Parameters:

  1. - **factor** A greater than 0 integer or tuple of two integersfor width and height separately.
  2. - **box** An optional 4-tuple of ints providingthe source image region to be reduced.The values must be within (0, 0, width, height) rectangle.If omitted or None, the entire source is used.

McIdasImagePlugin Module

  • class PIL.McIdasImagePlugin.McIdasImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'MCIDAS'
    • formatdescription = 'McIdas area file'_

MicImagePlugin Module

  • class PIL.MicImagePlugin.MicImageFile(fp=None, filename=None)[source]
  • Bases: PIL.TiffImagePlugin.TiffImageFile

    • format = 'MIC'
    • formatdescription = 'Microsoft Image Composer'_
    • is_animated
    • n_frames
    • seek(frame)[source]
    • Select a given frame as current image

    • tell()[source]

    • Return the current frame number

MpegImagePlugin Module

  • class PIL.MpegImagePlugin.MpegImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'MPEG'
    • formatdescription = 'MPEG'_

MspImagePlugin Module

Parameters:buffer – A bytes object with the data to be decoded.Returns:A tuple of (bytes consumed, errcode).If finished with decoding return <0 for the bytes consumed.Err codes are from ERRORS

  • class PIL.MspImagePlugin.MspImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'MSP'
    • formatdescription = 'Windows Paint'_

PalmImagePlugin Module

  • PIL.PalmImagePlugin.build_prototype_image()[source]

PcdImagePlugin Module

  • class PIL.PcdImagePlugin.PcdImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'PCD'
    • formatdescription = 'Kodak PhotoCD'_
    • load_end()[source]

PcxImagePlugin Module

  • class PIL.PcxImagePlugin.PcxImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'PCX'
    • formatdescription = 'Paintbrush'_

PdfImagePlugin Module

PixarImagePlugin Module

  • class PIL.PixarImagePlugin.PixarImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'PIXAR'
    • formatdescription = 'PIXAR raster image'_

PngImagePlugin Module

  • class PIL.PngImagePlugin.PngImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • load_end()[source]
    • internal: finished reading image data

    • load_prepare()[source]

    • internal: prepare to read PNG file

    • loadread(_read_bytes)[source]

    • internal: read more image data

    • seek(frame)[source]

    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

  • PIL.PngImagePlugin.getchunks(im, **params)[source]
  • Return a list of PNG chunks representing this image.
  • PIL.PngImagePlugin.is_cid()
  • Matches zero or more characters at the beginning of the string.
  • PIL.PngImagePlugin.putchunk(fp, cid, *data)[source]
  • Write a PNG chunk (including CRC field)
  • class PIL.PngImagePlugin.ChunkStream(fp)[source]
  • Bases: object

    • call(cid, pos, length)[source]
    • Call the appropriate chunk handler

    • close()[source]

    • crc(cid, data)[source]
    • Read and verify checksum

    • crcskip(_cid, data)[source]

    • Read checksum. Used if the C module is not present

    • push(cid, pos, length)[source]

    • read()[source]
    • Fetch a new chunk. Returns header information.

    • verify(endchunk=b'IEND')[source]

  • class PIL.PngImagePlugin.PngImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'PNG'
    • formatdescription = 'Portable network graphics'_
    • getexif()[source]
    • is_animated
    • load_end()[source]
    • internal: finished reading image data

    • load_prepare()[source]

    • internal: prepare to read PNG file

    • loadread(_read_bytes)[source]

    • internal: read more image data

    • n_frames

    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

PpmImagePlugin Module

  • class PIL.PpmImagePlugin.PpmImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'PPM'
    • formatdescription = 'Pbmplus image'_

PsdImagePlugin Module

  • class PIL.PsdImagePlugin.PsdImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'PSD'
    • formatdescription = 'Adobe Photoshop'_
    • is_animated
    • load_prepare()[source]
    • n_frames
    • seek(layer)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

SgiImagePlugin Module

Parameters:buffer – A bytes object with the data to be decoded.Returns:A tuple of (bytes consumed, errcode).If finished with decoding return <0 for the bytes consumed.Err codes are from ERRORS

  • class PIL.SgiImagePlugin.SgiImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'SGI'
    • formatdescription = 'SGI Image File Format'_

SpiderImagePlugin Module

  • class PIL.SpiderImagePlugin.SpiderImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • convert2byte(depth=255)[source]
    • format = 'SPIDER'
    • formatdescription = 'Spider 2D image'_
    • is_animated
    • n_frames
    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

  • PIL.SpiderImagePlugin.isSpiderHeader(t)[source]
  • PIL.SpiderImagePlugin.isSpiderImage(filename)[source]
  • PIL.SpiderImagePlugin.loadImageSeries(filelist=None)[source]
  • create a list of Image objects for use in a montage
  • PIL.SpiderImagePlugin.makeSpiderHeader(im)[source]

SunImagePlugin Module

  • class PIL.SunImagePlugin.SunImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'SUN'
    • formatdescription = 'Sun Raster File'_

TgaImagePlugin Module

  • class PIL.TgaImagePlugin.TgaImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'TGA'
    • formatdescription = 'Targa'_

TiffImagePlugin Module

  • class PIL.TiffImagePlugin.IFDRational(value, denominator=1)[source]
  • Bases: numbers.Rational

Implements a rational class where 0/0 is a legal value to matchthe in the wild use of exif rationals.

e.g., DigitalZoomRatio - 0.00/0.00 indicates that no digital zoom was used

  • denominator
  • limitrational(_max_denominator)[source]

Parameters:max_denominator – Integer, the maximum denominator valueReturns:Tuple of (numerator, denominator)

  • numerator

This class represents the legacy interface to a TIFF tag directory.

Exposes a dictionary interface of the tags in the directory:

  1. ifd = ImageFileDirectory_v1()
  2. ifd[key] = 'Some Data'
  3. ifd.tagtype[key] = TiffTags.ASCII
  4. print(ifd[key])
  5. ('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.

Returns:ImageFileDirectory_v1

Returns:ImageFileDirectory_v2

  • class PIL.TiffImagePlugin.ImageFileDirectoryv2(_ifh=b'II*x00x00x00x00x00', prefix=None)[source]
  • Bases: collections.abc.MutableMapping

This class represents a TIFF tag directory. To speed things up, wedon’t decode tags unless they’re asked for.

Exposes a dictionary interface of the tags in the directory:

  1. ifd = ImageFileDirectory_v2()
  2. ifd[key] = 'Some Data'
  3. ifd.tagtype[key] = TiffTags.ASCII
  4. print(ifd[key])
  5. 'Some Data'

Individual values are returned as the strings or numbers, sequences arereturned as tuples of the values.

The tiff metadata type of each item is stored in a dictionary oftag types in~PIL.TiffImagePlugin.ImageFileDirectory_v2.tagtype. The typesare read from a tiff file, guessed from the type added, or addedmanually.

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.

  • legacy_api
  • load(fp)[source]
  • loadbyte(_data, legacy_api=True)[source]
  • loaddouble(_data, legacy_api=True)
  • loadfloat(_data, legacy_api=True)
  • loadlong(_data, legacy_api=True)
  • loadrational(_data, legacy_api=True)[source]
  • loadshort(_data, legacy_api=True)
  • loadsigned_byte(_data, legacy_api=True)
  • loadsigned_long(_data, legacy_api=True)
  • loadsigned_rational(_data, legacy_api=True)[source]
  • loadsigned_short(_data, legacy_api=True)
  • loadstring(_data, legacy_api=True)[source]
  • loadundefined(_data, legacy_api=True)[source]
  • named()[source]

Returns:dict of name|key: value

Returns the complete tag dictionary, with named tags where possible.

  • offset
  • prefix
  • reset()[source]
  • save(fp)[source]
  • tobytes(offset=0)[source]
  • writebyte(_data)[source]
  • writedouble(*values_)
  • writefloat(*values_)
  • writelong(*values_)
  • writerational(*values_)[source]
  • writeshort(*values_)
  • writesigned_byte(*values_)
  • writesigned_long(*values_)
  • writesigned_rational(*values_)[source]
  • writesigned_short(*values_)
  • writestring(_value)[source]
  • writeundefined(_value)[source]
  • class PIL.TiffImagePlugin.TiffImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'TIFF'
    • formatdescription = 'Adobe TIFF'_
    • is_animated
    • load()[source]
    • Load image data based on tile list

    • load_end()[source]

    • n_frames
    • seek(frame)[source]
    • Select a given frame as current image

    • tell()[source]

    • Return the current frame number

WebPImagePlugin Module

  • class PIL.WebPImagePlugin.WebPImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'WEBP'
    • formatdescription = 'WebP image'_
    • is_animated
    • load()[source]
    • Load image data based on tile list

    • n_frames

    • seek(frame)[source]
    • Seeks to the given frame in this sequence file. If you seekbeyond the end of the sequence, the method raises anEOFError exception. When a sequence file is opened, thelibrary automatically seeks to frame 0.

See tell().

Parameters:frame – Frame number, starting at 0.Raises:EOFError – If the call attempts to seek beyond the endof the sequence.

Returns:Frame number, starting with 0.

WmfImagePlugin Module

  • class PIL.WmfImagePlugin.WmfStubImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.StubImageFile

    • format = 'WMF'
    • formatdescription = 'Windows Metafile'_
    • load(dpi=None)[source]
    • Load image data based on tile list
  • PIL.WmfImagePlugin.registerhandler(_handler)[source]
  • Install application-specific WMF image handler.

Parameters:handler – Handler object.

XVThumbImagePlugin Module

  • class PIL.XVThumbImagePlugin.XVThumbImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'XVThumb'
    • formatdescription = 'XV thumbnail image'_

XbmImagePlugin Module

  • class PIL.XbmImagePlugin.XbmImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'XBM'
    • formatdescription = 'X11 Bitmap'_

XpmImagePlugin Module

  • class PIL.XpmImagePlugin.XpmImageFile(fp=None, filename=None)[source]
  • Bases: PIL.ImageFile.ImageFile

    • format = 'XPM'
    • formatdescription = 'X11 Pixel Map'_
    • loadread(_bytes)[source]