brk-code

Pillow の API リファレンス

Pillow (python-pillow/Pillow) の公開 API 297 件 —— クラス 68、関数 113、メソッド 116。実際のソースを静的解析して抽出した正確なシグネチャを掲載しています。

リポジトリ: python-pillow/Pillow

種別件数
クラス68
関数113
メソッド116

API 一覧

func.github.compare-dist-sizes.display_for(filename:str) -> str
Strip the `pillow-{version}-` prefix for compact table display.
func.github.compare-dist-sizes.key_for(filename:str) -> str
Return a version-independent identifier for a dist file.
func.github.compare-dist-sizes.pct_severity(text:str) -> dict[str, str] | None
Return status indicators based on the change percent.
func.github.embed-sbom.record_entry(path:str, data:bytes) -> bytes
Build a RECORD line: `path,sha256=<base64url-nopad>,<size>`.
func.github.embed-sbom.scan_dir(path:Path) -> Path
If `path` is a directory, return the path of the SBOM within.
classsrc.PIL.BdfFontFile.BdfFontFile
Font file plugin for the X11 BDF format.
classsrc.PIL.BlpImagePlugin.BlpImageFile
Blizzard Mipmap Format
funcsrc.PIL.BlpImagePlugin.decode_dxt1(data:bytes, alpha:bool=False) -> tuple[bytearray, bytearray, bytearray, bytearray]
input: one "row" of data (i.e.
funcsrc.PIL.BlpImagePlugin.decode_dxt3(data:bytes) -> tuple[bytearray, bytearray, bytearray, bytearray]
input: one "row" of data (i.e.
funcsrc.PIL.BlpImagePlugin.decode_dxt5(data:bytes) -> tuple[bytearray, bytearray, bytearray, bytearray]
input: one "row" of data (i.e.
classsrc.PIL.BmpImagePlugin.BmpImageFile
Image plugin for the Windows Bitmap format (BMP)
funcsrc.PIL.BufrStubImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> None
Install application-specific BUFR image handler.
classsrc.PIL.EpsImagePlugin.EpsImageFile
EPS File Parser for the Python Imaging Library
funcsrc.PIL.EpsImagePlugin.Ghostscript(tile:list[ImageFile._Tile], size:tuple[int, int], fp:IO[bytes], scale:int=1, transparency:bool=False) -> Image.core.ImagingCore
Render an image using Ghostscript
classsrc.PIL.FontFile.FontFile
Base class for raster font file handlers.
methodsrc.PIL.FontFile.FontFile.compile() -> None
Create metrics and bitmap
methodsrc.PIL.FontFile.FontFile.save(filename:str) -> None
Save font
methodsrc.PIL.FontFile.FontFile.to_imagefont() -> ImageFont.ImageFont
Convert to ImageFont
funcsrc.PIL.FontFile.puti16(fp:BinaryIO, values:tuple[int, int, int, int, int, int, int, int, int, int]) -> None
Write network order (big-endian) 16-bit sequence
classsrc.PIL.GdImageFile.GdImageFile
Image plugin for the GD uncompressed format.
funcsrc.PIL.GdImageFile.open(fp:StrOrBytesPath | IO[bytes], mode:str='r') -> GdImageFile
Load texture from a GD image file.
classsrc.PIL.GifImagePlugin.LoadingStrategy
..
funcsrc.PIL.GifImagePlugin.getheader(im:Image.Image, palette:_Palette | None=None, info:dict[str, Any] | None=None) -> tuple[list[bytes], list[int] | None]
Legacy Method to get Gif data from image.
classsrc.PIL.GimpGradientFile.GimpGradientFile
File handler for GIMP's gradient format.
classsrc.PIL.GimpPaletteFile.GimpPaletteFile
File handler for GIMP's palette format.
funcsrc.PIL.GribStubImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> None
Install application-specific GRIB image handler.
funcsrc.PIL.Hdf5StubImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> None
Install application-specific HDF5 image handler.
classsrc.PIL.IcnsImagePlugin.IcnsImageFile
PIL image support for Mac OS .icns files.
funcsrc.PIL.IcnsImagePlugin.read_32(fobj:IO[bytes], start_length:tuple[int, int], size:tuple[int, int, int]) -> dict[str, Image.Image]
Read a 32bit RGB icon resource.
classsrc.PIL.Image.Image
This class represents an image object.
methodsrc.PIL.Image.Image.alpha_composite(im:Image, dest:Sequence[int]=(0, 0), source:Sequence[int]=(0, 0)) -> None
'In-place' analog of Image.alpha_composite.
methodsrc.PIL.Image.Image.convert(mode:str | None=None, matrix:tuple[float, ...] | None=None, dither:Dither | None=None, palette:Palette=Palette.WEB, colors:int=256) -> Image
Returns a converted copy of this image.
methodsrc.PIL.Image.Image.copy() -> Image
Copies this image.
methodsrc.PIL.Image.Image.crop(box:tuple[float, float, float, float] | None=None) -> Image
Returns a rectangular region from this image.
methodsrc.PIL.Image.Image.effect_spread(distance:int) -> Image
Randomly spread pixels in an image.
methodsrc.PIL.Image.Image.entropy(mask:Image | None=None, extrema:tuple[float, float] | None=None) -> float
Calculates and returns the entropy for the image.
methodsrc.PIL.Image.Image.filter(filter:ImageFilter.Filter | type[ImageFilter.Filter]) -> Image
Filters this image using the given filter.
methodsrc.PIL.Image.Image.frombytes(data:DecoderInput, decoder_name:str='raw', *args:Any) -> None
Loads this image with pixel data from a bytes object.
methodsrc.PIL.Image.Image.getchannel(channel:int | str) -> Image
Returns an image containing a single channel of the source image.
methodsrc.PIL.Image.Image.getcolors(maxcolors:int=256) -> list[tuple[int, tuple[int, ...]]] | list[tuple[int, float]] | None
Returns a list of colors used in this image.
methodsrc.PIL.Image.Image.getexif() -> Exif
Gets EXIF data from the image.
methodsrc.PIL.Image.Image.getim() -> CapsuleType
Returns a capsule that points to the internal image memory.
methodsrc.PIL.Image.Image.getpalette(rawmode:str | None='RGB') -> list[int] | None
Returns the image palette as a list.
methodsrc.PIL.Image.Image.getpixel(xy:tuple[int, int] | list[int]) -> float | tuple[int, ...] | None
Returns the pixel value at a given position.
methodsrc.PIL.Image.Image.getxmp() -> dict[str, Any]
Returns a dictionary containing the XMP tags.
methodsrc.PIL.Image.Image.histogram(mask:Image | None=None, extrema:tuple[float, float] | None=None) -> list[int]
Returns a histogram for the image.
methodsrc.PIL.Image.Image.load() -> core.PixelAccess | None
Allocates storage for the image and loads the pixel data.
methodsrc.PIL.Image.Image.paste(im:Image | str | float | tuple[float, ...], box:Image | tuple[int, int, int, int] | tuple[int, int] | None=None, mask:Image | None=None) -> None
Pastes another image into this image.
methodsrc.PIL.Image.Image.putalpha(alpha:Image | int) -> None
Adds or replaces the alpha layer in this image.
methodsrc.PIL.Image.Image.putpalette(data:ImagePalette.ImagePalette | bytes | Sequence[int], rawmode:str='RGB') -> None
Attaches a palette to this image.
methodsrc.PIL.Image.Image.putpixel(xy:tuple[int, int] | list[int], value:float | tuple[int, ...] | list[int]) -> None
Modifies the pixel at the given position.
methodsrc.PIL.Image.Image.reduce(factor:int | tuple[int, int], box:tuple[int, int, int, int] | None=None) -> Image
Returns a copy of the image reduced ``factor`` times.
methodsrc.PIL.Image.Image.remap_palette(dest_map:list[int], source_palette:bytes | bytearray | None=None) -> Image
Rewrites the image to reorder the palette.
methodsrc.PIL.Image.Image.resize(size:tuple[int, int] | list[int] | NumpyArray, resample:int | None=None, box:tuple[float, float, float, float] | None=None, reducing_gap:float | None=None) -> Image
Returns a resized copy of this image.
methodsrc.PIL.Image.Image.save(fp:StrOrBytesPath | IO[bytes], format:str | None=None, **params:Any) -> None
Saves this image under the given filename.
methodsrc.PIL.Image.Image.seek(frame:int) -> None
Seeks to the given frame in this sequence file.
methodsrc.PIL.Image.Image.show(title:str | None=None) -> None
Displays this image.
methodsrc.PIL.Image.Image.split() -> tuple[Image, ...]
Split this image into individual bands.
methodsrc.PIL.Image.Image.tell() -> int
Returns the current frame number.
methodsrc.PIL.Image.Image.thumbnail(size:tuple[float, float], resample:Resampling=Resampling.BICUBIC, reducing_gap:float | None=2.0) -> None
Make this image into a thumbnail.
methodsrc.PIL.Image.Image.tobitmap(name:str='image') -> bytes
Returns the image converted to an X11 bitmap.
methodsrc.PIL.Image.Image.tobytes(encoder_name:str='raw', *args:Any) -> bytes
Return image as a bytes object.
methodsrc.PIL.Image.Image.toqimage() -> ImageQt.ImageQt
Returns a QImage copy of this image
methodsrc.PIL.Image.Image.toqpixmap() -> ImageQt.QPixmap
Returns a QPixmap copy of this image
methodsrc.PIL.Image.Image.transform(size:tuple[int, int], method:Transform | ImageTransformHandler | SupportsGetData, data:Sequence[Any] | None=None, resample:int=Resampling.NEAREST, fill:int=1, fillcolor:float | tuple[float, ...] | str | None=None) -> Image
Transforms this image.
methodsrc.PIL.Image.Image.verify() -> None
Verifies the contents of a file.
classsrc.PIL.Image.SupportsArrayInterface
An object that has an ``__array_interface__`` dictionary.
funcsrc.PIL.Image.alpha_composite(im1:Image, im2:Image) -> Image
Alpha composite im2 over im1.
funcsrc.PIL.Image.composite(image1:Image, image2:Image, mask:Image) -> Image
Create composite image by blending images using a transparency mask.
funcsrc.PIL.Image.effect_mandelbrot(size:tuple[int, int], extent:tuple[float, float, float, float], quality:int) -> Image
Generate a Mandelbrot set covering the given extent.
funcsrc.PIL.Image.effect_noise(size:tuple[int, int], sigma:float) -> Image
Generate Gaussian noise centered around 128.
funcsrc.PIL.Image.fromqimage(im:ImageQt.QImage) -> ImageFile.ImageFile
Creates an image instance from a QImage image
funcsrc.PIL.Image.fromqpixmap(im:ImageQt.QPixmap) -> ImageFile.ImageFile
Creates an image instance from a QPixmap image
funcsrc.PIL.Image.getmodebandnames(mode:str) -> tuple[str, ...]
Gets a list of individual band names.
funcsrc.PIL.Image.getmodebands(mode:str) -> int
Gets the number of individual bands for this mode.
funcsrc.PIL.Image.getmodebase(mode:str) -> str
Gets the "base" mode for given mode.
funcsrc.PIL.Image.getmodetype(mode:str) -> str
Gets the storage type mode.
funcsrc.PIL.Image.init() -> bool
Explicitly initializes the Python Imaging Library.
funcsrc.PIL.Image.linear_gradient(mode:str) -> Image
Generate 256x256 linear gradient from black to white, top to bottom.
funcsrc.PIL.Image.merge(mode:str, bands:Sequence[Image]) -> Image
Merge a set of single band images into a new multiband image.
funcsrc.PIL.Image.new(mode:str, size:tuple[int, int] | list[int], color:float | tuple[float, ...] | str | None=0) -> Image
Creates a new image with the given mode and size.
funcsrc.PIL.Image.open(fp:StrOrBytesPath | IO[bytes], mode:Literal['r']='r', formats:list[str] | tuple[str, ...] | None=None) -> ImageFile.ImageFile
Opens and identifies the given image file.
funcsrc.PIL.Image.preinit() -> None
Explicitly loads BMP, GIF, JPEG, PPM and PNG file format drivers.
funcsrc.PIL.Image.radial_gradient(mode:str) -> Image
Generate 256x256 radial gradient from black to white, centre to edge.
funcsrc.PIL.Image.register_decoder(name:str, decoder:type[ImageFile.PyDecoder]) -> None
Registers an image decoder.
funcsrc.PIL.Image.register_encoder(name:str, encoder:type[ImageFile.PyEncoder]) -> None
Registers an image encoder.
funcsrc.PIL.Image.register_extension(id:str, extension:str) -> None
Registers an image extension.
funcsrc.PIL.Image.register_extensions(id:str, extensions:list[str]) -> None
Registers image extensions.
funcsrc.PIL.Image.register_mime(id:str, mimetype:str) -> None
Registers an image MIME type by populating ``Image.MIME``.
funcsrc.PIL.Image.register_open(id:str, factory:Callable[[IO[bytes], str | bytes], ImageFile.ImageFile] | type[ImageFile.ImageFile], accept:Callable[[bytes], bool | str] | None=None) -> None
Register an image file plugin.
funcsrc.PIL.Image.register_save(id:str, driver:Callable[[Image, IO[bytes], str | bytes], None]) -> None
Registers an image save function.
funcsrc.PIL.ImageChops.add_modulo(image1:Image.Image, image2:Image.Image) -> Image.Image
Add two images, without clipping the result.
funcsrc.PIL.ImageChops.blend(image1:Image.Image, image2:Image.Image, alpha:float) -> Image.Image
Blend images using constant transparency weight.
funcsrc.PIL.ImageChops.composite(image1:Image.Image, image2:Image.Image, mask:Image.Image) -> Image.Image
Create composite using transparency mask.
funcsrc.PIL.ImageChops.constant(image:Image.Image, value:int) -> Image.Image
Fill a channel with a given gray level.
funcsrc.PIL.ImageChops.duplicate(image:Image.Image) -> Image.Image
Copy a channel.
funcsrc.PIL.ImageChops.invert(image:Image.Image) -> Image.Image
Invert an image (channel).
funcsrc.PIL.ImageChops.logical_and(image1:Image.Image, image2:Image.Image) -> Image.Image
Logical AND between two images.
funcsrc.PIL.ImageChops.logical_or(image1:Image.Image, image2:Image.Image) -> Image.Image
Logical OR between two images.
funcsrc.PIL.ImageChops.logical_xor(image1:Image.Image, image2:Image.Image) -> Image.Image
Logical XOR between two images.
funcsrc.PIL.ImageChops.multiply(image1:Image.Image, image2:Image.Image) -> Image.Image
Superimposes two images on top of each other.
funcsrc.PIL.ImageChops.screen(image1:Image.Image, image2:Image.Image) -> Image.Image
Superimposes two inverted images on top of each other.
funcsrc.PIL.ImageChops.subtract_modulo(image1:Image.Image, image2:Image.Image) -> Image.Image
Subtract two images, without clipping the result.
classsrc.PIL.ImageCms.Flags
Flags and documentation are taken from ``lcms2.h``.
classsrc.PIL.ImageCms.ImageCmsTransform
Transform.
classsrc.PIL.ImageCms.PyCMSError
(pyCMS) Exception class.
funcsrc.PIL.ImageCms.applyTransform(im:Image.Image, transform:ImageCmsTransform, inPlace:bool=False) -> Image.Image | None
(pyCMS) Applies a transform to a given image.
funcsrc.PIL.ImageCms.createProfile(colorSpace:Literal['LAB', 'XYZ', 'sRGB'], colorTemp:SupportsFloat=0) -> core.CmsProfile
(pyCMS) Creates a profile.
funcsrc.PIL.ImageCms.getDefaultIntent(profile:_CmsProfileCompatible) -> int
(pyCMS) Gets the default intent name for the given profile.
funcsrc.PIL.ImageCms.getOpenProfile(profileFilename:str | SupportsRead[bytes] | core.CmsProfile) -> ImageCmsProfile
(pyCMS) Opens an ICC profile file.
funcsrc.PIL.ImageCms.getProfileCopyright(profile:_CmsProfileCompatible) -> str
(pyCMS) Gets the copyright for the given profile.
funcsrc.PIL.ImageCms.getProfileDescription(profile:_CmsProfileCompatible) -> str
(pyCMS) Gets the description for the given profile.
funcsrc.PIL.ImageCms.getProfileManufacturer(profile:_CmsProfileCompatible) -> str
(pyCMS) Gets the manufacturer for the given profile.
funcsrc.PIL.ImageCms.getProfileModel(profile:_CmsProfileCompatible) -> str
(pyCMS) Gets the model for the given profile.
funcsrc.PIL.ImageCms.getProfileName(profile:_CmsProfileCompatible) -> str
(pyCMS) Gets the internal product name for the given profile.
funcsrc.PIL.ImageCms.isIntentSupported(profile:_CmsProfileCompatible, intent:Intent, direction:Direction) -> Literal[-1, 1]
(pyCMS) Checks if a given intent is supported.
funcsrc.PIL.ImageColor.getcolor(color:str, mode:str) -> int | tuple[int, ...]
Same as :py:func:`~PIL.ImageColor.getrgb` for most modes.
funcsrc.PIL.ImageColor.getrgb(color:str) -> tuple[int, int, int] | tuple[int, int, int, int]
Convert a color string to an RGB or RGBA tuple.
funcsrc.PIL.ImageDraw.Draw(im:Image.Image, mode:str | None=None) -> ImageDraw
A simple 2D drawing interface for PIL images.
funcsrc.PIL.ImageDraw.floodfill(image:Image.Image, xy:tuple[int, int], value:float | tuple[int, ...], border:float | tuple[int, ...] | None=None, thresh:float=0) -> None
..
funcsrc.PIL.ImageDraw.getdraw(im:Image.Image | None=None) -> tuple[ImageDraw2.Draw | None, ModuleType]
:param im: The image to draw in.
classsrc.PIL.ImageDraw2.Brush
Stores a fill color
classsrc.PIL.ImageDraw2.Draw
(Experimental) WCK-style drawing interface
methodsrc.PIL.ImageDraw2.Draw.ellipse(xy:Coords, pen:Pen | Brush | None, *options:Any) -> None
Draws an ellipse inside the given bounding box.
methodsrc.PIL.ImageDraw2.Draw.line(xy:Coords, pen:Pen | Brush | None, *options:Any) -> None
Draws a line between the coordinates in the ``xy`` list.
methodsrc.PIL.ImageDraw2.Draw.polygon(xy:Coords, pen:Pen | Brush | None, *options:Any) -> None
Draws a polygon.
methodsrc.PIL.ImageDraw2.Draw.rectangle(xy:Coords, pen:Pen | Brush | None, *options:Any) -> None
Draws a rectangle.
methodsrc.PIL.ImageDraw2.Draw.settransform(offset:tuple[float, float]) -> None
Sets a transformation offset.
methodsrc.PIL.ImageDraw2.Draw.text(xy:tuple[float, float], text:AnyStr, font:Font) -> None
Draws the string at the given position.
methodsrc.PIL.ImageDraw2.Draw.textbbox(xy:tuple[float, float], text:AnyStr, font:Font) -> tuple[float, float, float, float]
Returns bounding box (in pixels) of given text.
methodsrc.PIL.ImageDraw2.Draw.textlength(text:AnyStr, font:Font) -> float
Returns length (in pixels) of given text.
classsrc.PIL.ImageDraw2.Font
Stores a TrueType font and color
classsrc.PIL.ImageDraw2.Pen
Stores an outline color and width.
classsrc.PIL.ImageEnhance.Brightness
Adjust image brightness.
classsrc.PIL.ImageEnhance.Color
Adjust image color balance.
classsrc.PIL.ImageEnhance.Contrast
Adjust image contrast.
classsrc.PIL.ImageEnhance.Sharpness
Adjust image sharpness.
classsrc.PIL.ImageFile.ImageFile
Base class for image file format handlers.
methodsrc.PIL.ImageFile.ImageFile.close() -> None
Closes the file pointer, if possible.
methodsrc.PIL.ImageFile.ImageFile.load() -> Image.core.PixelAccess | None
Load image data based on tile list
methodsrc.PIL.ImageFile.ImageFile.verify() -> None
Check file integrity
classsrc.PIL.ImageFile.Parser
Incremental image parser.
methodsrc.PIL.ImageFile.Parser.close() -> Image.Image
(Consumer) Close the stream.
methodsrc.PIL.ImageFile.Parser.feed(data:bytes) -> None
(Consumer) Feed data to the parser.
methodsrc.PIL.ImageFile.Parser.reset() -> None
(Consumer) Reset the parser.
classsrc.PIL.ImageFile.PyDecoder
Python implementation of a format decoder.
methodsrc.PIL.ImageFile.PyDecoder.decode(buffer:Image.DecoderInput) -> tuple[int, int]
Override to perform the decoding process.
classsrc.PIL.ImageFile.PyEncoder
Python implementation of a format encoder.
methodsrc.PIL.ImageFile.PyEncoder.encode(bufsize:int) -> tuple[int, int, bytes]
Override to perform the encoding process.
methodsrc.PIL.ImageFile.PyEncoder.encode_to_file(fh:int, bufsize:int) -> int
:param fh: File handle.
classsrc.PIL.ImageFile.StubImageFile
Base class for stub image loaders.
classsrc.PIL.ImageFilter.Color3DLUT
Three-dimensional color lookup table.
classsrc.PIL.ImageFilter.Kernel
Create a convolution kernel.
classsrc.PIL.ImageFilter.MaxFilter
Create a max filter.
classsrc.PIL.ImageFilter.MedianFilter
Create a median filter.
classsrc.PIL.ImageFilter.MinFilter
Create a min filter.
classsrc.PIL.ImageFilter.ModeFilter
Create a mode filter.
classsrc.PIL.ImageFilter.RankFilter
Create a rank filter.
classsrc.PIL.ImageFilter.UnsharpMask
Unsharp mask filter.
classsrc.PIL.ImageFont.BaseImageFont
Used by ImageDraw and ImageText
classsrc.PIL.ImageFont.FreeTypeFont
FreeType font wrapper (requires _imagingft service)
methodsrc.PIL.ImageFont.FreeTypeFont.get_variation_axes() -> list[Axis]
:returns: A list of the axes in a variation font.
methodsrc.PIL.ImageFont.FreeTypeFont.getname() -> tuple[str | None, str | None]
:return: A tuple of the font family (e.g.
methodsrc.PIL.ImageFont.FreeTypeFont.set_variation_by_axes(axes:list[float]) -> None
:param axes: A list of values for each axis.
methodsrc.PIL.ImageFont.FreeTypeFont.set_variation_by_name(name:str | bytes) -> None
:param name: The name of the style.
classsrc.PIL.ImageFont.ImageFont
PIL font wrapper
methodsrc.PIL.ImageFont.ImageFont.getbbox(text:str | bytes | bytearray, *args:Any, **kwargs:Any) -> tuple[int, int, int, int]
Returns bounding box (in pixels) of given text.
methodsrc.PIL.ImageFont.ImageFont.getlength(text:str | bytes | bytearray, *args:Any, **kwargs:Any) -> int
Returns length (in pixels) of given text.
methodsrc.PIL.ImageFont.ImageFont.getmask(text:str | bytes, mode:str='', *args:Any, **kwargs:Any) -> Image.core.ImagingCore
Create a bitmap for the text.
classsrc.PIL.ImageFont.TransposedFont
Wrapper for writing rotated or mirrored text
funcsrc.PIL.ImageFont.load(filename:str) -> ImageFont
Load a font file.
funcsrc.PIL.ImageFont.load_path(filename:str | bytes) -> ImageFont
Load font file.
funcsrc.PIL.ImageMath.lambda_eval(expression:Callable[[dict[str, Any]], Any], **kw:Any) -> Any
Returns the result of an image function.
funcsrc.PIL.ImageMath.unsafe_eval(expression:str, **kw:Any) -> Any
Evaluates an image expression.
classsrc.PIL.ImageMode.ModeDescriptor
Wrapper for mode strings.
funcsrc.PIL.ImageMode.getmode(mode:str) -> ModeDescriptor
Gets a mode descriptor for the given mode.
classsrc.PIL.ImageMorph.MorphOp
A class for binary morphological operators
methodsrc.PIL.ImageMorph.MorphOp.apply(image:Image.Image) -> tuple[int, Image.Image]
Run a single morphological operation on an image.
methodsrc.PIL.ImageMorph.MorphOp.get_on_pixels(image:Image.Image) -> list[tuple[int, int]]
Get a list of all turned on pixels in a 1 or L mode image.
methodsrc.PIL.ImageMorph.MorphOp.match(image:Image.Image) -> list[tuple[int, int]]
Get a list of coordinates matching the morphological operation on an image.
methodsrc.PIL.ImageMorph.MorphOp.save_lut(filename:str) -> None
Save an operator to an mrl file.
methodsrc.PIL.ImageMorph.MorphOp.set_lut(lut:bytearray | None) -> None
Set the LUT from an external source :param lut: A new LUT.
funcsrc.PIL.ImageOps.autocontrast(image:Image.Image, cutoff:float | tuple[float, float]=0, ignore:int | Sequence[int] | None=None, mask:Image.Image | None=None, preserve_tone:bool=False) -> Image.Image
Maximize (normalize) image contrast.
funcsrc.PIL.ImageOps.colorize(image:Image.Image, black:str | tuple[int, ...], white:str | tuple[int, ...], mid:str | int | tuple[int, ...] | None=None, blackpoint:int=0, whitepoint:int=255, midpoint:int=127) -> Image.Image
Colorize grayscale image.
funcsrc.PIL.ImageOps.crop(image:Image.Image, border:int=0) -> Image.Image
Remove border from image.
funcsrc.PIL.ImageOps.deform(image:Image.Image, deformer:SupportsGetMesh, resample:int=Image.Resampling.BILINEAR) -> Image.Image
Deform the image.
funcsrc.PIL.ImageOps.equalize(image:Image.Image, mask:Image.Image | None=None) -> Image.Image
Equalize the image histogram.
funcsrc.PIL.ImageOps.expand(image:Image.Image, border:int | tuple[int, ...]=0, fill:str | int | tuple[int, ...]=0) -> Image.Image
Add border to the image :param image: The image to expand.
funcsrc.PIL.ImageOps.flip(image:Image.Image) -> Image.Image
Flip the image vertically (top to bottom).
funcsrc.PIL.ImageOps.grayscale(image:Image.Image) -> Image.Image
Convert the image to grayscale.
funcsrc.PIL.ImageOps.invert(image:Image.Image) -> Image.Image
Invert (negate) the image.
funcsrc.PIL.ImageOps.mirror(image:Image.Image) -> Image.Image
Flip image horizontally (left to right).
funcsrc.PIL.ImageOps.posterize(image:Image.Image, bits:int) -> Image.Image
Reduce the number of bits for each color channel.
funcsrc.PIL.ImageOps.solarize(image:Image.Image, threshold:int=128) -> Image.Image
Invert all pixel values above a threshold.
classsrc.PIL.ImagePalette.ImagePalette
Color palette for palette mapped images :param mode: The mode to use for the palette.
methodsrc.PIL.ImagePalette.ImagePalette.getcolor(color:tuple[int, ...], image:Image.Image | None=None) -> int
Given an rgb tuple, allocate palette entry.
methodsrc.PIL.ImagePalette.ImagePalette.save(fp:str | IO[str]) -> None
Save palette to text file.
methodsrc.PIL.ImagePalette.ImagePalette.tobytes() -> bytes
Convert palette to bytes.
funcsrc.PIL.ImageQt.align8to32(bytes:bytes, width:int, mode:str) -> bytes
converts each scanline of data from 8 bit to 32 bit aligned
funcsrc.PIL.ImageQt.fromqimage(im:QImage | QPixmap) -> ImageFile.ImageFile
:param im: QImage or PIL ImageQt object
funcsrc.PIL.ImageQt.rgb(r:int, g:int, b:int, a:int=255) -> int
(Internal) Turns an RGB color into a Qt compatible color integer.
classsrc.PIL.ImageShow.DisplayViewer
The ImageMagick ``display`` command.
methodsrc.PIL.ImageShow.DisplayViewer.show_file(path:str, **options:Any) -> int
Display given file.
classsrc.PIL.ImageShow.EogViewer
The GNOME Image Viewer ``eog`` command.
methodsrc.PIL.ImageShow.EogViewer.show_file(path:str, **options:Any) -> int
Display given file.
classsrc.PIL.ImageShow.GmDisplayViewer
The GraphicsMagick ``gm display`` command.
methodsrc.PIL.ImageShow.GmDisplayViewer.show_file(path:str, **options:Any) -> int
Display given file.
classsrc.PIL.ImageShow.IPythonViewer
The viewer for IPython frontends.
classsrc.PIL.ImageShow.MacViewer
The default viewer on macOS using ``Preview.app``.
methodsrc.PIL.ImageShow.MacViewer.show_file(path:str, **options:Any) -> int
Display given file.
classsrc.PIL.ImageShow.Viewer
Base class for viewers.
methodsrc.PIL.ImageShow.Viewer.get_command(file:str, **options:Any) -> str
Returns the command used to display the file.
methodsrc.PIL.ImageShow.Viewer.get_format(image:Image.Image) -> str | None
Return format name, or ``None`` to save as PGM/PPM.
methodsrc.PIL.ImageShow.Viewer.save_image(image:Image.Image) -> str
Save to temporary file and return filename.
methodsrc.PIL.ImageShow.Viewer.show(image:Image.Image, **options:Any) -> int
The main function for displaying an image.
methodsrc.PIL.ImageShow.Viewer.show_file(path:str, **options:Any) -> int
Display given file.
methodsrc.PIL.ImageShow.Viewer.show_image(image:Image.Image, **options:Any) -> int
Display the given image.
classsrc.PIL.ImageShow.XDGViewer
The freedesktop.org ``xdg-open`` command.
methodsrc.PIL.ImageShow.XDGViewer.show_file(path:str, **options:Any) -> int
Display given file.
classsrc.PIL.ImageShow.XVViewer
The X Viewer ``xv`` command.
methodsrc.PIL.ImageShow.XVViewer.show_file(path:str, **options:Any) -> int
Display given file.
funcsrc.PIL.ImageShow.show(image:Image.Image, title:str | None=None, **options:Any) -> bool
Display a given image.
methodsrc.PIL.ImageStat.Stat.count() -> list[int]
Total number of pixels for each band in the image.
methodsrc.PIL.ImageStat.Stat.extrema() -> list[tuple[int, int]]
Min/max values for each band in the image.
methodsrc.PIL.ImageStat.Stat.median() -> list[int]
Median pixel level for each band in the image.
methodsrc.PIL.ImageStat.Stat.rms() -> list[float]
RMS (root-mean-square) for each band in the image.
methodsrc.PIL.ImageStat.Stat.stddev() -> list[float]
Standard deviation for each band in the image.
methodsrc.PIL.ImageStat.Stat.sum() -> list[float]
Sum of all pixels for each band in the image.
methodsrc.PIL.ImageStat.Stat.sum2() -> list[float]
Squared sum of all pixels for each band in the image.
methodsrc.PIL.ImageStat.Stat.var() -> list[float]
Variance for each band in the image.
methodsrc.PIL.ImageText.Text.embed_color() -> None
Use embedded color glyphs (COLR, CBDT, SBIX).
methodsrc.PIL.ImageText.Text.get_bbox(xy:tuple[float, float]=(0, 0), anchor:str | None=None, align:str='left') -> tuple[float, float, float, float]
Returns bounding box (in pixels) of text.
methodsrc.PIL.ImageText.Text.get_length() -> float
Returns length (in pixels with 1/64 precision) of text.
methodsrc.PIL.ImageText.Text.stroke(width:float=0, fill:_Ink | None=None) -> None
:param width: The width of the text stroke.
methodsrc.PIL.ImageText.Text.wrap(width:int, height:int | None=None, scaling:str | tuple[str, int] | None=None) -> Text[AnyStr] | None
Wrap text to fit within a given width.
classsrc.PIL.ImageTk.BitmapImage
A Tkinter-compatible bitmap image.
methodsrc.PIL.ImageTk.BitmapImage.height() -> int
Get the height of the image.
methodsrc.PIL.ImageTk.BitmapImage.width() -> int
Get the width of the image.
classsrc.PIL.ImageTk.PhotoImage
A Tkinter-compatible photo image.
methodsrc.PIL.ImageTk.PhotoImage.height() -> int
Get the height of the image.
methodsrc.PIL.ImageTk.PhotoImage.paste(im:Image.Image) -> None
Paste a PIL image into the photo image.
methodsrc.PIL.ImageTk.PhotoImage.width() -> int
Get the width of the image.
funcsrc.PIL.ImageTk.getimage(photo:PhotoImage) -> Image.Image
Copies the contents of a PhotoImage to a PIL image memory.
classsrc.PIL.ImageTransform.AffineTransform
Define an affine image transform.
classsrc.PIL.ImageTransform.ExtentTransform
Define a transform to extract a subregion from an image.
classsrc.PIL.ImageTransform.MeshTransform
Define a mesh image transform.
classsrc.PIL.ImageTransform.PerspectiveTransform
Define a perspective image transform.
classsrc.PIL.ImageTransform.QuadTransform
Define a quad image transform.
methodsrc.PIL.ImageTransform.Transform.transform(size:tuple[int, int], image:Image.Image, **options:Any) -> Image.Image
Perform the transform.
classsrc.PIL.ImageWin.Dib
A Windows bitmap with the given mode and size.
methodsrc.PIL.ImageWin.Dib.expose(handle:int | HDC | HWND) -> None
Copy the bitmap contents to a device context.
methodsrc.PIL.ImageWin.Dib.frombytes(buffer:bytes | memoryview) -> None
Load display memory contents from byte data.
methodsrc.PIL.ImageWin.Dib.paste(im:Image.Image, box:tuple[int, int, int, int] | None=None) -> None
Paste a PIL image into the bitmap image.
methodsrc.PIL.ImageWin.Dib.tobytes() -> bytes
Copy display memory contents to bytes object.
classsrc.PIL.ImageWin.HDC
Wraps an HDC integer.
classsrc.PIL.ImageWin.HWND
Wraps an HWND integer.
classsrc.PIL.ImageWin.ImageWindow
Create an image window which displays the given image.
classsrc.PIL.ImageWin.Window
Create a Window with the given title size.
funcsrc.PIL.IptcImagePlugin.getiptcinfo(im:ImageFile.ImageFile) -> dict[tuple[int, int], bytes | list[bytes]] | None
Get IPTC information from TIFF, JPEG, or IPTC file.
classsrc.PIL.PSDraw.PSDraw
Sets up printing to the given file.
methodsrc.PIL.PSDraw.PSDraw.begin_document(id:str | None=None) -> None
Set up printing of a document.
methodsrc.PIL.PSDraw.PSDraw.end_document() -> None
Ends printing.
methodsrc.PIL.PSDraw.PSDraw.image(box:tuple[int, int, int, int], im:Image.Image, dpi:int | None=None) -> None
Draw a PIL image, centered in the given box.
methodsrc.PIL.PSDraw.PSDraw.line(xy0:tuple[int, int], xy1:tuple[int, int]) -> None
Draws a line between the two points.
methodsrc.PIL.PSDraw.PSDraw.rectangle(box:tuple[int, int, int, int]) -> None
Draws a rectangle.
methodsrc.PIL.PSDraw.PSDraw.setfont(font:str, size:int) -> None
Selects which font to use.
methodsrc.PIL.PSDraw.PSDraw.text(xy:tuple[int, int], text:str) -> None
Draws text at the given position.
classsrc.PIL.PaletteFile.PaletteFile
File handler for Teragon-style palette files.
classsrc.PIL.PcfFontFile.PcfFontFile
Font file plugin for the X11 PCF format.
classsrc.PIL.PngImagePlugin.PngInfo
PNG chunk container (for use with save(pnginfo=))
methodsrc.PIL.PngImagePlugin.PngInfo.add(cid:bytes, data:bytes, after_idat:bool=False) -> None
Appends an arbitrary chunk.
methodsrc.PIL.PngImagePlugin.PngInfo.add_itxt(key:str | bytes, value:str | bytes, lang:str | bytes='', tkey:str | bytes='', zip:bool=False) -> None
Appends an iTXt chunk.
methodsrc.PIL.PngImagePlugin.PngInfo.add_text(key:str | bytes, value:str | bytes | iTXt, zip:bool=False) -> None
Appends a text chunk.
funcsrc.PIL.PngImagePlugin.getchunks(im:Image.Image, **params:Any) -> list[tuple[bytes, bytes, bytes]]
Return a list of PNG chunks representing this image.
funcsrc.PIL.PngImagePlugin.putchunk(fp:IO[bytes], cid:bytes, *data:bytes) -> None
Write a PNG chunk (including CRC field)
classsrc.PIL.TiffImagePlugin.ImageFileDirectory_v2
This class represents a TIFF tag directory.
funcsrc.PIL.WalImageFile.open(filename:StrOrBytesPath | IO[bytes]) -> WalImageFile
Load texture from a Quake2 WAL texture file.
funcsrc.PIL.WmfImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> None
Install application-specific WMF image handler.
funcsrc.PIL._binary.i16le(c:bytes, o:int=0) -> int
Converts a 2-bytes (16 bits) string to an unsigned integer.
funcsrc.PIL._binary.i32le(c:bytes, o:int=0) -> int
Converts a 4-bytes (32 bits) string to an unsigned integer.
funcsrc.PIL._binary.si16be(c:bytes, o:int=0) -> int
Converts a 2-bytes (16 bits) string to a signed integer, big endian.
funcsrc.PIL._binary.si16le(c:bytes, o:int=0) -> int
Converts a 2-bytes (16 bits) string to a signed integer.
funcsrc.PIL._binary.si32be(c:bytes, o:int=0) -> int
Converts a 4-bytes (32 bits) string to a signed integer, big endian.
funcsrc.PIL._binary.si32le(c:bytes, o:int=0) -> int
Converts a 4-bytes (32 bits) string to a signed integer.
funcsrc.PIL._deprecate.deprecate(deprecated:str, when:int | None, replacement:str | None=None, *action:str | None=None, *plural:bool=False, *stacklevel:int=3) -> None
Deprecations helper.
funcsrc.PIL.features.check(feature:str) -> bool | None
:param feature: A module, codec, or feature name.
funcsrc.PIL.features.check_codec(feature:str) -> bool
Checks if a codec is available.
funcsrc.PIL.features.check_feature(feature:str) -> bool | None
Checks if a feature is available.
funcsrc.PIL.features.check_module(feature:str) -> bool
Checks if a module is available.
funcsrc.PIL.features.get_supported_codecs() -> list[str]
:returns: A list of all supported codecs.
funcsrc.PIL.features.get_supported_features() -> list[str]
:returns: A list of all supported features.
funcsrc.PIL.features.get_supported_modules() -> list[str]
:returns: A list of all supported modules.
funcsrc.PIL.features.pilinfo(out:IO[str] | None=None, supported_formats:bool=True) -> None
Prints information about this installation of Pillow.
funcsrc.PIL.features.version(feature:str) -> str | None
:param feature: The module, codec, or feature to check for.
funcsrc.PIL.features.version_codec(feature:str) -> str | None
:param feature: The codec to check for.
funcsrc.PIL.features.version_feature(feature:str) -> str | None
:param feature: The feature to check for.
funcsrc.PIL.features.version_module(feature:str) -> str | None
:param feature: The module to check for.

この情報について

掲載しているシグネチャは python-pillow/Pillow の公開ソースコードを Python の ast モジュールで静的解析し、引数名・デフォルト値・ 型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。 詳しくは仕組みの解説をご覧ください。

収録ライブラリ一覧(全 805 件)へ戻る