Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
Pillow (PIL Fork) 12.0.0 documentation
Light LogoDark Logo
Pillow (PIL Fork) 12.0.0 documentation
Back to top

Plugin reference

AvifImagePlugin module

classPIL.AvifImagePlugin.AvifImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='AVIF'
format_description:str|None='AVIFimage'
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

load_seek(pos:int)None[source]
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

PIL.AvifImagePlugin.get_codec_version(codec_name:str)str|None[source]

BmpImagePlugin module

classPIL.BmpImagePlugin.BmpImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases: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:str|None='BMP'
format_description:str|None='WindowsBitmap'
k='PNG'
v=5
classPIL.BmpImagePlugin.BmpRleDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

classPIL.BmpImagePlugin.DibImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:BmpImageFile

format:str|None='DIB'
format_description:str|None='WindowsBitmap'

BufrStubImagePlugin module

classPIL.BufrStubImagePlugin.BufrStubImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:StubImageFile

format:str|None='BUFR'
format_description:str|None='BUFR'
PIL.BufrStubImagePlugin.register_handler(handler:StubHandler|None)None[source]

Install application-specific BUFR image handler.

Parameters:

handler – Handler object.

CurImagePlugin module

classPIL.CurImagePlugin.CurImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:BmpImageFile

format:str|None='CUR'
format_description:str|None='WindowsCursor'

DcxImagePlugin module

classPIL.DcxImagePlugin.DcxImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:PcxImageFile

format:str|None='DCX'
format_description:str|None='IntelDCX'
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

DdsImagePlugin module

A Pillow plugin for .dds files (S3TC-compressed aka DXTC)Jerome Leclanche <jerome@leclan.ch>

Documentation:https://web.archive.org/web/20170802060935/http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_compression_s3tc.txt

The contents of this file are hereby released in the public domain (CC0)Full text of the CC0 license:https://creativecommons.org/publicdomain/zero/1.0/

classPIL.DdsImagePlugin.D3DFMT(*values)[source]

Bases:IntEnum

A1=118
A16B16G16R16=36
A16B16G16R16F=113
A1R5G5B5=25
A2B10G10R10=31
A2B10G10R10_XR_BIAS=119
A2R10G10B10=35
A2W10V10U10=67
A32B32G32R32F=116
A4L4=52
A4R4G4B4=26
A8=28
A8B8G8R8=32
A8L8=51
A8P8=40
A8R3G3B2=29
A8R8G8B8=21
ATI1=826889281
ATI2=843666497
BC4S=1395934018
BC4U=1429488450
BC5S=1395999554
BC5U=1429553986
BINARYBUFFER=199
CxV8U8=117
D15S1=73
D16=80
D16_LOCKABLE=70
D24FS8=83
D24S8=75
D24X4S4=79
D24X8=77
D32=71
D32F_LOCKABLE=82
D32_LOCKABLE=84
DX10=808540228
DXT1=827611204
DXT2=844388420
DXT3=861165636
DXT4=877942852
DXT5=894720068
G16R16=34
G16R16F=112
G32R32F=115
G8R8_G8B8=1111970375
INDEX16=101
INDEX32=102
L16=81
L6V5U5=61
L8=50
MULTI2_ARGB8=827606349
P8=41
Q16W16V16U16=110
Q8W8V8U8=63
R16F=111
R32F=114
R3G3B2=27
R5G6B5=23
R8G8B8=20
R8G8_B8G8=1195525970
S8_LOCKABLE=85
UNKNOWN=0
UYVY=1498831189
V16U16=64
V8U8=60
VERTEXDATA=100
X1R5G5B5=24
X4R4G4B4=30
X8B8G8R8=33
X8L8V8U8=62
X8R8G8B8=22
YUY2=844715353
classPIL.DdsImagePlugin.DDPF(*values)[source]

Bases:IntFlag

ALPHA=2
ALPHAPIXELS=1
FOURCC=4
LUMINANCE=131072
PALETTEINDEXED8=32
RGB=64
classPIL.DdsImagePlugin.DDSCAPS(*values)[source]

Bases:IntFlag

COMPLEX=8
MIPMAP=4194304
TEXTURE=4096
classPIL.DdsImagePlugin.DDSCAPS2(*values)[source]

Bases:IntFlag

CUBEMAP=512
CUBEMAP_NEGATIVEX=2048
CUBEMAP_NEGATIVEY=8192
CUBEMAP_NEGATIVEZ=32768
CUBEMAP_POSITIVEX=1024
CUBEMAP_POSITIVEY=4096
CUBEMAP_POSITIVEZ=16384
VOLUME=2097152
classPIL.DdsImagePlugin.DDSD(*values)[source]

