PIL package (autodoc of remaining modules)¶
Reference for modules whose documentation has not yet been ported or written can be found here.
PIL module¶
- exception PIL.UnidentifiedImageError[source]¶
Bases:
OSErrorRaised in
PIL.Image.open()if an image cannot be opened and identified.If a PNG image raises this error, setting
ImageFile.LOAD_TRUNCATED_IMAGESto true may allow the image to be opened after all. The setting will ignore missing data and checksum failures.
BdfFontFile module¶
ContainerIO module¶
- class PIL.ContainerIO.ContainerIO(file: IO, offset: int, length: int)[source]¶
Bases:
IOA file object that provides read access to a part of an existing file (for example a TAR file).
- read(n: int = -1) AnyStr[source]¶
Read data.
- Parameters:
n – Number of bytes to read. If omitted, zero or negative, read until end of region.
- Returns:
An 8-bit string.
- readline(n: int = -1) AnyStr[source]¶
Read a line of text.
- Parameters:
n – Number of bytes to read. If omitted, zero or negative, read until end of line.
- Returns:
An 8-bit string.
- readlines(n: int | None = -1) list[AnyStr][source]¶
Read multiple lines of text.
- Parameters:
n – Number of lines to read. If omitted, zero, negative or None, read until end of region.
- Returns:
A list of 8-bit strings.
- seek(offset: int, mode: int = 0) int[source]¶
Move file pointer.
- Parameters:
offset – Offset in bytes.
mode – Starting position. Use 0 for beginning of region, 1 for current offset, and 2 for end of region. You cannot move the pointer outside the defined region.
- Returns:
Offset from start of region, in bytes.
FontFile module¶
GdImageFile module¶
GimpGradientFile module¶
Stuff to translate curve segments to palette values (derived from the corresponding code in GIMP, written by Federico Mena Quintero. See the GIMP distribution for more information.)
- PIL.GimpGradientFile.EPSILON = 1e-10¶
- class PIL.GimpGradientFile.GimpGradientFile(fp: IO[bytes])[source]¶
Bases:
GradientFileFile handler for GIMP’s gradient format.
- PIL.GimpGradientFile.SEGMENTS = [<function linear>, <function curved>, <function sine>, <function sphere_increasing>, <function sphere_decreasing>]¶
GimpPaletteFile module¶
ImageDraw2 module¶
ImageMode module¶
- class PIL.ImageMode.ModeDescriptor(mode: str, bands: tuple[str, ...], basemode: str, basetype: str, typestr: str)[source]¶
Bases:
NamedTupleWrapper for mode strings.
- PIL.ImageMode.getmode(mode: str) ModeDescriptor[source]¶
Gets a mode descriptor for the given mode.