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) -> strStrip the `pillow-{version}-` prefix for compact table display.
func
.github.compare-dist-sizes.key_for(filename:str) -> strReturn a version-independent identifier for a dist file.
func
.github.compare-dist-sizes.pct_severity(text:str) -> dict[str, str] | NoneReturn status indicators based on the change percent.
func
.github.embed-sbom.record_entry(path:str, data:bytes) -> bytesBuild a RECORD line: `path,sha256=<base64url-nopad>,<size>`.
func
.github.embed-sbom.scan_dir(path:Path) -> PathIf `path` is a directory, return the path of the SBOM within.
class
src.PIL.BdfFontFile.BdfFontFileFont file plugin for the X11 BDF format.
class
src.PIL.BlpImagePlugin.BlpImageFileBlizzard Mipmap Format
func
src.PIL.BlpImagePlugin.decode_dxt1(data:bytes, alpha:bool=False) -> tuple[bytearray, bytearray, bytearray, bytearray]input: one "row" of data (i.e.
func
src.PIL.BlpImagePlugin.decode_dxt3(data:bytes) -> tuple[bytearray, bytearray, bytearray, bytearray]input: one "row" of data (i.e.
func
src.PIL.BlpImagePlugin.decode_dxt5(data:bytes) -> tuple[bytearray, bytearray, bytearray, bytearray]input: one "row" of data (i.e.
class
src.PIL.BmpImagePlugin.BmpImageFileImage plugin for the Windows Bitmap format (BMP)
func
src.PIL.BufrStubImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> NoneInstall application-specific BUFR image handler.
class
src.PIL.EpsImagePlugin.EpsImageFileEPS File Parser for the Python Imaging Library
func
src.PIL.EpsImagePlugin.Ghostscript(tile:list[ImageFile._Tile], size:tuple[int, int], fp:IO[bytes], scale:int=1, transparency:bool=False) -> Image.core.ImagingCoreRender an image using Ghostscript
class
src.PIL.FontFile.FontFileBase class for raster font file handlers.
method
src.PIL.FontFile.FontFile.compile() -> NoneCreate metrics and bitmap
method
src.PIL.FontFile.FontFile.save(filename:str) -> NoneSave font
method
src.PIL.FontFile.FontFile.to_imagefont() -> ImageFont.ImageFontConvert to ImageFont
func
src.PIL.FontFile.puti16(fp:BinaryIO, values:tuple[int, int, int, int, int, int, int, int, int, int]) -> NoneWrite network order (big-endian) 16-bit sequence
class
src.PIL.GdImageFile.GdImageFileImage plugin for the GD uncompressed format.
func
src.PIL.GdImageFile.open(fp:StrOrBytesPath | IO[bytes], mode:str='r') -> GdImageFileLoad texture from a GD image file.
class
src.PIL.GifImagePlugin.LoadingStrategy..
func
src.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.
class
src.PIL.GimpGradientFile.GimpGradientFileFile handler for GIMP's gradient format.
class
src.PIL.GimpPaletteFile.GimpPaletteFileFile handler for GIMP's palette format.
func
src.PIL.GribStubImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> NoneInstall application-specific GRIB image handler.
func
src.PIL.Hdf5StubImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> NoneInstall application-specific HDF5 image handler.
class
src.PIL.IcnsImagePlugin.IcnsImageFilePIL image support for Mac OS .icns files.
func
src.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.
class
src.PIL.Image.ImageThis class represents an image object.
method
src.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.
method
src.PIL.Image.Image.convert(mode:str | None=None, matrix:tuple[float, ...] | None=None, dither:Dither | None=None, palette:Palette=Palette.WEB, colors:int=256) -> ImageReturns a converted copy of this image.
method
src.PIL.Image.Image.copy() -> ImageCopies this image.
method
src.PIL.Image.Image.crop(box:tuple[float, float, float, float] | None=None) -> ImageReturns a rectangular region from this image.
method
src.PIL.Image.Image.effect_spread(distance:int) -> ImageRandomly spread pixels in an image.
method
src.PIL.Image.Image.entropy(mask:Image | None=None, extrema:tuple[float, float] | None=None) -> floatCalculates and returns the entropy for the image.
method
src.PIL.Image.Image.filter(filter:ImageFilter.Filter | type[ImageFilter.Filter]) -> ImageFilters this image using the given filter.
method
src.PIL.Image.Image.frombytes(data:DecoderInput, decoder_name:str='raw', *args:Any) -> NoneLoads this image with pixel data from a bytes object.
method
src.PIL.Image.Image.getchannel(channel:int | str) -> ImageReturns an image containing a single channel of the source image.
method
src.PIL.Image.Image.getcolors(maxcolors:int=256) -> list[tuple[int, tuple[int, ...]]] | list[tuple[int, float]] | NoneReturns a list of colors used in this image.
method
src.PIL.Image.Image.getexif() -> ExifGets EXIF data from the image.
method
src.PIL.Image.Image.getim() -> CapsuleTypeReturns a capsule that points to the internal image memory.
method
src.PIL.Image.Image.getpalette(rawmode:str | None='RGB') -> list[int] | NoneReturns the image palette as a list.
method
src.PIL.Image.Image.getpixel(xy:tuple[int, int] | list[int]) -> float | tuple[int, ...] | NoneReturns the pixel value at a given position.
method
src.PIL.Image.Image.getxmp() -> dict[str, Any]Returns a dictionary containing the XMP tags.
method
src.PIL.Image.Image.histogram(mask:Image | None=None, extrema:tuple[float, float] | None=None) -> list[int]Returns a histogram for the image.
method
src.PIL.Image.Image.load() -> core.PixelAccess | NoneAllocates storage for the image and loads the pixel data.
method
src.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) -> NonePastes another image into this image.
method
src.PIL.Image.Image.putalpha(alpha:Image | int) -> NoneAdds or replaces the alpha layer in this image.
method
src.PIL.Image.Image.putpalette(data:ImagePalette.ImagePalette | bytes | Sequence[int], rawmode:str='RGB') -> NoneAttaches a palette to this image.
method
src.PIL.Image.Image.putpixel(xy:tuple[int, int] | list[int], value:float | tuple[int, ...] | list[int]) -> NoneModifies the pixel at the given position.
method
src.PIL.Image.Image.reduce(factor:int | tuple[int, int], box:tuple[int, int, int, int] | None=None) -> ImageReturns a copy of the image reduced ``factor`` times.
method
src.PIL.Image.Image.remap_palette(dest_map:list[int], source_palette:bytes | bytearray | None=None) -> ImageRewrites the image to reorder the palette.
method
src.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) -> ImageReturns a resized copy of this image.
method
src.PIL.Image.Image.save(fp:StrOrBytesPath | IO[bytes], format:str | None=None, **params:Any) -> NoneSaves this image under the given filename.
method
src.PIL.Image.Image.seek(frame:int) -> NoneSeeks to the given frame in this sequence file.
method
src.PIL.Image.Image.show(title:str | None=None) -> NoneDisplays this image.
method
src.PIL.Image.Image.split() -> tuple[Image, ...]Split this image into individual bands.
method
src.PIL.Image.Image.tell() -> intReturns the current frame number.
method
src.PIL.Image.Image.thumbnail(size:tuple[float, float], resample:Resampling=Resampling.BICUBIC, reducing_gap:float | None=2.0) -> NoneMake this image into a thumbnail.
method
src.PIL.Image.Image.tobitmap(name:str='image') -> bytesReturns the image converted to an X11 bitmap.
method
src.PIL.Image.Image.tobytes(encoder_name:str='raw', *args:Any) -> bytesReturn image as a bytes object.
method
src.PIL.Image.Image.toqimage() -> ImageQt.ImageQtReturns a QImage copy of this image
method
src.PIL.Image.Image.toqpixmap() -> ImageQt.QPixmapReturns a QPixmap copy of this image
method
src.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) -> ImageTransforms this image.
method
src.PIL.Image.Image.verify() -> NoneVerifies the contents of a file.
class
src.PIL.Image.SupportsArrayInterfaceAn object that has an ``__array_interface__`` dictionary.
func
src.PIL.Image.alpha_composite(im1:Image, im2:Image) -> ImageAlpha composite im2 over im1.
func
src.PIL.Image.composite(image1:Image, image2:Image, mask:Image) -> ImageCreate composite image by blending images using a transparency mask.
func
src.PIL.Image.effect_mandelbrot(size:tuple[int, int], extent:tuple[float, float, float, float], quality:int) -> ImageGenerate a Mandelbrot set covering the given extent.
func
src.PIL.Image.effect_noise(size:tuple[int, int], sigma:float) -> ImageGenerate Gaussian noise centered around 128.
func
src.PIL.Image.fromqimage(im:ImageQt.QImage) -> ImageFile.ImageFileCreates an image instance from a QImage image
func
src.PIL.Image.fromqpixmap(im:ImageQt.QPixmap) -> ImageFile.ImageFileCreates an image instance from a QPixmap image
func
src.PIL.Image.getmodebandnames(mode:str) -> tuple[str, ...]Gets a list of individual band names.
func
src.PIL.Image.getmodebands(mode:str) -> intGets the number of individual bands for this mode.
func
src.PIL.Image.getmodebase(mode:str) -> strGets the "base" mode for given mode.
func
src.PIL.Image.getmodetype(mode:str) -> strGets the storage type mode.
func
src.PIL.Image.init() -> boolExplicitly initializes the Python Imaging Library.
func
src.PIL.Image.linear_gradient(mode:str) -> ImageGenerate 256x256 linear gradient from black to white, top to bottom.
func
src.PIL.Image.merge(mode:str, bands:Sequence[Image]) -> ImageMerge a set of single band images into a new multiband image.
func
src.PIL.Image.new(mode:str, size:tuple[int, int] | list[int], color:float | tuple[float, ...] | str | None=0) -> ImageCreates a new image with the given mode and size.
func
src.PIL.Image.open(fp:StrOrBytesPath | IO[bytes], mode:Literal['r']='r', formats:list[str] | tuple[str, ...] | None=None) -> ImageFile.ImageFileOpens and identifies the given image file.
func
src.PIL.Image.preinit() -> NoneExplicitly loads BMP, GIF, JPEG, PPM and PNG file format drivers.
func
src.PIL.Image.radial_gradient(mode:str) -> ImageGenerate 256x256 radial gradient from black to white, centre to edge.
func
src.PIL.Image.register_decoder(name:str, decoder:type[ImageFile.PyDecoder]) -> NoneRegisters an image decoder.
func
src.PIL.Image.register_encoder(name:str, encoder:type[ImageFile.PyEncoder]) -> NoneRegisters an image encoder.
func
src.PIL.Image.register_extension(id:str, extension:str) -> NoneRegisters an image extension.
func
src.PIL.Image.register_extensions(id:str, extensions:list[str]) -> NoneRegisters image extensions.
func
src.PIL.Image.register_mime(id:str, mimetype:str) -> NoneRegisters an image MIME type by populating ``Image.MIME``.
func
src.PIL.Image.register_open(id:str, factory:Callable[[IO[bytes], str | bytes], ImageFile.ImageFile] | type[ImageFile.ImageFile], accept:Callable[[bytes], bool | str] | None=None) -> NoneRegister an image file plugin.
func
src.PIL.Image.register_save(id:str, driver:Callable[[Image, IO[bytes], str | bytes], None]) -> NoneRegisters an image save function.
func
src.PIL.ImageChops.add_modulo(image1:Image.Image, image2:Image.Image) -> Image.ImageAdd two images, without clipping the result.
func
src.PIL.ImageChops.blend(image1:Image.Image, image2:Image.Image, alpha:float) -> Image.ImageBlend images using constant transparency weight.
func
src.PIL.ImageChops.composite(image1:Image.Image, image2:Image.Image, mask:Image.Image) -> Image.ImageCreate composite using transparency mask.
func
src.PIL.ImageChops.constant(image:Image.Image, value:int) -> Image.ImageFill a channel with a given gray level.
func
src.PIL.ImageChops.duplicate(image:Image.Image) -> Image.ImageCopy a channel.
func
src.PIL.ImageChops.invert(image:Image.Image) -> Image.ImageInvert an image (channel).
func
src.PIL.ImageChops.logical_and(image1:Image.Image, image2:Image.Image) -> Image.ImageLogical AND between two images.
func
src.PIL.ImageChops.logical_or(image1:Image.Image, image2:Image.Image) -> Image.ImageLogical OR between two images.
func
src.PIL.ImageChops.logical_xor(image1:Image.Image, image2:Image.Image) -> Image.ImageLogical XOR between two images.
func
src.PIL.ImageChops.multiply(image1:Image.Image, image2:Image.Image) -> Image.ImageSuperimposes two images on top of each other.
func
src.PIL.ImageChops.screen(image1:Image.Image, image2:Image.Image) -> Image.ImageSuperimposes two inverted images on top of each other.
func
src.PIL.ImageChops.subtract_modulo(image1:Image.Image, image2:Image.Image) -> Image.ImageSubtract two images, without clipping the result.
class
src.PIL.ImageCms.FlagsFlags and documentation are taken from ``lcms2.h``.
class
src.PIL.ImageCms.ImageCmsTransformTransform.
class
src.PIL.ImageCms.PyCMSError(pyCMS) Exception class.
func
src.PIL.ImageCms.applyTransform(im:Image.Image, transform:ImageCmsTransform, inPlace:bool=False) -> Image.Image | None(pyCMS) Applies a transform to a given image.
func
src.PIL.ImageCms.createProfile(colorSpace:Literal['LAB', 'XYZ', 'sRGB'], colorTemp:SupportsFloat=0) -> core.CmsProfile(pyCMS) Creates a profile.
func
src.PIL.ImageCms.getDefaultIntent(profile:_CmsProfileCompatible) -> int(pyCMS) Gets the default intent name for the given profile.
func
src.PIL.ImageCms.getOpenProfile(profileFilename:str | SupportsRead[bytes] | core.CmsProfile) -> ImageCmsProfile(pyCMS) Opens an ICC profile file.
func
src.PIL.ImageCms.getProfileCopyright(profile:_CmsProfileCompatible) -> str(pyCMS) Gets the copyright for the given profile.
func
src.PIL.ImageCms.getProfileDescription(profile:_CmsProfileCompatible) -> str(pyCMS) Gets the description for the given profile.
func
src.PIL.ImageCms.getProfileManufacturer(profile:_CmsProfileCompatible) -> str(pyCMS) Gets the manufacturer for the given profile.
func
src.PIL.ImageCms.getProfileModel(profile:_CmsProfileCompatible) -> str(pyCMS) Gets the model for the given profile.
func
src.PIL.ImageCms.getProfileName(profile:_CmsProfileCompatible) -> str(pyCMS) Gets the internal product name for the given profile.
func
src.PIL.ImageCms.isIntentSupported(profile:_CmsProfileCompatible, intent:Intent, direction:Direction) -> Literal[-1, 1](pyCMS) Checks if a given intent is supported.
func
src.PIL.ImageColor.getcolor(color:str, mode:str) -> int | tuple[int, ...]Same as :py:func:`~PIL.ImageColor.getrgb` for most modes.
func
src.PIL.ImageColor.getrgb(color:str) -> tuple[int, int, int] | tuple[int, int, int, int]Convert a color string to an RGB or RGBA tuple.
func
src.PIL.ImageDraw.Draw(im:Image.Image, mode:str | None=None) -> ImageDrawA simple 2D drawing interface for PIL images.
func
src.PIL.ImageDraw.floodfill(image:Image.Image, xy:tuple[int, int], value:float | tuple[int, ...], border:float | tuple[int, ...] | None=None, thresh:float=0) -> None..
func
src.PIL.ImageDraw.getdraw(im:Image.Image | None=None) -> tuple[ImageDraw2.Draw | None, ModuleType]:param im: The image to draw in.
class
src.PIL.ImageDraw2.BrushStores a fill color
class
src.PIL.ImageDraw2.Draw(Experimental) WCK-style drawing interface
method
src.PIL.ImageDraw2.Draw.ellipse(xy:Coords, pen:Pen | Brush | None, *options:Any) -> NoneDraws an ellipse inside the given bounding box.
method
src.PIL.ImageDraw2.Draw.line(xy:Coords, pen:Pen | Brush | None, *options:Any) -> NoneDraws a line between the coordinates in the ``xy`` list.
method
src.PIL.ImageDraw2.Draw.polygon(xy:Coords, pen:Pen | Brush | None, *options:Any) -> NoneDraws a polygon.
method
src.PIL.ImageDraw2.Draw.rectangle(xy:Coords, pen:Pen | Brush | None, *options:Any) -> NoneDraws a rectangle.
method
src.PIL.ImageDraw2.Draw.settransform(offset:tuple[float, float]) -> NoneSets a transformation offset.
method
src.PIL.ImageDraw2.Draw.text(xy:tuple[float, float], text:AnyStr, font:Font) -> NoneDraws the string at the given position.
method
src.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.
method
src.PIL.ImageDraw2.Draw.textlength(text:AnyStr, font:Font) -> floatReturns length (in pixels) of given text.
class
src.PIL.ImageDraw2.FontStores a TrueType font and color
class
src.PIL.ImageDraw2.PenStores an outline color and width.
class
src.PIL.ImageEnhance.BrightnessAdjust image brightness.
class
src.PIL.ImageEnhance.ColorAdjust image color balance.
class
src.PIL.ImageEnhance.ContrastAdjust image contrast.
class
src.PIL.ImageEnhance.SharpnessAdjust image sharpness.
class
src.PIL.ImageFile.ImageFileBase class for image file format handlers.
method
src.PIL.ImageFile.ImageFile.close() -> NoneCloses the file pointer, if possible.
method
src.PIL.ImageFile.ImageFile.load() -> Image.core.PixelAccess | NoneLoad image data based on tile list
method
src.PIL.ImageFile.ImageFile.verify() -> NoneCheck file integrity
class
src.PIL.ImageFile.ParserIncremental image parser.
method
src.PIL.ImageFile.Parser.close() -> Image.Image(Consumer) Close the stream.
method
src.PIL.ImageFile.Parser.feed(data:bytes) -> None(Consumer) Feed data to the parser.
method
src.PIL.ImageFile.Parser.reset() -> None(Consumer) Reset the parser.
class
src.PIL.ImageFile.PyDecoderPython implementation of a format decoder.
method
src.PIL.ImageFile.PyDecoder.decode(buffer:Image.DecoderInput) -> tuple[int, int]Override to perform the decoding process.
class
src.PIL.ImageFile.PyEncoderPython implementation of a format encoder.
method
src.PIL.ImageFile.PyEncoder.encode(bufsize:int) -> tuple[int, int, bytes]Override to perform the encoding process.
method
src.PIL.ImageFile.PyEncoder.encode_to_file(fh:int, bufsize:int) -> int:param fh: File handle.
class
src.PIL.ImageFile.StubImageFileBase class for stub image loaders.
class
src.PIL.ImageFilter.Color3DLUTThree-dimensional color lookup table.
class
src.PIL.ImageFilter.KernelCreate a convolution kernel.
class
src.PIL.ImageFilter.MaxFilterCreate a max filter.
class
src.PIL.ImageFilter.MedianFilterCreate a median filter.
class
src.PIL.ImageFilter.MinFilterCreate a min filter.
class
src.PIL.ImageFilter.ModeFilterCreate a mode filter.
class
src.PIL.ImageFilter.RankFilterCreate a rank filter.
class
src.PIL.ImageFilter.UnsharpMaskUnsharp mask filter.
class
src.PIL.ImageFont.BaseImageFontUsed by ImageDraw and ImageText
class
src.PIL.ImageFont.FreeTypeFontFreeType font wrapper (requires _imagingft service)
method
src.PIL.ImageFont.FreeTypeFont.get_variation_axes() -> list[Axis]:returns: A list of the axes in a variation font.
method
src.PIL.ImageFont.FreeTypeFont.getname() -> tuple[str | None, str | None]:return: A tuple of the font family (e.g.
method
src.PIL.ImageFont.FreeTypeFont.set_variation_by_axes(axes:list[float]) -> None:param axes: A list of values for each axis.
method
src.PIL.ImageFont.FreeTypeFont.set_variation_by_name(name:str | bytes) -> None:param name: The name of the style.
class
src.PIL.ImageFont.ImageFontPIL font wrapper
method
src.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.
method
src.PIL.ImageFont.ImageFont.getlength(text:str | bytes | bytearray, *args:Any, **kwargs:Any) -> intReturns length (in pixels) of given text.
method
src.PIL.ImageFont.ImageFont.getmask(text:str | bytes, mode:str='', *args:Any, **kwargs:Any) -> Image.core.ImagingCoreCreate a bitmap for the text.
class
src.PIL.ImageFont.TransposedFontWrapper for writing rotated or mirrored text
func
src.PIL.ImageFont.load(filename:str) -> ImageFontLoad a font file.
func
src.PIL.ImageFont.load_path(filename:str | bytes) -> ImageFontLoad font file.
func
src.PIL.ImageMath.lambda_eval(expression:Callable[[dict[str, Any]], Any], **kw:Any) -> AnyReturns the result of an image function.
func
src.PIL.ImageMath.unsafe_eval(expression:str, **kw:Any) -> AnyEvaluates an image expression.
class
src.PIL.ImageMode.ModeDescriptorWrapper for mode strings.
func
src.PIL.ImageMode.getmode(mode:str) -> ModeDescriptorGets a mode descriptor for the given mode.
class
src.PIL.ImageMorph.MorphOpA class for binary morphological operators
method
src.PIL.ImageMorph.MorphOp.apply(image:Image.Image) -> tuple[int, Image.Image]Run a single morphological operation on an image.
method
src.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.
method
src.PIL.ImageMorph.MorphOp.match(image:Image.Image) -> list[tuple[int, int]]Get a list of coordinates matching the morphological operation on an image.
method
src.PIL.ImageMorph.MorphOp.save_lut(filename:str) -> NoneSave an operator to an mrl file.
method
src.PIL.ImageMorph.MorphOp.set_lut(lut:bytearray | None) -> NoneSet the LUT from an external source :param lut: A new LUT.
func
src.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.ImageMaximize (normalize) image contrast.
func
src.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.ImageColorize grayscale image.
func
src.PIL.ImageOps.crop(image:Image.Image, border:int=0) -> Image.ImageRemove border from image.
func
src.PIL.ImageOps.deform(image:Image.Image, deformer:SupportsGetMesh, resample:int=Image.Resampling.BILINEAR) -> Image.ImageDeform the image.
func
src.PIL.ImageOps.equalize(image:Image.Image, mask:Image.Image | None=None) -> Image.ImageEqualize the image histogram.
func
src.PIL.ImageOps.expand(image:Image.Image, border:int | tuple[int, ...]=0, fill:str | int | tuple[int, ...]=0) -> Image.ImageAdd border to the image :param image: The image to expand.
func
src.PIL.ImageOps.flip(image:Image.Image) -> Image.ImageFlip the image vertically (top to bottom).
func
src.PIL.ImageOps.grayscale(image:Image.Image) -> Image.ImageConvert the image to grayscale.
func
src.PIL.ImageOps.invert(image:Image.Image) -> Image.ImageInvert (negate) the image.
func
src.PIL.ImageOps.mirror(image:Image.Image) -> Image.ImageFlip image horizontally (left to right).
func
src.PIL.ImageOps.posterize(image:Image.Image, bits:int) -> Image.ImageReduce the number of bits for each color channel.
func
src.PIL.ImageOps.solarize(image:Image.Image, threshold:int=128) -> Image.ImageInvert all pixel values above a threshold.
class
src.PIL.ImagePalette.ImagePaletteColor palette for palette mapped images :param mode: The mode to use for the palette.
method
src.PIL.ImagePalette.ImagePalette.getcolor(color:tuple[int, ...], image:Image.Image | None=None) -> intGiven an rgb tuple, allocate palette entry.
method
src.PIL.ImagePalette.ImagePalette.save(fp:str | IO[str]) -> NoneSave palette to text file.
method
src.PIL.ImagePalette.ImagePalette.tobytes() -> bytesConvert palette to bytes.
func
src.PIL.ImageQt.align8to32(bytes:bytes, width:int, mode:str) -> bytesconverts each scanline of data from 8 bit to 32 bit aligned
func
src.PIL.ImageQt.fromqimage(im:QImage | QPixmap) -> ImageFile.ImageFile:param im: QImage or PIL ImageQt object
func
src.PIL.ImageQt.rgb(r:int, g:int, b:int, a:int=255) -> int(Internal) Turns an RGB color into a Qt compatible color integer.
class
src.PIL.ImageShow.DisplayViewerThe ImageMagick ``display`` command.
method
src.PIL.ImageShow.DisplayViewer.show_file(path:str, **options:Any) -> intDisplay given file.
class
src.PIL.ImageShow.EogViewerThe GNOME Image Viewer ``eog`` command.
method
src.PIL.ImageShow.EogViewer.show_file(path:str, **options:Any) -> intDisplay given file.
class
src.PIL.ImageShow.GmDisplayViewerThe GraphicsMagick ``gm display`` command.
method
src.PIL.ImageShow.GmDisplayViewer.show_file(path:str, **options:Any) -> intDisplay given file.
class
src.PIL.ImageShow.IPythonViewerThe viewer for IPython frontends.
class
src.PIL.ImageShow.MacViewerThe default viewer on macOS using ``Preview.app``.
method
src.PIL.ImageShow.MacViewer.show_file(path:str, **options:Any) -> intDisplay given file.
class
src.PIL.ImageShow.ViewerBase class for viewers.
method
src.PIL.ImageShow.Viewer.get_command(file:str, **options:Any) -> strReturns the command used to display the file.
method
src.PIL.ImageShow.Viewer.get_format(image:Image.Image) -> str | NoneReturn format name, or ``None`` to save as PGM/PPM.
method
src.PIL.ImageShow.Viewer.save_image(image:Image.Image) -> strSave to temporary file and return filename.
method
src.PIL.ImageShow.Viewer.show(image:Image.Image, **options:Any) -> intThe main function for displaying an image.
method
src.PIL.ImageShow.Viewer.show_file(path:str, **options:Any) -> intDisplay given file.
method
src.PIL.ImageShow.Viewer.show_image(image:Image.Image, **options:Any) -> intDisplay the given image.
class
src.PIL.ImageShow.XDGViewerThe freedesktop.org ``xdg-open`` command.
method
src.PIL.ImageShow.XDGViewer.show_file(path:str, **options:Any) -> intDisplay given file.
class
src.PIL.ImageShow.XVViewerThe X Viewer ``xv`` command.
method
src.PIL.ImageShow.XVViewer.show_file(path:str, **options:Any) -> intDisplay given file.
func
src.PIL.ImageShow.show(image:Image.Image, title:str | None=None, **options:Any) -> boolDisplay a given image.
method
src.PIL.ImageStat.Stat.count() -> list[int]Total number of pixels for each band in the image.
method
src.PIL.ImageStat.Stat.extrema() -> list[tuple[int, int]]Min/max values for each band in the image.
method
src.PIL.ImageStat.Stat.median() -> list[int]Median pixel level for each band in the image.
method
src.PIL.ImageStat.Stat.rms() -> list[float]RMS (root-mean-square) for each band in the image.
method
src.PIL.ImageStat.Stat.stddev() -> list[float]Standard deviation for each band in the image.
method
src.PIL.ImageStat.Stat.sum() -> list[float]Sum of all pixels for each band in the image.
method
src.PIL.ImageStat.Stat.sum2() -> list[float]Squared sum of all pixels for each band in the image.
method
src.PIL.ImageStat.Stat.var() -> list[float]Variance for each band in the image.
method
src.PIL.ImageText.Text.embed_color() -> NoneUse embedded color glyphs (COLR, CBDT, SBIX).
method
src.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.
method
src.PIL.ImageText.Text.get_length() -> floatReturns length (in pixels with 1/64 precision) of text.
method
src.PIL.ImageText.Text.stroke(width:float=0, fill:_Ink | None=None) -> None:param width: The width of the text stroke.
method
src.PIL.ImageText.Text.wrap(width:int, height:int | None=None, scaling:str | tuple[str, int] | None=None) -> Text[AnyStr] | NoneWrap text to fit within a given width.
class
src.PIL.ImageTk.BitmapImageA Tkinter-compatible bitmap image.
method
src.PIL.ImageTk.BitmapImage.height() -> intGet the height of the image.
method
src.PIL.ImageTk.BitmapImage.width() -> intGet the width of the image.
class
src.PIL.ImageTk.PhotoImageA Tkinter-compatible photo image.
method
src.PIL.ImageTk.PhotoImage.height() -> intGet the height of the image.
method
src.PIL.ImageTk.PhotoImage.paste(im:Image.Image) -> NonePaste a PIL image into the photo image.
method
src.PIL.ImageTk.PhotoImage.width() -> intGet the width of the image.
func
src.PIL.ImageTk.getimage(photo:PhotoImage) -> Image.ImageCopies the contents of a PhotoImage to a PIL image memory.
class
src.PIL.ImageTransform.AffineTransformDefine an affine image transform.
class
src.PIL.ImageTransform.ExtentTransformDefine a transform to extract a subregion from an image.
class
src.PIL.ImageTransform.MeshTransformDefine a mesh image transform.
class
src.PIL.ImageTransform.PerspectiveTransformDefine a perspective image transform.
class
src.PIL.ImageTransform.QuadTransformDefine a quad image transform.
method
src.PIL.ImageTransform.Transform.transform(size:tuple[int, int], image:Image.Image, **options:Any) -> Image.ImagePerform the transform.
class
src.PIL.ImageWin.DibA Windows bitmap with the given mode and size.
method
src.PIL.ImageWin.Dib.expose(handle:int | HDC | HWND) -> NoneCopy the bitmap contents to a device context.
method
src.PIL.ImageWin.Dib.frombytes(buffer:bytes | memoryview) -> NoneLoad display memory contents from byte data.
method
src.PIL.ImageWin.Dib.paste(im:Image.Image, box:tuple[int, int, int, int] | None=None) -> NonePaste a PIL image into the bitmap image.
method
src.PIL.ImageWin.Dib.tobytes() -> bytesCopy display memory contents to bytes object.
class
src.PIL.ImageWin.HDCWraps an HDC integer.
class
src.PIL.ImageWin.HWNDWraps an HWND integer.
class
src.PIL.ImageWin.ImageWindowCreate an image window which displays the given image.
class
src.PIL.ImageWin.WindowCreate a Window with the given title size.
func
src.PIL.IptcImagePlugin.getiptcinfo(im:ImageFile.ImageFile) -> dict[tuple[int, int], bytes | list[bytes]] | NoneGet IPTC information from TIFF, JPEG, or IPTC file.
class
src.PIL.PSDraw.PSDrawSets up printing to the given file.
method
src.PIL.PSDraw.PSDraw.begin_document(id:str | None=None) -> NoneSet up printing of a document.
method
src.PIL.PSDraw.PSDraw.end_document() -> NoneEnds printing.
method
src.PIL.PSDraw.PSDraw.image(box:tuple[int, int, int, int], im:Image.Image, dpi:int | None=None) -> NoneDraw a PIL image, centered in the given box.
method
src.PIL.PSDraw.PSDraw.line(xy0:tuple[int, int], xy1:tuple[int, int]) -> NoneDraws a line between the two points.
method
src.PIL.PSDraw.PSDraw.rectangle(box:tuple[int, int, int, int]) -> NoneDraws a rectangle.
method
src.PIL.PSDraw.PSDraw.setfont(font:str, size:int) -> NoneSelects which font to use.
method
src.PIL.PSDraw.PSDraw.text(xy:tuple[int, int], text:str) -> NoneDraws text at the given position.
class
src.PIL.PaletteFile.PaletteFileFile handler for Teragon-style palette files.
class
src.PIL.PcfFontFile.PcfFontFileFont file plugin for the X11 PCF format.
class
src.PIL.PngImagePlugin.PngInfoPNG chunk container (for use with save(pnginfo=))
method
src.PIL.PngImagePlugin.PngInfo.add(cid:bytes, data:bytes, after_idat:bool=False) -> NoneAppends an arbitrary chunk.
method
src.PIL.PngImagePlugin.PngInfo.add_itxt(key:str | bytes, value:str | bytes, lang:str | bytes='', tkey:str | bytes='', zip:bool=False) -> NoneAppends an iTXt chunk.
method
src.PIL.PngImagePlugin.PngInfo.add_text(key:str | bytes, value:str | bytes | iTXt, zip:bool=False) -> NoneAppends a text chunk.
func
src.PIL.PngImagePlugin.getchunks(im:Image.Image, **params:Any) -> list[tuple[bytes, bytes, bytes]]Return a list of PNG chunks representing this image.
func
src.PIL.PngImagePlugin.putchunk(fp:IO[bytes], cid:bytes, *data:bytes) -> NoneWrite a PNG chunk (including CRC field)
class
src.PIL.TiffImagePlugin.ImageFileDirectory_v2This class represents a TIFF tag directory.
func
src.PIL.WalImageFile.open(filename:StrOrBytesPath | IO[bytes]) -> WalImageFileLoad texture from a Quake2 WAL texture file.
func
src.PIL.WmfImagePlugin.register_handler(handler:ImageFile.StubHandler | None) -> NoneInstall application-specific WMF image handler.
func
src.PIL._binary.i16le(c:bytes, o:int=0) -> intConverts a 2-bytes (16 bits) string to an unsigned integer.
func
src.PIL._binary.i32le(c:bytes, o:int=0) -> intConverts a 4-bytes (32 bits) string to an unsigned integer.
func
src.PIL._binary.si16be(c:bytes, o:int=0) -> intConverts a 2-bytes (16 bits) string to a signed integer, big endian.
func
src.PIL._binary.si16le(c:bytes, o:int=0) -> intConverts a 2-bytes (16 bits) string to a signed integer.
func
src.PIL._binary.si32be(c:bytes, o:int=0) -> intConverts a 4-bytes (32 bits) string to a signed integer, big endian.
func
src.PIL._binary.si32le(c:bytes, o:int=0) -> intConverts a 4-bytes (32 bits) string to a signed integer.
func
src.PIL._deprecate.deprecate(deprecated:str, when:int | None, replacement:str | None=None, *action:str | None=None, *plural:bool=False, *stacklevel:int=3) -> NoneDeprecations helper.
func
src.PIL.features.check(feature:str) -> bool | None:param feature: A module, codec, or feature name.
func
src.PIL.features.check_codec(feature:str) -> boolChecks if a codec is available.
func
src.PIL.features.check_feature(feature:str) -> bool | NoneChecks if a feature is available.
func
src.PIL.features.check_module(feature:str) -> boolChecks if a module is available.
func
src.PIL.features.get_supported_codecs() -> list[str]:returns: A list of all supported codecs.
func
src.PIL.features.get_supported_features() -> list[str]:returns: A list of all supported features.
func
src.PIL.features.get_supported_modules() -> list[str]:returns: A list of all supported modules.
func
src.PIL.features.pilinfo(out:IO[str] | None=None, supported_formats:bool=True) -> NonePrints information about this installation of Pillow.
func
src.PIL.features.version(feature:str) -> str | None:param feature: The module, codec, or feature to check for.
func
src.PIL.features.version_codec(feature:str) -> str | None:param feature: The codec to check for.
func
src.PIL.features.version_feature(feature:str) -> str | None:param feature: The feature to check for.
func
src.PIL.features.version_module(feature:str) -> str | None:param feature: The module to check for.
この情報について
掲載しているシグネチャは python-pillow/Pillow の公開ソースコードを
Python の ast モジュールで静的解析し、引数名・デフォルト値・
型注釈・戻り値型をそのまま抽出したものです。実装コードは保存していません。
詳しくは仕組みの解説をご覧ください。