Bases:IntFlag

CAPS=1
DEPTH=8388608
HEIGHT=2
LINEARSIZE=524288
MIPMAPCOUNT=131072
PITCH=8
PIXELFORMAT=4096
WIDTH=4
classPIL.DdsImagePlugin.DXGI_FORMAT(*values)[source]

Bases:IntEnum

A8P8=114
A8_UNORM=65
AI44=111
AYUV=100
B4G4R4A4_UNORM=115
B5G5R5A1_UNORM=86
B5G6R5_UNORM=85
B8G8R8A8_TYPELESS=90
B8G8R8A8_UNORM=87
B8G8R8A8_UNORM_SRGB=91
B8G8R8X8_TYPELESS=92
B8G8R8X8_UNORM=88
B8G8R8X8_UNORM_SRGB=93
BC1_TYPELESS=70
BC1_UNORM=71
BC1_UNORM_SRGB=72
BC2_TYPELESS=73
BC2_UNORM=74
BC2_UNORM_SRGB=75
BC3_TYPELESS=76
BC3_UNORM=77
BC3_UNORM_SRGB=78
BC4_SNORM=81
BC4_TYPELESS=79
BC4_UNORM=80
BC5_SNORM=84
BC5_TYPELESS=82
BC5_UNORM=83
BC6H_SF16=96
BC6H_TYPELESS=94
BC6H_UF16=95
BC7_TYPELESS=97
BC7_UNORM=98
BC7_UNORM_SRGB=99
D16_UNORM=55
D24_UNORM_S8_UINT=45
D32_FLOAT=40
D32_FLOAT_S8X24_UINT=20
G8R8_G8B8_UNORM=69
IA44=112
NV11=110
NV12=103
OPAQUE_420=106
P010=104
P016=105
P208=130
P8=113
R10G10B10A2_TYPELESS=23
R10G10B10A2_UINT=25
R10G10B10A2_UNORM=24
R10G10B10_XR_BIAS_A2_UNORM=89
R11G11B10_FLOAT=26
R16G16B16A16_FLOAT=10
R16G16B16A16_SINT=14
R16G16B16A16_SNORM=13
R16G16B16A16_TYPELESS=9
R16G16B16A16_UINT=12
R16G16B16A16_UNORM=11
R16G16_FLOAT=34
R16G16_SINT=38
R16G16_SNORM=37
R16G16_TYPELESS=33
R16G16_UINT=36
R16G16_UNORM=35
R16_FLOAT=54
R16_SINT=59
R16_SNORM=58
R16_TYPELESS=53
R16_UINT=57
R16_UNORM=56
R1_UNORM=66
R24G8_TYPELESS=44
R24_UNORM_X8_TYPELESS=46
R32G32B32A32_FLOAT=2
R32G32B32A32_SINT=4
R32G32B32A32_TYPELESS=1
R32G32B32A32_UINT=3
R32G32B32_FLOAT=6
R32G32B32_SINT=8
R32G32B32_TYPELESS=5
R32G32B32_UINT=7
R32G32_FLOAT=16
R32G32_SINT=18
R32G32_TYPELESS=15
R32G32_UINT=17
R32G8X24_TYPELESS=19
R32_FLOAT=41
R32_FLOAT_X8X24_TYPELESS=21
R32_SINT=43
R32_TYPELESS=39
R32_UINT=42
R8G8B8A8_SINT=32
R8G8B8A8_SNORM=31
R8G8B8A8_TYPELESS=27
R8G8B8A8_UINT=30
R8G8B8A8_UNORM=28
R8G8B8A8_UNORM_SRGB=29
R8G8_B8G8_UNORM=68
R8G8_SINT=52
R8G8_SNORM=51
R8G8_TYPELESS=48
R8G8_UINT=50
R8G8_UNORM=49
R8_SINT=64
R8_SNORM=63
R8_TYPELESS=60
R8_UINT=62
R8_UNORM=61
R9G9B9E5_SHAREDEXP=67
SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=189
SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=190
UNKNOWN=0
V208=131
V408=132
X24_TYPELESS_G8_UINT=47
X32_TYPELESS_G8X24_UINT=22
Y210=108
Y216=109
Y410=101
Y416=102
YUY2=107
classPIL.DdsImagePlugin.DdsImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='DDS'
format_description:str|None='DirectDrawSurface'
load_seek(pos:int)None[source]
classPIL.DdsImagePlugin.DdsRgbDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

EpsImagePlugin module

classPIL.EpsImagePlugin.EpsImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

EPS File Parser for the Python Imaging Library

format:str|None='EPS'
format_description:str|None='EncapsulatedPostscript'
load(scale:int=1,transparency:bool=False)Image.core.PixelAccess|None[source]

Load image data based on tile list

load_seek(pos:int)None[source]
mode_map={1:'L',2:'LAB',3:'RGB',4:'CMYK'}
PIL.EpsImagePlugin.Ghostscript(tile:list[ImageFile._Tile],size:tuple[int,int],fp:IO[bytes],scale:int=1,transparency:bool=False)Image.core.ImagingCore[source]

Render an image using Ghostscript

PIL.EpsImagePlugin.has_ghostscript()bool[source]

FitsImagePlugin module

classPIL.FitsImagePlugin.FitsGzipDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

classPIL.FitsImagePlugin.FitsImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='FITS'
format_description:str|None='FITS'

FliImagePlugin module

classPIL.FliImagePlugin.FliImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='FLI'
format_description:str|None='AutodeskFLI/FLCAnimation'
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

FpxImagePlugin module

classPIL.FpxImagePlugin.FpxImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

close()None[source]

Closes the file pointer, if possible.

This operation will destroy the image core and release its memory.The image data will be unusable afterward.

This function is required to close images that have multiple frames orhave not had their file read and closed by theload() method. SeeFile handling in Pillow formore information.

format:str|None='FPX'
format_description:str|None='FlashPix'
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

GbrImagePlugin module

classPIL.GbrImagePlugin.GbrImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='GBR'
format_description:str|None='GIMPbrushfile'
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

GifImagePlugin module

classPIL.GifImagePlugin.GifImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

data()bytes|None[source]
format:str|None='GIF'
format_description:str|None='CompuserveGIF'
global_palette=None
propertyis_animated:bool[source]
load_end()None[source]
load_prepare()None[source]
propertyn_frames:int
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

PIL.GifImagePlugin.LOADING_STRATEGY=LoadingStrategy.RGB_AFTER_FIRST

Added in version 9.1.0.

classPIL.GifImagePlugin.LoadingStrategy(*values)[source]

Bases:IntEnum

Added in version 9.1.0.

RGB_AFTER_DIFFERENT_PALETTE_ONLY=1
RGB_AFTER_FIRST=0
RGB_ALWAYS=2
PIL.GifImagePlugin.get_interlace(im:Image)int[source]
PIL.GifImagePlugin.getdata(im:Image,offset:tuple[int,int]=(0,0),**params:Any)list[bytes][source]

Legacy Method

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

To specify duration, add the time in milliseconds,e.g.getdata(im_frame,duration=1000)

Parameters:
  • im – Image object

  • offset – Tuple of (x, y) pixels. Defaults to (0, 0)

  • **params – e.g. duration or other encoder info parameters

Returns:

List of bytes containing GIF encoded frame data

PIL.GifImagePlugin.getheader(im:Image,palette:bytes|bytearray|list[int]|ImagePalette|None=None,info:dict[str,Any]|None=None)tuple[list[bytes],list[int]|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 – encoderinfo

Returns:

tuple of(list of header items, optimized palette)

GribStubImagePlugin module

classPIL.GribStubImagePlugin.GribStubImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:StubImageFile

format:str|None='GRIB'
format_description:str|None='GRIB'
PIL.GribStubImagePlugin.register_handler(handler:StubHandler|None)None[source]

Install application-specific GRIB image handler.

Parameters:

handler – Handler object.

Hdf5StubImagePlugin module

classPIL.Hdf5StubImagePlugin.HDF5StubImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:StubImageFile

format:str|None='HDF5'
format_description:str|None='HDF5'
PIL.Hdf5StubImagePlugin.register_handler(handler:StubHandler|None)None[source]

Install application-specific HDF5 image handler.

Parameters:

handler – Handler object.

IcnsImagePlugin module

classPIL.IcnsImagePlugin.IcnsFile(fobj:IO[bytes])[source]

Bases:object

SIZES={(16,16,1):[(b'icp4',<functionread_png_or_jpeg2000>),(b'is32',<functionread_32>),(b's8mk',<functionread_mk>)],(16,16,2):[(b'ic11',<functionread_png_or_jpeg2000>)],(32,32,1):[(b'icp5',<functionread_png_or_jpeg2000>),(b'il32',<functionread_32>),(b'l8mk',<functionread_mk>)],(32,32,2):[(b'ic12',<functionread_png_or_jpeg2000>)],(48,48,1):[(b'ih32',<functionread_32>),(b'h8mk',<functionread_mk>)],(64,64,1):[(b'icp6',<functionread_png_or_jpeg2000>)],(128,128,1):[(b'ic07',<functionread_png_or_jpeg2000>),(b'it32',<functionread_32t>),(b't8mk',<functionread_mk>)],(128,128,2):[(b'ic13',<functionread_png_or_jpeg2000>)],(256,256,1):[(b'ic08',<functionread_png_or_jpeg2000>)],(256,256,2):[(b'ic14',<functionread_png_or_jpeg2000>)],(512,512,1):[(b'ic09',<functionread_png_or_jpeg2000>)],(512,512,2):[(b'ic10',<functionread_png_or_jpeg2000>)]}
bestsize()tuple[int,int,int][source]
dataforsize(size:tuple[int,int,int])dict[str,Image][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:tuple[int,int]|tuple[int,int,int]|None=None)Image[source]
itersizes()list[tuple[int,int,int]][source]
classPIL.IcnsImagePlugin.IcnsImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases: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:str|None='ICNS'
format_description:str|None='MacOSicnsresource'
load(scale:int|None=None)Image.core.PixelAccess|None[source]

Load image data based on tile list

propertysize:tuple[int,int]
PIL.IcnsImagePlugin.nextheader(fobj:IO[bytes])tuple[bytes,int][source]
PIL.IcnsImagePlugin.read_32(fobj:IO[bytes],start_length:tuple[int,int],size:tuple[int,int,int])dict[str,Image][source]

Read a 32bit RGB icon resource. Seems to be either uncompressed oran RLE packbits-like scheme.

PIL.IcnsImagePlugin.read_32t(fobj:IO[bytes],start_length:tuple[int,int],size:tuple[int,int,int])dict[str,Image][source]
PIL.IcnsImagePlugin.read_mk(fobj:IO[bytes],start_length:tuple[int,int],size:tuple[int,int,int])dict[str,Image][source]
PIL.IcnsImagePlugin.read_png_or_jpeg2000(fobj:IO[bytes],start_length:tuple[int,int],size:tuple[int,int,int])dict[str,Image][source]

IcoImagePlugin module

classPIL.IcoImagePlugin.IcoFile(buf:IO[bytes])[source]

Bases:object

frame(idx:int)Image[source]

Get an image from frame idx

getentryindex(size:tuple[int,int],bpp:int|bool=False)int[source]
getimage(size:tuple[int,int],bpp:int|bool=False)Image[source]

Get an image from the icon

sizes()set[tuple[int,int]][source]

Get a set of all available icon sizes and color depths.

classPIL.IcoImagePlugin.IcoImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases: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. If you are unable to view the icon in Windows, convert theimage to “RGBA” mode before saving.

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:str|None='ICO'
format_description:str|None='WindowsIcon'
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

load_seek(pos:int)None[source]
propertysize:tuple[int,int]
classPIL.IcoImagePlugin.IconHeader(width,height,nb_color,reserved,planes,bpp,size,offset,dim,square,color_depth)[source]

Bases:NamedTuple

bpp:int

Alias for field number 5

color_depth:int

Alias for field number 10

dim:tuple[int,int]

Alias for field number 8

height:int

Alias for field number 1

nb_color:int

Alias for field number 2

offset:int

Alias for field number 7

planes:int

Alias for field number 4

reserved:int

Alias for field number 3

size:int

Alias for field number 6

square:int

Alias for field number 9

width:int

Alias for field number 0

ImImagePlugin module

classPIL.ImImagePlugin.ImImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='IM'
format_description:str|None='IFUNCImageMemory'
propertyis_animated:bool
propertyn_frames:int
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

PIL.ImImagePlugin.number(s:Any)float[source]

ImtImagePlugin module

classPIL.ImtImagePlugin.ImtImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='IMT'
format_description:str|None='IMTools'

IptcImagePlugin module

classPIL.IptcImagePlugin.IptcImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

field()tuple[tuple[int,int]|None,int][source]
format:str|None='IPTC'
format_description:str|None='IPTC/NAA'
getint(key:tuple[int,int])int[source]
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

PIL.IptcImagePlugin.getiptcinfo(im:ImageFile)dict[tuple[int,int],bytes|list[bytes]]|None[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:JpegImageFile,marker:int)None[source]
PIL.JpegImagePlugin.COM(self:JpegImageFile,marker:int)None[source]
PIL.JpegImagePlugin.DQT(self:JpegImageFile,marker:int)None[source]
classPIL.JpegImagePlugin.JpegImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

draft(mode:str|None,size:tuple[int,int]|None)tuple[str,tuple[int,int,float,float]]|None[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 grayscale while loading it.

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

Note that this method modifies theImage 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:
  • mode – The requested mode.

  • size – The requested size in pixels, as a 2-tuple:(width, height).

format:str|None='JPEG'
format_description:str|None='JPEG(ISO10918)'
load_djpeg()None[source]
load_read(read_bytes:int)bytes[source]

internal: read more image dataFor premature EOF and LOAD_TRUNCATED_IMAGES adds EOI markerso libjpeg can finish decoding

PIL.JpegImagePlugin.SOF(self:JpegImageFile,marker:int)None[source]
PIL.JpegImagePlugin.Skip(self:JpegImageFile,marker:int)None[source]
PIL.JpegImagePlugin.get_sampling(im:Image)int[source]
PIL.JpegImagePlugin.jpeg_factory(fp:IO[bytes],filename:str|bytes|None=None)JpegImageFile|MpoImageFile[source]

Jpeg2KImagePlugin module

classPIL.Jpeg2KImagePlugin.BoxReader(fp:IO[bytes],length:int=-1)[source]

Bases:object

A small helper class to read fields stored in JPEG2000 header boxesand to easily step into and read sub-boxes.

has_next_box()bool[source]
next_box_type()bytes[source]
read_boxes()BoxReader[source]
read_fields(field_format:str)tuple[int|bytes,...][source]
classPIL.Jpeg2KImagePlugin.Jpeg2KImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='JPEG2000'
format_description:str|None='JPEG2000(ISO15444)'
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

propertyreduce:Callable[[int|tuple[int,int],tuple[int,int,int,int]|None],Image.Image]|int

Returns a copy of the image reducedfactor times.If the size of the image is not dividable byfactor,the resulting size will be rounded up.

Parameters:
  • factor – A greater than 0 integer or tuple of two integersfor width and height separately.

  • 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 orNone, the entire source is used.

McIdasImagePlugin module

classPIL.McIdasImagePlugin.McIdasImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='MCIDAS'
format_description:str|None='McIdasareafile'

MicImagePlugin module

classPIL.MicImagePlugin.MicImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:TiffImageFile

close()None[source]

Closes the file pointer, if possible.

This operation will destroy the image core and release its memory.The image data will be unusable afterward.

This function is required to close images that have multiple frames orhave not had their file read and closed by theload() method. SeeFile handling in Pillow formore information.

format:str|None='MIC'
format_description:str|None='MicrosoftImageComposer'
seek(frame:int)None[source]

Select a given frame as current image

tell()int[source]

Return the current frame number

MpegImagePlugin module

classPIL.MpegImagePlugin.BitStream(fp:SupportsRead[bytes])[source]

Bases:object

next()int[source]
peek(bits:int)int[source]
read(bits:int)int[source]
skip(bits:int)None[source]
classPIL.MpegImagePlugin.MpegImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='MPEG'
format_description:str|None='MPEG'

MpoImagePlugin module

classPIL.MpoImagePlugin.MpoImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:JpegImageFile

staticadopt(jpeg_instance:JpegImageFile,mpheader:dict[int,Any]|None=None)MpoImageFile[source]

Transform the instance of JpegImageFile intoan instance of MpoImageFile.After the call, the JpegImageFile is extendedto be an MpoImageFile.

This is essentially useful when opening a JPEGfile that reveals itself as an MPO, to avoiddouble call to _open.

format:str|None='MPO'
format_description:str|None='MPO(CIPADC-007)'
load_seek(pos:int)None[source]
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

MspImagePlugin module

classPIL.MspImagePlugin.MspDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

classPIL.MspImagePlugin.MspImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='MSP'
format_description:str|None='WindowsPaint'

PalmImagePlugin module

PIL.PalmImagePlugin.build_prototype_image()Image[source]

PcdImagePlugin module

classPIL.PcdImagePlugin.PcdImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='PCD'
format_description:str|None='KodakPhotoCD'
load_end()None[source]
load_prepare()None[source]

PcxImagePlugin module

classPIL.PcxImagePlugin.PcxImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='PCX'
format_description:str|None='Paintbrush'

PdfImagePlugin module

PixarImagePlugin module

classPIL.PixarImagePlugin.PixarImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='PIXAR'
format_description:str|None='PIXARrasterimage'

PngImagePlugin module

classPIL.PngImagePlugin.Blend(*values)[source]

Bases:IntEnum

OP_OVER=1

This frame should be alpha composited with the previous output image contents.SeeSaving APNG sequences.

OP_SOURCE=0

All color components of this frame, including alpha, overwrite the previous outputimage contents.SeeSaving APNG sequences.

classPIL.PngImagePlugin.ChunkStream(fp:IO[bytes])[source]

Bases:object

call(cid:bytes,pos:int,length:int)bytes[source]

Call the appropriate chunk handler

close()None[source]
crc(cid:bytes,data:bytes)None[source]

Read and verify checksum

crc_skip(cid:bytes,data:bytes)None[source]

Read checksum

push(cid:bytes,pos:int,length:int)None[source]
read()tuple[bytes,int,int][source]

Fetch a new chunk. Returns header information.

verify(endchunk:bytes=b'IEND')list[bytes][source]
classPIL.PngImagePlugin.Disposal(*values)[source]

Bases:IntEnum

OP_BACKGROUND=1

This frame’s modified region is cleared to fully transparent black before renderingthe next frame.SeeSaving APNG sequences.

OP_NONE=0

No disposal is done on this frame before rendering the next frame.SeeSaving APNG sequences.

OP_PREVIOUS=2

This frame’s modified region is reverted to the previous frame’s contents beforerendering the next frame.SeeSaving APNG sequences.

classPIL.PngImagePlugin.PngImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

getexif()Exif[source]

Gets EXIF data from the image.

Returns:

anExif object.

load_end()None[source]

internal: finished reading image data

load_prepare()None[source]

internal: prepare to read PNG file

load_read(read_bytes:int)bytes[source]

internal: read more image data

seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

verify()None[source]

Verify PNG file

format:str|None='PNG'
format_description:str|None='Portablenetworkgraphics'
propertytext:dict[str,str|iTXt]
classPIL.PngImagePlugin.PngStream(fp:IO[bytes])[source]

Bases:ChunkStream

check_text_memory(chunklen:int)None[source]
chunk_IDAT(pos:int,length:int)NoReturn[source]
chunk_IEND(pos:int,length:int)NoReturn[source]
chunk_IHDR(pos:int,length:int)bytes[source]
chunk_PLTE(pos:int,length:int)bytes[source]
chunk_acTL(pos:int,length:int)bytes[source]
chunk_cHRM(pos:int,length:int)bytes[source]
chunk_eXIf(pos:int,length:int)bytes[source]
chunk_fcTL(pos:int,length:int)bytes[source]
chunk_fdAT(pos:int,length:int)bytes[source]
chunk_gAMA(pos:int,length:int)bytes[source]
chunk_iCCP(pos:int,length:int)bytes[source]
chunk_iTXt(pos:int,length:int)bytes[source]
chunk_pHYs(pos:int,length:int)bytes[source]
chunk_sRGB(pos:int,length:int)bytes[source]
chunk_tEXt(pos:int,length:int)bytes[source]
chunk_tRNS(pos:int,length:int)bytes[source]
chunk_zTXt(pos:int,length:int)bytes[source]
rewind()None[source]
save_rewind()None[source]
PIL.PngImagePlugin.getchunks(im:Image.Image,**params:Any)list[tuple[bytes,bytes,bytes]][source]

Return a list of PNG chunks representing this image.

PIL.PngImagePlugin.is_cid(string,pos=0,endpos=9223372036854775807)

Matches zero or more characters at the beginning of the string.

PIL.PngImagePlugin.putchunk(fp:IO[bytes],cid:bytes,*data:bytes)None[source]

Write a PNG chunk (including CRC field)

PIL.PngImagePlugin.MAX_TEXT_CHUNK=1048576

Maximum decompressed size for a iTXt or zTXt chunk.Eliminates decompression bombs where compressed chunks can expand 1000x.SeeText in PNG File Format.

PIL.PngImagePlugin.MAX_TEXT_MEMORY=67108864

Set the maximum total text chunk size.SeeText in PNG File Format.

PpmImagePlugin module

classPIL.PpmImagePlugin.PpmDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

classPIL.PpmImagePlugin.PpmImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='PPM'
format_description:str|None='Pbmplusimage'
classPIL.PpmImagePlugin.PpmPlainDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

PsdImagePlugin module

classPIL.PsdImagePlugin.PsdImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='PSD'
format_description:str|None='AdobePhotoshop'
propertyis_animated:bool
propertylayers:list[tuple[str,str,tuple[int,int,int,int],list[_Tile]]][source]
propertyn_frames:int
seek(layer:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

SgiImagePlugin module

classPIL.SgiImagePlugin.SGI16Decoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

classPIL.SgiImagePlugin.SgiImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='SGI'
format_description:str|None='SGIImageFileFormat'

SpiderImagePlugin module

classPIL.SpiderImagePlugin.SpiderImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

convert2byte(depth:int=255)Image[source]
format:str|None='SPIDER'
format_description:str|None='Spider2Dimage'
propertyis_animated:bool
propertyn_frames:int
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

tkPhotoImage()ImageTk.PhotoImage[source]
PIL.SpiderImagePlugin.isInt(f:Any)int[source]
PIL.SpiderImagePlugin.isSpiderHeader(t:tuple[float,...])int[source]
PIL.SpiderImagePlugin.isSpiderImage(filename:str)int[source]
PIL.SpiderImagePlugin.loadImageSeries(filelist:list[str]|None=None)list[Image]|None[source]

create a list ofImage objects for use in a montage

PIL.SpiderImagePlugin.makeSpiderHeader(im:Image)list[bytes][source]

SunImagePlugin module

classPIL.SunImagePlugin.SunImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='SUN'
format_description:str|None='SunRasterFile'

TgaImagePlugin module

classPIL.TgaImagePlugin.TgaImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='TGA'
format_description:str|None='Targa'
load_end()None[source]

TiffImagePlugin module

classPIL.TiffImagePlugin.AppendingTiffWriter(fn:StrOrBytesPath|IO[bytes],new:bool=False)[source]

Bases:BytesIO

Tags={273,288,324,519,520,521}
close()None[source]

Disable all I/O operations.

fieldSizes=[0,1,1,2,4,8,1,1,2,4,8,4,8,4,2,4,8]
finalize()None[source]
fixIFD()None[source]
fixOffsets(count:int,isShort:bool=False,isLong:bool=False)None[source]
goToEnd()None[source]
newFrame()None[source]
readLong()int[source]
readShort()int[source]
rewriteLastLong(value:int)None[source]
rewriteLastShort(value:int)None[source]
rewriteLastShortToLong(value:int)None[source]
seek(offset:int,whence:int=0)int[source]
Parameters:
  • offset – Distance to seek.

  • whence – Whether the distance is relative to the start,end or current position.

Returns:

The resulting position, relative to the start.

setEndian(endian:str)None[source]
setup()None[source]
skipIFDs()None[source]
tell()int[source]

Current file position, an integer.

write(data:Buffer,/)int[source]

Write bytes to file.

Return the number of bytes written.

writeLong(value:int)None[source]
writeShort(value:int)None[source]
classPIL.TiffImagePlugin.IFDRational(value:float|Fraction|IFDRational,denominator:int=1)[source]

Bases: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

propertydenominator:int
limit_rational(max_denominator:int)tuple[IntegralLike,int][source]
Parameters:

max_denominator – Integer, the maximum denominator value

Returns:

Tuple of (numerator, denominator)

propertynumerator:IntegralLike
PIL.TiffImagePlugin.ImageFileDirectory

alias ofImageFileDirectory_v1

classPIL.TiffImagePlugin.ImageFileDirectory_v1(*args:Any,**kwargs:Any)[source]

Bases:ImageFileDirectory_v2

This class represents thelegacy 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]=TiffTags.ASCIIprint(ifd[key])('Some Data',)

Also contains a dictionary of tag types as read from the tiff image file,tagtype.

Values are returned as a tuple.

Deprecated since version 3.0.0.

classmethodfrom_v2(original:ImageFileDirectory_v2)ImageFileDirectory_v1[source]

Returns anImageFileDirectory_v1instance with the same data as is contained in the originalImageFileDirectory_v2instance.

Returns:

ImageFileDirectory_v1

propertytagdata
propertytags
tagtype:dict[int,int]

Dictionary of tag types

to_v2()ImageFileDirectory_v2[source]

Returns anImageFileDirectory_v2instance with the same data as is contained in the originalImageFileDirectory_v1instance.

Returns:

ImageFileDirectory_v2

classPIL.TiffImagePlugin.ImageFileDirectory_v2(ifh:bytes=b'II*\x00\x00\x00\x00\x00',prefix:bytes|None=None,group:int|None=None)[source]

Bases: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:

ifd=ImageFileDirectory_v2()ifd[key]='Some Data'ifd.tagtype[key]=TiffTags.ASCIIprint(ifd[key])'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 intagtype. 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 fromTiffTags.TYPES

    Added in version 3.0.0.

‘Internal’ data structures:

  • self._tags_v2={}

    • Key: numerical TIFF tag number

    • Value: decoded data, as tuple for multiple values

  • self._tagdata={}

    • Key: numerical TIFF tag number

    • Value: undecoded byte string from file

  • self._tags_v1={}

    • Key: numerical TIFF tag number

    • Value: decoded data in the v1 format

Tags will be found in the private attributesself._tagdata, and inself._tags_v2 once decoded.

self.legacy_api is a value for internal use, and shouldn’t be changedfrom outside code. In cooperation withImageFileDirectory_v1, iflegacy_apiis true, then decoded tags will be populated into both_tags_v1 and_tags_v2._tags_v2 will be used if this IFD is used in the TIFFsave routine. Tags should be read from_tags_v1 iflegacy_api==true.

propertylegacy_api:bool
load(fp:IO[bytes])None[source]
load_byte(data:bytes,legacy_api:bool=True)bytes[source]
load_double(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_float(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_long(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_long8(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_rational(data:bytes,legacy_api:bool=True)tuple[tuple[int,int]|IFDRational,...][source]
load_short(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_signed_byte(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_signed_long(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_signed_rational(data:bytes,legacy_api:bool=True)tuple[tuple[int,int]|IFDRational,...][source]
load_signed_short(data:bytes,legacy_api:bool=True)tuple[Any,...]
load_string(data:bytes,legacy_api:bool=True)str[source]
load_undefined(data:bytes,legacy_api:bool=True)bytes[source]
named()dict[str,Any][source]
Returns:

dict of name|key: value

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

propertyoffset
propertyprefix
reset()None[source]
save(fp:IO[bytes])int[source]
tagtype:dict[int,int]

Dictionary of tag types

tobytes(offset:int=0)bytes[source]
write_byte(data:bytes|int|IFDRational)bytes[source]
write_double(*values)
write_float(*values)
write_long(*values)
write_long8(*values)
write_rational(*values:IFDRational)bytes[source]
write_short(*values)
write_signed_byte(*values)
write_signed_long(*values)
write_signed_rational(*values:IFDRational)bytes[source]
write_signed_short(*values)
write_string(value:str|bytes|int)bytes[source]
write_undefined(value:bytes|int|IFDRational)bytes[source]
classPIL.TiffImagePlugin.TiffImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='TIFF'
format_description:str|None='AdobeTIFF'
get_photoshop_blocks()dict[int,dict[str,bytes]][source]

Returns a dictionary of Photoshop “Image Resource Blocks”.The keys are the image resource ID. For more information, seehttps://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1037727

Returns:

Photoshop “Image Resource Blocks” in a dictionary.

load()Image.core.PixelAccess|None[source]

Load image data based on tile list

load_end()None[source]
load_prepare()None[source]
propertyn_frames:int
seek(frame:int)None[source]

Select a given frame as current image

tag:ImageFileDirectory_v1

Legacy tag entries

tag_v2:ImageFileDirectory_v2

Image file directory (tag dictionary)

tell()int[source]

Return the current frame number

WebPImagePlugin module

classPIL.WebPImagePlugin.WebPImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='WEBP'
format_description:str|None='WebPimage'
load()Image.core.PixelAccess|None[source]

Load image data based on tile list

load_seek(pos:int)None[source]
seek(frame:int)None[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.

Seetell().

If defined,n_frames refers to thenumber of available frames.

Parameters:

frame – Frame number, starting at 0.

Raises:

EOFError – If the call attempts to seek beyond the endof the sequence.

tell()int[source]

Returns the current frame number. Seeseek().

If defined,n_frames refers to thenumber of available frames.

Returns:

Frame number, starting with 0.

WmfImagePlugin module

classPIL.WmfImagePlugin.WmfStubImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:StubImageFile

format:str|None='WMF'
format_description:str|None='WindowsMetafile'
load(dpi:float|tuple[float,float]|None=None)Image.core.PixelAccess|None[source]

Load image data based on tile list

PIL.WmfImagePlugin.register_handler(handler:StubHandler|None)None[source]

Install application-specific WMF image handler.

Parameters:

handler – Handler object.

XVThumbImagePlugin module

classPIL.XVThumbImagePlugin.XVThumbImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='XVThumb'
format_description:str|None='XVthumbnailimage'

XbmImagePlugin module

classPIL.XbmImagePlugin.XbmImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='XBM'
format_description:str|None='X11Bitmap'

XpmImagePlugin module

classPIL.XpmImagePlugin.XpmDecoder(mode:str,*args:Any)[source]

Bases:PyDecoder

decode(buffer:bytes|SupportsArrayInterface)tuple[int,int][source]

Override to perform the decoding process.

Parameters:

buffer – A bytes object with the data to be decoded.

Returns:

A tuple of(bytesconsumed,errcode).If finished with decoding return -1 for the bytes consumed.Err codes are fromImageFile.ERRORS.

classPIL.XpmImagePlugin.XpmImageFile(fp:StrOrBytesPath|IO[bytes],filename:str|bytes|None=None)[source]

Bases:ImageFile

format:str|None='XPM'
format_description:str|None='X11PixelMap'
load_read(read_bytes:int)bytes[source]
On this page

[8]ページ先頭

©2009-2025 Movatter.jp