diff --git a/doc/vimage.rst b/doc/vimage.rst index ade13ef..30afb11 100644 --- a/doc/vimage.rst +++ b/doc/vimage.rst @@ -726,7 +726,7 @@ Autogenerated methods out = pyvips.Image.analyzeload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -1256,7 +1256,7 @@ Autogenerated methods out = pyvips.Image.csvload(filename, skip=int, lines=int, whitespace=str, separator=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param skip: Skip this many lines at the start of the file :type skip: int :param lines: Read this many lines from the file @@ -1306,15 +1306,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: csvsave(filename, separator=str, keep=int, background=list[float], page_height=int, profile=str) + .. method:: csvsave(filename, separator=str, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to csv. Example: - in.csvsave(filename, separator=str, keep=int, background=list[float], page_height=int, profile=str) + in.csvsave(filename, separator=str, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param separator: Separator characters :type separator: str :param keep: Which metadata to retain @@ -1324,16 +1324,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: csvsave_target(target, separator=str, keep=int, background=list[float], page_height=int, profile=str) + .. method:: csvsave_target(target, separator=str, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to csv. Example: - in.csvsave_target(target, separator=str, keep=int, background=list[float], page_height=int, profile=str) + in.csvsave_target(target, separator=str, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -1346,7 +1346,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -1394,7 +1394,7 @@ Autogenerated methods out = pyvips.Image.dcrawload(filename, bitdepth=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param bitdepth: Number of bits per pixel :type bitdepth: int :param memory: Force open via memory @@ -1418,7 +1418,7 @@ Autogenerated methods out = pyvips.Image.dcrawload_buffer(buffer, bitdepth=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param bitdepth: Number of bits per pixel :type bitdepth: int :param memory: Force open via memory @@ -1620,15 +1620,15 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: dzsave(filename, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: dzsave(filename, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to deepzoom file. Example: - in.dzsave(filename, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str) + in.dzsave(filename, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param imagename: Image name :type imagename: str :param layout: Directory layout @@ -1664,16 +1664,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: dzsave_buffer(imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: dzsave_buffer(imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to dz buffer. Example: - buffer = in.dzsave_buffer(imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.dzsave_buffer(imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param imagename: Image name :type imagename: str @@ -1710,16 +1710,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: dzsave_target(target, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: dzsave_target(target, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to deepzoom target. Example: - in.dzsave_target(target, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str) + in.dzsave_target(target, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, centre=bool, depth=Union[str, ForeignDzDepth], angle=Union[str, Angle], container=Union[str, ForeignDzContainer], compression=int, region_shrink=Union[str, RegionShrink], skip_blanks=int, id=str, Q=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -1758,7 +1758,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -1892,7 +1892,7 @@ Autogenerated methods out = pyvips.Image.fitsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -1926,15 +1926,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: fitssave(filename, keep=int, background=list[float], page_height=int, profile=str) + .. method:: fitssave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to fits file. Example: - in.fitssave(filename, keep=int, background=list[float], page_height=int, profile=str) + in.fitssave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -1942,7 +1942,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -2110,7 +2110,7 @@ Autogenerated methods out = pyvips.Image.gifload(filename, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param n: Number of pages to load, -1 for all :type n: int :param page: First page to load @@ -2136,7 +2136,7 @@ Autogenerated methods out = pyvips.Image.gifload_buffer(buffer, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param n: Number of pages to load, -1 for all :type n: int :param page: First page to load @@ -2176,15 +2176,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str | Path) Save as gif. Example: - in.gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) + in.gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param dither: Amount of dithering :type dither: float :param effort: Quantisation effort @@ -2208,16 +2208,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str | Path) Save as gif. Example: - buffer = in.gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str | Path) :param dither: Amount of dithering :type dither: float @@ -2242,16 +2242,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str | Path) Save as gif. Example: - in.gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str) + in.gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep_duplicate_frames=bool, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -2278,7 +2278,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -2356,7 +2356,7 @@ Autogenerated methods out = pyvips.Image.heifload(filename, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -2386,7 +2386,7 @@ Autogenerated methods out = pyvips.Image.heifload_buffer(buffer, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -2434,15 +2434,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: heifsave(filename, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str) + .. method:: heifsave(filename, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in HEIF format. Example: - in.heifsave(filename, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str) + in.heifsave(filename, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param Q: Q factor :type Q: int :param bitdepth: Number of bits per pixel @@ -2466,16 +2466,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: heifsave_buffer(Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str) + .. method:: heifsave_buffer(Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in HEIF format. Example: - buffer = in.heifsave_buffer(Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.heifsave_buffer(Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str | Path) :param Q: Q factor :type Q: int @@ -2500,16 +2500,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: heifsave_target(target, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str) + .. method:: heifsave_target(target, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in HEIF format. Example: - in.heifsave_target(target, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str) + in.heifsave_target(target, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], encoder=Union[str, ForeignHeifEncoder], tune=str, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -2536,7 +2536,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -2698,12 +2698,12 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: icc_export(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, output_profile=str, depth=int) + .. method:: icc_export(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, output_profile=str | Path, depth=int) Output to device with ICC profile. Example: - out = in.icc_export(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, output_profile=str, depth=int) + out = in.icc_export(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, output_profile=str | Path, depth=int) :param pcs: Set Profile Connection Space :type pcs: Union[str, PCS] @@ -2712,18 +2712,18 @@ Autogenerated methods :param black_point_compensation: Enable black point compensation :type black_point_compensation: bool :param output_profile: Filename to load output profile from - :type output_profile: str + :type output_profile: str | Path :param depth: Output device space depth in bits :type depth: int :rtype: Image :raises Error: - .. method:: icc_import(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str) + .. method:: icc_import(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str | Path) Import from device with ICC profile. Example: - out = in.icc_import(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str) + out = in.icc_import(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str | Path) :param pcs: Set Profile Connection Space :type pcs: Union[str, PCS] @@ -2734,19 +2734,19 @@ Autogenerated methods :param embedded: Use embedded input profile, if available :type embedded: bool :param input_profile: Filename to load input profile from - :type input_profile: str + :type input_profile: str | Path :rtype: Image :raises Error: - .. method:: icc_transform(output_profile, pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str, depth=int) + .. method:: icc_transform(output_profile, pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str | Path, depth=int) Transform between devices with ICC profiles. Example: - out = in.icc_transform(output_profile, pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str, depth=int) + out = in.icc_transform(output_profile, pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str | Path, depth=int) :param output_profile: Filename to load output profile from - :type output_profile: str + :type output_profile: str | Path :param pcs: Set Profile Connection Space :type pcs: Union[str, PCS] :param intent: Rendering intent @@ -2756,7 +2756,7 @@ Autogenerated methods :param embedded: Use embedded input profile, if available :type embedded: bool :param input_profile: Filename to load input profile from - :type input_profile: str + :type input_profile: str | Path :param depth: Output device space depth in bits :type depth: int :rtype: Image @@ -2862,7 +2862,7 @@ Autogenerated methods out = pyvips.Image.jp2kload(filename, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param page: Load this page from the image :type page: int :param oneshot: Load images a frame at a time @@ -2888,7 +2888,7 @@ Autogenerated methods out = pyvips.Image.jp2kload_buffer(buffer, page=int, oneshot=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param page: Load this page from the image :type page: int :param oneshot: Load images a frame at a time @@ -2928,15 +2928,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: jp2ksave(filename, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str) + .. method:: jp2ksave(filename, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str | Path) Save image in JPEG2000 format. Example: - in.jp2ksave(filename, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str) + in.jp2ksave(filename, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param tile_width: Tile width in pixels :type tile_width: int :param tile_height: Tile height in pixels @@ -2954,16 +2954,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: jp2ksave_buffer(tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str) + .. method:: jp2ksave_buffer(tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str | Path) Save image in JPEG2000 format. Example: - buffer = in.jp2ksave_buffer(tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str) + buffer = in.jp2ksave_buffer(tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str | Path) :param tile_width: Tile width in pixels :type tile_width: int @@ -2982,16 +2982,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: jp2ksave_target(target, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str) + .. method:: jp2ksave_target(target, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str | Path) Save image in JPEG2000 format. Example: - in.jp2ksave_target(target, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str) + in.jp2ksave_target(target, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -3012,7 +3012,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -3024,7 +3024,7 @@ Autogenerated methods out = pyvips.Image.jpegload(filename, shrink=int, autorotate=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param shrink: Shrink factor on load :type shrink: int :param autorotate: Rotate image using exif orientation @@ -3052,7 +3052,7 @@ Autogenerated methods out = pyvips.Image.jpegload_buffer(buffer, shrink=int, autorotate=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param shrink: Shrink factor on load :type shrink: int :param autorotate: Rotate image using exif orientation @@ -3096,15 +3096,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: jpegsave(filename, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jpegsave(filename, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save as jpeg. Example: - in.jpegsave(filename, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + in.jpegsave(filename, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param Q: Q factor :type Q: int :param optimize_coding: Compute optimal Huffman coding tables @@ -3130,16 +3130,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: jpegsave_buffer(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jpegsave_buffer(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save as jpeg. Example: - buffer = in.jpegsave_buffer(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.jpegsave_buffer(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param Q: Q factor :type Q: int @@ -3166,16 +3166,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: jpegsave_mime(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jpegsave_mime(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to jpeg mime. Example: - in.jpegsave_mime(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + in.jpegsave_mime(Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param Q: Q factor :type Q: int @@ -3202,16 +3202,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: jpegsave_target(target, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jpegsave_target(target, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save as jpeg. Example: - in.jpegsave_target(target, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str) + in.jpegsave_target(target, Q=int, optimize_coding=bool, interlace=bool, trellis_quant=bool, overshoot_deringing=bool, optimize_scans=bool, quant_table=int, subsample_mode=Union[str, ForeignSubsample], restart_interval=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -3240,7 +3240,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -3252,7 +3252,7 @@ Autogenerated methods out = pyvips.Image.jxlload(filename, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -3278,7 +3278,7 @@ Autogenerated methods out = pyvips.Image.jxlload_buffer(buffer, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -3318,15 +3318,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in JPEG-XL format. Example: - in.jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + in.jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param tier: Decode speed tier :type tier: int :param distance: Target butteraugli distance @@ -3346,16 +3346,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in JPEG-XL format. Example: - buffer = in.jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param tier: Decode speed tier :type tier: int @@ -3376,16 +3376,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in JPEG-XL format. Example: - in.jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + in.jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -3408,7 +3408,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -3484,7 +3484,7 @@ Autogenerated methods out = pyvips.Image.magickload(filename, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param density: Canvas resolution for rendering vector formats like SVG :type density: str :param page: First page to load @@ -3510,7 +3510,7 @@ Autogenerated methods out = pyvips.Image.magickload_buffer(buffer, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param density: Canvas resolution for rendering vector formats like SVG :type density: str :param page: First page to load @@ -3554,15 +3554,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save file with ImageMagick. Example: - in.magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + in.magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param format: Format to save in :type format: str :param quality: Quality to use @@ -3580,16 +3580,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to magick buffer. Example: - buffer = in.magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param format: Format to save in :type format: str @@ -3608,8 +3608,8 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: .. method:: mapim(index, interpolate=GObject, background=list[float], premultiplied=bool, extend=Union[str, Extend]) @@ -4006,7 +4006,7 @@ Autogenerated methods out = pyvips.Image.matload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -4038,7 +4038,7 @@ Autogenerated methods out = pyvips.Image.matrixload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -4084,12 +4084,12 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: matrixprint(keep=int, background=list[float], page_height=int, profile=str) + .. method:: matrixprint(keep=int, background=list[float], page_height=int, profile=str | Path) Print matrix. Example: - in.matrixprint(keep=int, background=list[float], page_height=int, profile=str) + in.matrixprint(keep=int, background=list[float], page_height=int, profile=str | Path) :param keep: Which metadata to retain :type keep: int @@ -4098,19 +4098,19 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: matrixsave(filename, keep=int, background=list[float], page_height=int, profile=str) + .. method:: matrixsave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to matrix. Example: - in.matrixsave(filename, keep=int, background=list[float], page_height=int, profile=str) + in.matrixsave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -4118,16 +4118,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: matrixsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + .. method:: matrixsave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to matrix. Example: - in.matrixsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + in.matrixsave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -4138,7 +4138,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -4380,7 +4380,7 @@ Autogenerated methods out = pyvips.Image.niftiload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -4422,7 +4422,7 @@ Autogenerated methods in.niftisave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -4430,7 +4430,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -4442,7 +4442,7 @@ Autogenerated methods out = pyvips.Image.openexrload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -4464,7 +4464,7 @@ Autogenerated methods out = pyvips.Image.openslideload(filename, level=int, autocrop=bool, associated=str, attach_associated=bool, rgb=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param level: Load this level from the file :type level: int :param autocrop: Crop to image bounds @@ -4526,7 +4526,7 @@ Autogenerated methods out = pyvips.Image.pdfload(filename, page=int, n=int, dpi=float, scale=float, background=list[float], password=str, page_box=Union[str, ForeignPdfPageBox], memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -4562,7 +4562,7 @@ Autogenerated methods out = pyvips.Image.pdfload_buffer(buffer, page=int, n=int, dpi=float, scale=float, background=list[float], password=str, page_box=Union[str, ForeignPdfPageBox], memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -4674,7 +4674,7 @@ Autogenerated methods out = pyvips.Image.pngload(filename, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param unlimited: Remove all denial of service limits :type unlimited: bool :param memory: Force open via memory @@ -4698,7 +4698,7 @@ Autogenerated methods out = pyvips.Image.pngload_buffer(buffer, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param unlimited: Remove all denial of service limits :type unlimited: bool :param memory: Force open via memory @@ -4734,15 +4734,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: pngsave(filename, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: pngsave(filename, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to file as png. Example: - in.pngsave(filename, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str) + in.pngsave(filename, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param compression: Compression factor :type compression: int :param interlace: Interlace image @@ -4766,16 +4766,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: pngsave_buffer(compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: pngsave_buffer(compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to buffer as png. Example: - buffer = in.pngsave_buffer(compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.pngsave_buffer(compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param compression: Compression factor :type compression: int @@ -4800,16 +4800,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: pngsave_target(target, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: pngsave_target(target, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to target as PNG. Example: - in.pngsave_target(target, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str) + in.pngsave_target(target, compression=int, interlace=bool, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -4836,7 +4836,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -4848,7 +4848,7 @@ Autogenerated methods out = pyvips.Image.ppmload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -4870,7 +4870,7 @@ Autogenerated methods out = pyvips.Image.ppmload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -4902,15 +4902,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to ppm file. Example: - in.ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + in.ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param format: Format to save in :type format: Union[str, ForeignPpmFormat] :param ascii: Save as ascii @@ -4924,16 +4924,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save to ppm. Example: - in.ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) + in.ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -4950,7 +4950,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -4995,7 +4995,7 @@ Autogenerated methods :param name: Profile name :type name: str - :rtype: str + :rtype: bytes :raises Error: .. method:: project() @@ -5040,7 +5040,7 @@ Autogenerated methods out = pyvips.Image.radload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5062,7 +5062,7 @@ Autogenerated methods out = pyvips.Image.radload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -5094,15 +5094,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: radsave(filename, keep=int, background=list[float], page_height=int, profile=str) + .. method:: radsave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to Radiance file. Example: - in.radsave(filename, keep=int, background=list[float], page_height=int, profile=str) + in.radsave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -5110,16 +5110,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: radsave_buffer(keep=int, background=list[float], page_height=int, profile=str) + .. method:: radsave_buffer(keep=int, background=list[float], page_height=int, profile=str | Path) Save image to Radiance buffer. Example: - buffer = in.radsave_buffer(keep=int, background=list[float], page_height=int, profile=str) + buffer = in.radsave_buffer(keep=int, background=list[float], page_height=int, profile=str | Path) :param keep: Which metadata to retain :type keep: int @@ -5128,16 +5128,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: radsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + .. method:: radsave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to Radiance target. Example: - in.radsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + in.radsave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -5148,7 +5148,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -5176,7 +5176,7 @@ Autogenerated methods out = pyvips.Image.rawload(filename, width, height, bands, offset=long, format=Union[str, BandFormat], interpretation=Union[str, Interpretation], memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param width: Image width in pixels :type width: int :param height: Image height in pixels @@ -5202,15 +5202,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: rawsave(filename, keep=int, background=list[float], page_height=int, profile=str) + .. method:: rawsave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to raw file. Example: - in.rawsave(filename, keep=int, background=list[float], page_height=int, profile=str) + in.rawsave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -5218,16 +5218,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: rawsave_buffer(keep=int, background=list[float], page_height=int, profile=str) + .. method:: rawsave_buffer(keep=int, background=list[float], page_height=int, profile=str | Path) Write raw image to buffer. Example: - buffer = in.rawsave_buffer(keep=int, background=list[float], page_height=int, profile=str) + buffer = in.rawsave_buffer(keep=int, background=list[float], page_height=int, profile=str | Path) :param keep: Which metadata to retain :type keep: int @@ -5236,16 +5236,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: rawsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + .. method:: rawsave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) Write raw image to target. Example: - in.rawsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + in.rawsave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -5256,7 +5256,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -5836,7 +5836,7 @@ Autogenerated methods out = pyvips.Image.svgload(filename, dpi=float, scale=float, unlimited=bool, stylesheet=str, high_bitdepth=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param dpi: Render at this DPI :type dpi: float :param scale: Scale output by this factor @@ -5868,7 +5868,7 @@ Autogenerated methods out = pyvips.Image.svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, stylesheet=str, high_bitdepth=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param dpi: Render at this DPI :type dpi: float :param scale: Scale output by this factor @@ -5990,15 +5990,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: thumbnail(filename, width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + .. staticmethod:: thumbnail(filename, width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) Generate thumbnail from file. Example: - out = pyvips.Image.thumbnail(filename, width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + out = pyvips.Image.thumbnail(filename, width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) :param filename: Filename to read from - :type filename: str + :type filename: str | Path :param width: Size to this width :type width: int :param height: Size to this height @@ -6012,9 +6012,9 @@ Autogenerated methods :param linear: Reduce in linear light :type linear: bool :param input_profile: Fallback input profile - :type input_profile: str + :type input_profile: str | Path :param output_profile: Fallback output profile - :type output_profile: str + :type output_profile: str | Path :param intent: Rendering intent :type intent: Union[str, Intent] :param fail_on: Error level to fail on @@ -6022,15 +6022,15 @@ Autogenerated methods :rtype: Image :raises Error: - .. staticmethod:: thumbnail_buffer(buffer, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + .. staticmethod:: thumbnail_buffer(buffer, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) Generate thumbnail from buffer. Example: - out = pyvips.Image.thumbnail_buffer(buffer, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + out = pyvips.Image.thumbnail_buffer(buffer, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param width: Size to this width :type width: int :param option_string: Options that are passed on to the underlying loader @@ -6046,9 +6046,9 @@ Autogenerated methods :param linear: Reduce in linear light :type linear: bool :param input_profile: Fallback input profile - :type input_profile: str + :type input_profile: str | Path :param output_profile: Fallback output profile - :type output_profile: str + :type output_profile: str | Path :param intent: Rendering intent :type intent: Union[str, Intent] :param fail_on: Error level to fail on @@ -6056,12 +6056,12 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: thumbnail_image(width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + .. method:: thumbnail_image(width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) Generate thumbnail from image. Example: - out = in.thumbnail_image(width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + out = in.thumbnail_image(width, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) :param width: Size to this width :type width: int @@ -6076,9 +6076,9 @@ Autogenerated methods :param linear: Reduce in linear light :type linear: bool :param input_profile: Fallback input profile - :type input_profile: str + :type input_profile: str | Path :param output_profile: Fallback output profile - :type output_profile: str + :type output_profile: str | Path :param intent: Rendering intent :type intent: Union[str, Intent] :param fail_on: Error level to fail on @@ -6086,12 +6086,12 @@ Autogenerated methods :rtype: Image :raises Error: - .. staticmethod:: thumbnail_source(source, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + .. staticmethod:: thumbnail_source(source, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) Generate thumbnail from source. Example: - out = pyvips.Image.thumbnail_source(source, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str, output_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn]) + out = pyvips.Image.thumbnail_source(source, width, option_string=str, height=int, size=Union[str, Size], no_rotate=bool, crop=Union[str, Interesting], linear=bool, input_profile=str | Path, output_profile=str | Path, intent=Union[str, Intent], fail_on=Union[str, FailOn]) :param source: Source to load from :type source: Source @@ -6110,9 +6110,9 @@ Autogenerated methods :param linear: Reduce in linear light :type linear: bool :param input_profile: Fallback input profile - :type input_profile: str + :type input_profile: str | Path :param output_profile: Fallback output profile - :type output_profile: str + :type output_profile: str | Path :param intent: Rendering intent :type intent: Union[str, Intent] :param fail_on: Error level to fail on @@ -6128,7 +6128,7 @@ Autogenerated methods out = pyvips.Image.tiffload(filename, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -6160,7 +6160,7 @@ Autogenerated methods out = pyvips.Image.tiffload_buffer(buffer, page=int, n=int, autorotate=bool, subifd=int, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -6212,15 +6212,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to tiff file. Example: - in.tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str) + in.tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param compression: Compression for this file :type compression: Union[str, ForeignTiffCompression] :param Q: Q factor @@ -6268,16 +6268,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to tiff buffer. Example: - buffer = in.tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str | Path) :param compression: Compression for this file :type compression: Union[str, ForeignTiffCompression] @@ -6326,16 +6326,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str) + .. method:: tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to tiff target. Example: - in.tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str) + in.tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, tile_height=int, pyramid=bool, miniswhite=bool, bitdepth=int, resunit=Union[str, ForeignTiffResunit], xres=float, yres=float, bigtiff=bool, properties=bool, region_shrink=Union[str, RegionShrink], level=int, lossless=bool, depth=Union[str, ForeignDzDepth], subifd=bool, premultiply=bool, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -6386,7 +6386,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -6472,7 +6472,7 @@ Autogenerated methods out = pyvips.Image.uhdrload(filename, shrink=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param shrink: Shrink factor on load :type shrink: int :param memory: Force open via memory @@ -6496,7 +6496,7 @@ Autogenerated methods out = pyvips.Image.uhdrload_buffer(buffer, shrink=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param shrink: Shrink factor on load :type shrink: int :param memory: Force open via memory @@ -6532,17 +6532,19 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: uhdrsave(filename, Q=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: uhdrsave(filename, Q=int, gainmap_scale_factor=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in UltraHDR format. Example: - in.uhdrsave(filename, Q=int, keep=int, background=list[float], page_height=int, profile=str) + in.uhdrsave(filename, Q=int, gainmap_scale_factor=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param Q: Q factor :type Q: int + :param gainmap_scale_factor: The scale factor of base image to gainmap image + :type gainmap_scale_factor: int :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -6550,19 +6552,21 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: uhdrsave_buffer(Q=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: uhdrsave_buffer(Q=int, gainmap_scale_factor=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in UltraHDR format. Example: - buffer = in.uhdrsave_buffer(Q=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.uhdrsave_buffer(Q=int, gainmap_scale_factor=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param Q: Q factor :type Q: int + :param gainmap_scale_factor: The scale factor of base image to gainmap image + :type gainmap_scale_factor: int :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -6570,21 +6574,23 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: uhdrsave_target(target, Q=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: uhdrsave_target(target, Q=int, gainmap_scale_factor=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image in UltraHDR format. Example: - in.uhdrsave_target(target, Q=int, keep=int, background=list[float], page_height=int, profile=str) + in.uhdrsave_target(target, Q=int, gainmap_scale_factor=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target :param Q: Q factor :type Q: int + :param gainmap_scale_factor: The scale factor of base image to gainmap image + :type gainmap_scale_factor: int :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -6592,7 +6598,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -6618,7 +6624,7 @@ Autogenerated methods out = pyvips.Image.vipsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -6652,15 +6658,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: vipssave(filename, keep=int, background=list[float], page_height=int, profile=str) + .. method:: vipssave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to file in vips format. Example: - in.vipssave(filename, keep=int, background=list[float], page_height=int, profile=str) + in.vipssave(filename, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param keep: Which metadata to retain :type keep: int :param background: Background value @@ -6668,16 +6674,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: vipssave_target(target, keep=int, background=list[float], page_height=int, profile=str) + .. method:: vipssave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to target in vips format. Example: - in.vipssave_target(target, keep=int, background=list[float], page_height=int, profile=str) + in.vipssave_target(target, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -6688,7 +6694,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: @@ -6700,7 +6706,7 @@ Autogenerated methods out = pyvips.Image.webpload(filename, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param filename: Filename to load from - :type filename: str + :type filename: str | Path :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -6728,7 +6734,7 @@ Autogenerated methods out = pyvips.Image.webpload_buffer(buffer, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn]) :param buffer: Buffer to load from - :type buffer: str + :type buffer: bytes :param page: First page to load :type page: int :param n: Number of pages to load, -1 for all @@ -6772,15 +6778,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: webpsave(filename, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: webpsave(filename, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save as WebP. Example: - in.webpsave(filename, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + in.webpsave(filename, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param filename: Filename to save to - :type filename: str + :type filename: str | Path :param Q: Q factor :type Q: int :param lossless: Enable lossless compression @@ -6818,16 +6824,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: webpsave_buffer(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: webpsave_buffer(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save as WebP. Example: - buffer = in.webpsave_buffer(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + buffer = in.webpsave_buffer(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param Q: Q factor :type Q: int @@ -6866,16 +6872,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str - :rtype: str + :type profile: str | Path + :rtype: bytes :raises Error: - .. method:: webpsave_mime(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: webpsave_mime(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save image to webp mime. Example: - in.webpsave_mime(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + in.webpsave_mime(Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param Q: Q factor :type Q: int @@ -6914,16 +6920,16 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: - .. method:: webpsave_target(target, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + .. method:: webpsave_target(target, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) Save as WebP. Example: - in.webpsave_target(target, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str) + in.webpsave_target(target, Q=int, lossless=bool, exact=bool, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, target_size=int, mixed=bool, smart_deblock=bool, passes=int, keep=int, background=list[float], page_height=int, profile=str | Path) :param target: Target to save to :type target: Target @@ -6964,7 +6970,7 @@ Autogenerated methods :param page_height: Set page height for multipage save :type page_height: int :param profile: Filename of ICC profile to embed - :type profile: str + :type profile: str | Path :rtype: list[] :raises Error: diff --git a/examples/generate_type_stubs.py b/examples/generate_type_stubs.py index cac0d94..39ee794 100755 --- a/examples/generate_type_stubs.py +++ b/examples/generate_type_stubs.py @@ -22,55 +22,22 @@ - Documentation generation (pyvips.Operation.generate_sphinx_all()) """ -import typing -from typing import Any, Optional, Union +import inspect import pyvips -from pyvips import ( - GValue, - Introspect, - type_map, - type_from_name, - nickname_find, - at_least_libvips, -) +from pyvips import GValue, Introspect, type_map, type_from_name, nickname_find from pyvips import ffi, Error from pyvips.voperation import _OPERATION_DEPRECATED -def gtype_to_python_type(gtype: int) -> str: +def gtype_to_python_type(name: str, gtype: int) -> str: """Map a gtype to Python type annotation string.""" - fundamental = pyvips.gobject_lib.g_type_fundamental(gtype) - - if fundamental == GValue.genum_type: - name = pyvips.type_name(gtype) - if name.startswith("Vips"): - name = name[4:] - return f"Union[str, {name}]" - - type_mapping = { - GValue.gbool_type: "bool", - GValue.gint_type: "int", - GValue.guint64_type: "int", - GValue.gdouble_type: "float", - GValue.gstr_type: "str", - GValue.refstr_type: "str", - GValue.gflags_type: "int", - GValue.gobject_type: "GObject", - GValue.image_type: "Image", - GValue.array_int_type: "list[int]", - GValue.array_double_type: "list[float]", - GValue.array_image_type: "list[Image]", - GValue.blob_type: "str", - GValue.source_type: "Source", - GValue.target_type: "Target", - } - - if gtype in type_mapping: - return type_mapping[gtype] - if fundamental in type_mapping: - return type_mapping[fundamental] - return "Any" + if ( + name in ("filename", "input_profile", "output_profile", "profile") + and gtype == GValue.gstr_type + ): + return "str | Path" + return GValue.gtype_to_python(gtype) PYTHON_KEYWORDS = { @@ -115,7 +82,7 @@ def escape_parameter_name(name: str) -> str: return name -def generate_method_signature(operation_name: str) -> str: +def generate_method_signature(operation_name: str) -> str | None: """Generate type signature for an operation method.""" intro = Introspect.get(operation_name) @@ -133,12 +100,12 @@ def generate_method_signature(operation_name: str) -> str: # Required args (excluding member_x for instance methods) for name in intro.method_args: - py_type = gtype_to_python_type(intro.details[name]["type"]) + py_type = gtype_to_python_type(name, intro.details[name]["type"]) args_list.append(f"{escape_parameter_name(name)}: {py_type}") # Optional args (excluding deprecated) for name in intro.doc_optional_input: - py_type = gtype_to_python_type(intro.details[name]["type"]) + py_type = gtype_to_python_type(name, intro.details[name]["type"]) args_list.append(f"{escape_parameter_name(name)}: {py_type} = ...") # Optional output args @@ -148,7 +115,7 @@ def generate_method_signature(operation_name: str) -> str: args_str = ", ".join(args_list) # Return type output_types = [ - gtype_to_python_type(intro.details[name]["type"]) + gtype_to_python_type(name, intro.details[name]["type"]) for name in intro.required_output ] @@ -210,100 +177,22 @@ def add_name(gtype, a, b): return "\n".join([sig for _, sig in all_names]) -def get_all_enum_names() -> list[str]: - """Get all enum type names from introspection.""" - - enum_names = set() - - def add_enums(gtype, a, b): - fundamental = pyvips.gobject_lib.g_type_fundamental(gtype) - if fundamental == GValue.genum_type: - name = pyvips.type_name(gtype) - if name.startswith("Vips"): - name = name[4:] - enum_names.add(name) - type_map(gtype, add_enums) - return ffi.NULL - - type_map(type_from_name("VipsOperation"), add_enums) - - # Also add base enums - enum_names.update( - [ - "BandFormat", - "Interpretation", - "Kernel", - "Coding", - "Extend", - "Align", - "Direction", - "Angle", - "Angle45", - "Access", - "Shrink", - "Intent", - "PCS", - "OperationBoolean", - "OperationComplex", - "OperationComplex2", - "OperationComplexget", - "OperationMath", - "OperationMath2", - "OperationMorphology", - "OperationRelational", - "OperationRound", - "Interesting", - "SdfShape", - "TextWrap", - "Combine", - "CombineMode", - "CompassDirection", - "Precision", - "FailOn", - "BlendMode", - "ForeignDzLayout", - "ForeignDzDepth", - "ForeignDzContainer", - "RegionShrink", - "ForeignHeifCompression", - "ForeignSubsample", - "ForeignHeifEncoder", - "ForeignPpmFormat", - "ForeignTiffCompression", - "ForeignTiffPredictor", - "ForeignTiffResunit", - "ForeignWebpPreset", - "Size", - ] - ) - - return sorted(enum_names) - - -def generate_enum_class(name: str) -> str: - """Generate type stub for a single enum class.""" - if name == "Direction": - return """class Direction: - HORIZONTAL: str - VERTICAL: str -""" - elif name == "Align": - return """class Align: - LOW: str - CENTRE: str - HIGH: str -""" - else: - return f"class {name}: ..." - - def generate_stub() -> str: """Generate complete pyvips type stub.""" # Get all enum names - enum_names = get_all_enum_names() + enum_names = sorted(n for n in dir(pyvips.enums) if not n.startswith("__")) + enum_dict = dict(inspect.getmembers(pyvips.enums)) + enum_defs: list[str] = [] + for e in enum_names: + et = enum_dict[e] + emems = [(m, mval) for m, mval in et.__dict__.items() if not m.startswith("__")] + enum_def = f"class {e}:\n" + "\n".join( + f" {name}: {type(value).__name__} = {value!r}" for name, value in emems + ) + enum_defs.append(enum_def) - enum_classes = "\n".join([generate_enum_class(name) for name in enum_names]) + enum_classes = "\n\n".join(enum_defs) stub = f'''"""Type stubs for pyvips. @@ -323,7 +212,8 @@ def generate_stub() -> str: """ from __future__ import annotations -from typing import Dict, List, Optional, Tuple, TypeVar, Union, overload +from pathlib import Path +from typing import Any, Dict, List, Optional, Type, Union # Exception classes class Error(Exception): ... @@ -374,7 +264,6 @@ def new(name: str) -> Interpolate: ... # Enum classes {enum_classes} - class Image(VipsObject): """Wrap a VipsImage object.""" @@ -409,13 +298,13 @@ def remove(self, name: str) -> bool: ... # Constructors @staticmethod - def new_from_file(vips_filename: str, **kwargs: object) -> Image: ... + def new_from_file(vips_filename: str | Path, **kwargs: object) -> Image: ... @staticmethod def new_from_buffer(data: Union[bytes, bytearray, memoryview], options: str, **kwargs: object) -> Image: ... @staticmethod def new_from_list(array: List[List[float]], scale: float =1.0, offset: float = 0.0) -> Image: ... @classmethod - def new_from_array(cls, obj: Union[List, bytes, bytearray, memoryview], scale: float = 1.0, offset: float = 0.0, interpretation: Optional[Union[str, Interpretation]] = None) -> Image: ... + def new_from_array(cls, obj: Union[List[List[float]], bytes, bytearray, memoryview], scale: float = 1.0, offset: float = 0.0, interpretation: Optional[Union[str, Interpretation]] = None) -> Image: ... @staticmethod def new_from_memory(data: Union[bytes, bytearray, memoryview], width: int, height: int, bands: int, format: Union[str, BandFormat]) -> Image: ... @staticmethod @@ -426,7 +315,7 @@ def new_from_image(self, value: Union[float, int, List[float], List[int]]) -> Im def copy_memory(self) -> Image: ... # Writers - def write_to_file(self, vips_filename: str, **kwargs: object) -> None: ... + def write_to_file(self, vips_filename: str | Path, **kwargs: object) -> None: ... def write_to_buffer(self, format_string: str, **kwargs: object) -> bytes: ... def write_to_target(self, target: Target, format_string: str, **kwargs: object) -> None: ... def write_to_memory(self) -> bytes: ... @@ -504,9 +393,44 @@ def __getitem__(self, arg: Union[int, slice, List[int], List[bool]]) -> Image: . def __call__(self, x: int, y: int) -> List[float]: ... def __repr__(self) -> str: ... +class Operation(VipsObject): + @staticmethod + def new_from_name(operation_name: str) -> "Operation": ... + def set( + self, + name: str, + flags: int, + match_image: Optional[Image], + value: Any, + ) -> None: ... + @staticmethod + def call(operation_name: str, *args: Any, **kwargs: Any) -> Any: ... + @staticmethod + def generate_docstring(operation_name: str) -> str: ... + @staticmethod + def generate_sphinx(operation_name: str) -> str: ... + @staticmethod + def generate_sphinx_all() -> None: ... -class Operation: ... -class Introspect: ... +class Introspect(object): + description: str + flags: int + details: Dict[str, Dict[str, Any]] + + required_input: List[str] + optional_input: List[str] + required_output: List[str] + optional_output: List[str] + + doc_optional_input: List[str] + doc_optional_output: List[str] + + member_x: Optional[str] + method_args: List[str] + + def __init__(self, operation_name: str) -> None: ... + @classmethod + def get(cls: Type["Introspect"], operation_name: str) -> "Introspect": ... # Global functions def cache_set_max(mx: int) -> None: ... diff --git a/pyvips/__init__.pyi b/pyvips/__init__.pyi index bc30b92..3d55590 100644 --- a/pyvips/__init__.pyi +++ b/pyvips/__init__.pyi @@ -16,7 +16,8 @@ To regenerate after libvips updates: """ from __future__ import annotations -from typing import Dict, List, Optional, Tuple, TypeVar, Union, overload +from pathlib import Path +from typing import Any, Dict, List, Optional, Type, Union # Exception classes class Error(Exception): ... @@ -65,58 +66,354 @@ class Interpolate: def new(name: str) -> Interpolate: ... # Enum classes -class Access: ... +class Access: + RANDOM: str = 'random' + SEQUENTIAL: str = 'sequential' + SEQUENTIAL_UNBUFFERED: str = 'sequential-unbuffered' + class Align: - LOW: str - CENTRE: str - HIGH: str - -class Angle: ... -class Angle45: ... -class BandFormat: ... -class BlendMode: ... -class Coding: ... -class Combine: ... -class CombineMode: ... -class CompassDirection: ... + LOW: str = 'low' + CENTRE: str = 'centre' + HIGH: str = 'high' + +class Angle: + D0: str = 'd0' + D90: str = 'd90' + D180: str = 'd180' + D270: str = 'd270' + +class Angle45: + D0: str = 'd0' + D45: str = 'd45' + D90: str = 'd90' + D135: str = 'd135' + D180: str = 'd180' + D225: str = 'd225' + D270: str = 'd270' + D315: str = 'd315' + +class BandFormat: + NOTSET: str = 'notset' + UCHAR: str = 'uchar' + CHAR: str = 'char' + USHORT: str = 'ushort' + SHORT: str = 'short' + UINT: str = 'uint' + INT: str = 'int' + FLOAT: str = 'float' + COMPLEX: str = 'complex' + DOUBLE: str = 'double' + DPCOMPLEX: str = 'dpcomplex' + +class BlendMode: + CLEAR: str = 'clear' + SOURCE: str = 'source' + OVER: str = 'over' + IN: str = 'in' + OUT: str = 'out' + ATOP: str = 'atop' + DEST: str = 'dest' + DEST_OVER: str = 'dest-over' + DEST_IN: str = 'dest-in' + DEST_OUT: str = 'dest-out' + DEST_ATOP: str = 'dest-atop' + XOR: str = 'xor' + ADD: str = 'add' + SATURATE: str = 'saturate' + MULTIPLY: str = 'multiply' + SCREEN: str = 'screen' + OVERLAY: str = 'overlay' + DARKEN: str = 'darken' + LIGHTEN: str = 'lighten' + COLOUR_DODGE: str = 'colour-dodge' + COLOUR_BURN: str = 'colour-burn' + HARD_LIGHT: str = 'hard-light' + SOFT_LIGHT: str = 'soft-light' + DIFFERENCE: str = 'difference' + EXCLUSION: str = 'exclusion' + +class Coding: + ERROR: str = 'error' + NONE: str = 'none' + LABQ: str = 'labq' + RAD: str = 'rad' + +class Combine: + MAX: str = 'max' + SUM: str = 'sum' + MIN: str = 'min' + +class CombineMode: + SET: str = 'set' + ADD: str = 'add' + +class CompassDirection: + CENTRE: str = 'centre' + NORTH: str = 'north' + EAST: str = 'east' + SOUTH: str = 'south' + WEST: str = 'west' + NORTH_EAST: str = 'north-east' + SOUTH_EAST: str = 'south-east' + SOUTH_WEST: str = 'south-west' + NORTH_WEST: str = 'north-west' + class Direction: - HORIZONTAL: str - VERTICAL: str - -class Extend: ... -class FailOn: ... -class ForeignDzContainer: ... -class ForeignDzDepth: ... -class ForeignDzLayout: ... -class ForeignHeifCompression: ... -class ForeignHeifEncoder: ... -class ForeignPpmFormat: ... -class ForeignSubsample: ... -class ForeignTiffCompression: ... -class ForeignTiffPredictor: ... -class ForeignTiffResunit: ... -class ForeignWebpPreset: ... -class Intent: ... -class Interesting: ... -class Interpretation: ... -class Kernel: ... -class OperationBoolean: ... -class OperationComplex: ... -class OperationComplex2: ... -class OperationComplexget: ... -class OperationMath: ... -class OperationMath2: ... -class OperationMorphology: ... -class OperationRelational: ... -class OperationRound: ... -class PCS: ... -class Precision: ... -class RegionShrink: ... -class SdfShape: ... -class Shrink: ... -class Size: ... -class TextWrap: ... + HORIZONTAL: str = 'horizontal' + VERTICAL: str = 'vertical' + +class Extend: + BLACK: str = 'black' + COPY: str = 'copy' + REPEAT: str = 'repeat' + MIRROR: str = 'mirror' + WHITE: str = 'white' + BACKGROUND: str = 'background' + +class FailOn: + NONE: str = 'none' + TRUNCATED: str = 'truncated' + ERROR: str = 'error' + WARNING: str = 'warning' + +class ForeignDzContainer: + FS: str = 'fs' + ZIP: str = 'zip' + SZI: str = 'szi' + +class ForeignDzDepth: + ONEPIXEL: str = 'onepixel' + ONETILE: str = 'onetile' + ONE: str = 'one' + +class ForeignDzLayout: + DZ: str = 'dz' + ZOOMIFY: str = 'zoomify' + GOOGLE: str = 'google' + IIIF: str = 'iiif' + IIIF3: str = 'iiif3' + +class ForeignHeifCompression: + HEVC: str = 'hevc' + AVC: str = 'avc' + JPEG: str = 'jpeg' + AV1: str = 'av1' + +class ForeignHeifEncoder: + AUTO: str = 'auto' + AOM: str = 'aom' + RAV1E: str = 'rav1e' + SVT: str = 'svt' + X265: str = 'x265' + +class ForeignKeep: + NONE: int = 0 + EXIF: int = 1 + XMP: int = 2 + IPTC: int = 4 + ICC: int = 8 + OTHER: int = 16 + GAINMAP: int = 32 + ALL: int = 63 + +class ForeignPdfPageBox: + MEDIA: str = 'media' + CROP: str = 'crop' + TRIM: str = 'trim' + BLEED: str = 'bleed' + ART: str = 'art' + +class ForeignPngFilter: + NONE: int = 8 + SUB: int = 16 + UP: int = 32 + AVG: int = 64 + PAETH: int = 128 + ALL: int = 248 + +class ForeignPpmFormat: + PBM: str = 'pbm' + PGM: str = 'pgm' + PPM: str = 'ppm' + PFM: str = 'pfm' + PNM: str = 'pnm' + +class ForeignSubsample: + AUTO: str = 'auto' + ON: str = 'on' + OFF: str = 'off' + +class ForeignTiffCompression: + NONE: str = 'none' + JPEG: str = 'jpeg' + DEFLATE: str = 'deflate' + PACKBITS: str = 'packbits' + CCITTFAX4: str = 'ccittfax4' + LZW: str = 'lzw' + WEBP: str = 'webp' + ZSTD: str = 'zstd' + JP2K: str = 'jp2k' + +class ForeignTiffPredictor: + NONE: str = 'none' + HORIZONTAL: str = 'horizontal' + FLOAT: str = 'float' + +class ForeignTiffResunit: + CM: str = 'cm' + INCH: str = 'inch' + +class ForeignWebpPreset: + DEFAULT: str = 'default' + PICTURE: str = 'picture' + PHOTO: str = 'photo' + DRAWING: str = 'drawing' + ICON: str = 'icon' + TEXT: str = 'text' + +class Intent: + PERCEPTUAL: str = 'perceptual' + RELATIVE: str = 'relative' + SATURATION: str = 'saturation' + ABSOLUTE: str = 'absolute' + AUTO: str = 'auto' + +class Interesting: + NONE: str = 'none' + CENTRE: str = 'centre' + ENTROPY: str = 'entropy' + ATTENTION: str = 'attention' + LOW: str = 'low' + HIGH: str = 'high' + ALL: str = 'all' + +class Interpretation: + ERROR: str = 'error' + MULTIBAND: str = 'multiband' + B_W: str = 'b-w' + HISTOGRAM: str = 'histogram' + XYZ: str = 'xyz' + LAB: str = 'lab' + CMYK: str = 'cmyk' + LABQ: str = 'labq' + RGB: str = 'rgb' + CMC: str = 'cmc' + LCH: str = 'lch' + LABS: str = 'labs' + SRGB: str = 'srgb' + YXY: str = 'yxy' + FOURIER: str = 'fourier' + RGB16: str = 'rgb16' + GREY16: str = 'grey16' + MATRIX: str = 'matrix' + SCRGB: str = 'scrgb' + HSV: str = 'hsv' + OKLAB: str = 'oklab' + OKLCH: str = 'oklch' + +class Kernel: + NEAREST: str = 'nearest' + LINEAR: str = 'linear' + CUBIC: str = 'cubic' + MITCHELL: str = 'mitchell' + LANCZOS2: str = 'lanczos2' + LANCZOS3: str = 'lanczos3' + MKS2013: str = 'mks2013' + MKS2021: str = 'mks2021' + +class OperationBoolean: + AND: str = 'and' + OR: str = 'or' + EOR: str = 'eor' + LSHIFT: str = 'lshift' + RSHIFT: str = 'rshift' +class OperationComplex: + POLAR: str = 'polar' + RECT: str = 'rect' + CONJ: str = 'conj' + +class OperationComplex2: + CROSS_PHASE: str = 'cross-phase' + +class OperationComplexget: + REAL: str = 'real' + IMAG: str = 'imag' + +class OperationMath: + SIN: str = 'sin' + COS: str = 'cos' + TAN: str = 'tan' + ASIN: str = 'asin' + ACOS: str = 'acos' + ATAN: str = 'atan' + LOG: str = 'log' + LOG10: str = 'log10' + EXP: str = 'exp' + EXP10: str = 'exp10' + SINH: str = 'sinh' + COSH: str = 'cosh' + TANH: str = 'tanh' + ASINH: str = 'asinh' + ACOSH: str = 'acosh' + ATANH: str = 'atanh' + +class OperationMath2: + POW: str = 'pow' + WOP: str = 'wop' + ATAN2: str = 'atan2' + +class OperationMorphology: + ERODE: str = 'erode' + DILATE: str = 'dilate' + +class OperationRelational: + EQUAL: str = 'equal' + NOTEQ: str = 'noteq' + LESS: str = 'less' + LESSEQ: str = 'lesseq' + MORE: str = 'more' + MOREEQ: str = 'moreeq' + +class OperationRound: + RINT: str = 'rint' + CEIL: str = 'ceil' + FLOOR: str = 'floor' + +class PCS: + LAB: str = 'lab' + XYZ: str = 'xyz' + +class Precision: + INTEGER: str = 'integer' + FLOAT: str = 'float' + APPROXIMATE: str = 'approximate' + +class RegionShrink: + MEAN: str = 'mean' + MEDIAN: str = 'median' + MODE: str = 'mode' + MAX: str = 'max' + MIN: str = 'min' + NEAREST: str = 'nearest' + +class SdfShape: + CIRCLE: str = 'circle' + BOX: str = 'box' + ROUNDED_BOX: str = 'rounded-box' + LINE: str = 'line' + +class Size: + BOTH: str = 'both' + UP: str = 'up' + DOWN: str = 'down' + FORCE: str = 'force' + +class TextWrap: + WORD: str = 'word' + CHAR: str = 'char' + WORD_CHAR: str = 'word-char' + NONE: str = 'none' class Image(VipsObject): """Wrap a VipsImage object.""" @@ -152,13 +449,13 @@ class Image(VipsObject): # Constructors @staticmethod - def new_from_file(vips_filename: str, **kwargs: object) -> Image: ... + def new_from_file(vips_filename: str | Path, **kwargs: object) -> Image: ... @staticmethod def new_from_buffer(data: Union[bytes, bytearray, memoryview], options: str, **kwargs: object) -> Image: ... @staticmethod def new_from_list(array: List[List[float]], scale: float =1.0, offset: float = 0.0) -> Image: ... @classmethod - def new_from_array(cls, obj: Union[List, bytes, bytearray, memoryview], scale: float = 1.0, offset: float = 0.0, interpretation: Optional[Union[str, Interpretation]] = None) -> Image: ... + def new_from_array(cls, obj: Union[List[List[float]], bytes, bytearray, memoryview], scale: float = 1.0, offset: float = 0.0, interpretation: Optional[Union[str, Interpretation]] = None) -> Image: ... @staticmethod def new_from_memory(data: Union[bytes, bytearray, memoryview], width: int, height: int, bands: int, format: Union[str, BandFormat]) -> Image: ... @staticmethod @@ -169,7 +466,7 @@ class Image(VipsObject): def copy_memory(self) -> Image: ... # Writers - def write_to_file(self, vips_filename: str, **kwargs: object) -> None: ... + def write_to_file(self, vips_filename: str | Path, **kwargs: object) -> None: ... def write_to_buffer(self, format_string: str, **kwargs: object) -> bytes: ... def write_to_target(self, target: Target, format_string: str, **kwargs: object) -> None: ... def write_to_memory(self) -> bytes: ... @@ -218,8 +515,12 @@ class Image(VipsObject): def LabQ2sRGB(self) -> Image: ... def LabS2Lab(self) -> Image: ... def LabS2LabQ(self) -> Image: ... + def Oklab2Oklch(self) -> Image: ... + def Oklab2XYZ(self) -> Image: ... + def Oklch2Oklab(self) -> Image: ... def XYZ2CMYK(self) -> Image: ... def XYZ2Lab(self, temp: list[float] = ...) -> Image: ... + def XYZ2Oklab(self) -> Image: ... def XYZ2Yxy(self) -> Image: ... def XYZ2scRGB(self) -> Image: ... def Yxy2XYZ(self) -> Image: ... @@ -228,7 +529,7 @@ class Image(VipsObject): def addalpha(self) -> Image: ... def affine(self, matrix: list[float], interpolate: GObject = ..., oarea: list[int] = ..., odx: float = ..., ody: float = ..., idx: float = ..., idy: float = ..., background: list[float] = ..., premultiplied: bool = ..., extend: Union[str, Extend] = ...) -> Image: ... @staticmethod - def analyzeload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def analyzeload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def arrayjoin(in_: list[Image], across: int = ..., shim: int = ..., background: list[float] = ..., halign: Union[str, Align] = ..., valign: Union[str, Align] = ..., hspacing: int = ..., vspacing: int = ...) -> Image: ... def autorot(self, angle: bool = ..., flip: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @@ -264,14 +565,20 @@ class Image(VipsObject): def countlines(self, direction: Union[str, Direction]) -> float: ... def crop(self, left: int, top: int, width: int, height: int) -> Image: ... @staticmethod - def csvload(filename: str, skip: int = ..., lines: int = ..., whitespace: str = ..., separator: str = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def csvload(filename: str | Path, skip: int = ..., lines: int = ..., whitespace: str = ..., separator: str = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def csvload_source(source: Source, skip: int = ..., lines: int = ..., whitespace: str = ..., separator: str = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def csvsave(self, filename: str, separator: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def csvsave_target(self, target: Target, separator: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def csvsave(self, filename: str | Path, separator: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def csvsave_target(self, target: Target, separator: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def dE00(self, right: Image) -> Image: ... def dE76(self, right: Image) -> Image: ... def dECMC(self, right: Image) -> Image: ... + @staticmethod + def dcrawload(filename: str | Path, bitdepth: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + @staticmethod + def dcrawload_buffer(buffer: bytes, bitdepth: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + @staticmethod + def dcrawload_source(source: Source, bitdepth: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... def deviate(self) -> float: ... def divide(self, right: Image) -> Image: ... def draw_circle(self, ink: list[float], cx: int, cy: int, radius: int, fill: bool = ...) -> Image: ... @@ -281,9 +588,9 @@ class Image(VipsObject): def draw_mask(self, ink: list[float], mask: Image, x: int, y: int) -> Image: ... def draw_rect(self, ink: list[float], left: int, top: int, width: int, height: int, fill: bool = ...) -> Image: ... def draw_smudge(self, left: int, top: int, width: int, height: int) -> Image: ... - def dzsave(self, filename: str, imagename: str = ..., layout: Union[str, ForeignDzLayout] = ..., suffix: str = ..., overlap: int = ..., tile_size: int = ..., centre: bool = ..., depth: Union[str, ForeignDzDepth] = ..., angle: Union[str, Angle] = ..., container: Union[str, ForeignDzContainer] = ..., compression: int = ..., region_shrink: Union[str, RegionShrink] = ..., skip_blanks: int = ..., id: str = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def dzsave_buffer(self, imagename: str = ..., layout: Union[str, ForeignDzLayout] = ..., suffix: str = ..., overlap: int = ..., tile_size: int = ..., centre: bool = ..., depth: Union[str, ForeignDzDepth] = ..., angle: Union[str, Angle] = ..., container: Union[str, ForeignDzContainer] = ..., compression: int = ..., region_shrink: Union[str, RegionShrink] = ..., skip_blanks: int = ..., id: str = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def dzsave_target(self, target: Target, imagename: str = ..., layout: Union[str, ForeignDzLayout] = ..., suffix: str = ..., overlap: int = ..., tile_size: int = ..., centre: bool = ..., depth: Union[str, ForeignDzDepth] = ..., angle: Union[str, Angle] = ..., container: Union[str, ForeignDzContainer] = ..., compression: int = ..., region_shrink: Union[str, RegionShrink] = ..., skip_blanks: int = ..., id: str = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def dzsave(self, filename: str | Path, imagename: str = ..., layout: Union[str, ForeignDzLayout] = ..., suffix: str = ..., overlap: int = ..., tile_size: int = ..., centre: bool = ..., depth: Union[str, ForeignDzDepth] = ..., angle: Union[str, Angle] = ..., container: Union[str, ForeignDzContainer] = ..., compression: int = ..., region_shrink: Union[str, RegionShrink] = ..., skip_blanks: int = ..., id: str = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def dzsave_buffer(self, imagename: str = ..., layout: Union[str, ForeignDzLayout] = ..., suffix: str = ..., overlap: int = ..., tile_size: int = ..., centre: bool = ..., depth: Union[str, ForeignDzDepth] = ..., angle: Union[str, Angle] = ..., container: Union[str, ForeignDzContainer] = ..., compression: int = ..., region_shrink: Union[str, RegionShrink] = ..., skip_blanks: int = ..., id: str = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def dzsave_target(self, target: Target, imagename: str = ..., layout: Union[str, ForeignDzLayout] = ..., suffix: str = ..., overlap: int = ..., tile_size: int = ..., centre: bool = ..., depth: Union[str, ForeignDzDepth] = ..., angle: Union[str, Angle] = ..., container: Union[str, ForeignDzContainer] = ..., compression: int = ..., region_shrink: Union[str, RegionShrink] = ..., skip_blanks: int = ..., id: str = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def embed(self, x: int, y: int, width: int, height: int, extend: Union[str, Extend] = ..., background: list[float] = ...) -> Image: ... def extract_area(self, left: int, top: int, width: int, height: int) -> Image: ... def extract_band(self, band: int, n: int = ...) -> Image: ... @@ -294,10 +601,10 @@ class Image(VipsObject): def fill_nearest(self, distance: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... def find_trim(self, threshold: float = ..., background: list[float] = ..., line_art: bool = ...) -> tuple[int, int, int, int]: ... @staticmethod - def fitsload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def fitsload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def fitsload_source(source: Source, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def fitssave(self, filename: str, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def fitssave(self, filename: str | Path, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def flatten(self, background: list[float] = ..., max_alpha: float = ...) -> Image: ... def flip(self, direction: Union[str, Direction]) -> Image: ... def float2rad(self) -> Image: ... @@ -313,28 +620,28 @@ class Image(VipsObject): def gaussnoise(width: int, height: int, sigma: float = ..., mean: float = ..., seed: int = ...) -> Image: ... def getpoint(self, x: int, y: int, unpack_complex: bool = ...) -> list[float]: ... @staticmethod - def gifload(filename: str, n: int = ..., page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def gifload(filename: str | Path, n: int = ..., page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def gifload_buffer(buffer: str, n: int = ..., page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def gifload_buffer(buffer: bytes, n: int = ..., page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def gifload_source(source: Source, n: int = ..., page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def gifsave(self, filename: str, dither: float = ..., effort: int = ..., bitdepth: int = ..., interframe_maxerror: float = ..., reuse: bool = ..., interpalette_maxerror: float = ..., interlace: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def gifsave_buffer(self, dither: float = ..., effort: int = ..., bitdepth: int = ..., interframe_maxerror: float = ..., reuse: bool = ..., interpalette_maxerror: float = ..., interlace: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def gifsave_target(self, target: Target, dither: float = ..., effort: int = ..., bitdepth: int = ..., interframe_maxerror: float = ..., reuse: bool = ..., interpalette_maxerror: float = ..., interlace: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def gifsave(self, filename: str | Path, dither: float = ..., effort: int = ..., bitdepth: int = ..., interframe_maxerror: float = ..., reuse: bool = ..., interpalette_maxerror: float = ..., interlace: bool = ..., keep_duplicate_frames: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def gifsave_buffer(self, dither: float = ..., effort: int = ..., bitdepth: int = ..., interframe_maxerror: float = ..., reuse: bool = ..., interpalette_maxerror: float = ..., interlace: bool = ..., keep_duplicate_frames: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def gifsave_target(self, target: Target, dither: float = ..., effort: int = ..., bitdepth: int = ..., interframe_maxerror: float = ..., reuse: bool = ..., interpalette_maxerror: float = ..., interlace: bool = ..., keep_duplicate_frames: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def globalbalance(self, gamma: float = ..., int_output: bool = ...) -> Image: ... def gravity(self, direction: Union[str, CompassDirection], width: int, height: int, extend: Union[str, Extend] = ..., background: list[float] = ...) -> Image: ... @staticmethod def grey(width: int, height: int, uchar: bool = ...) -> Image: ... def grid(self, tile_height: int, across: int, down: int) -> Image: ... @staticmethod - def heifload(filename: str, page: int = ..., n: int = ..., thumbnail: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def heifload(filename: str | Path, page: int = ..., n: int = ..., thumbnail: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def heifload_buffer(buffer: str, page: int = ..., n: int = ..., thumbnail: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def heifload_buffer(buffer: bytes, page: int = ..., n: int = ..., thumbnail: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def heifload_source(source: Source, page: int = ..., n: int = ..., thumbnail: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def heifsave(self, filename: str, Q: int = ..., bitdepth: int = ..., lossless: bool = ..., compression: Union[str, ForeignHeifCompression] = ..., effort: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., encoder: Union[str, ForeignHeifEncoder] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def heifsave_buffer(self, Q: int = ..., bitdepth: int = ..., lossless: bool = ..., compression: Union[str, ForeignHeifCompression] = ..., effort: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., encoder: Union[str, ForeignHeifEncoder] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def heifsave_target(self, target: Target, Q: int = ..., bitdepth: int = ..., lossless: bool = ..., compression: Union[str, ForeignHeifCompression] = ..., effort: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., encoder: Union[str, ForeignHeifEncoder] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def heifsave(self, filename: str | Path, Q: int = ..., bitdepth: int = ..., lossless: bool = ..., compression: Union[str, ForeignHeifCompression] = ..., effort: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., encoder: Union[str, ForeignHeifEncoder] = ..., tune: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def heifsave_buffer(self, Q: int = ..., bitdepth: int = ..., lossless: bool = ..., compression: Union[str, ForeignHeifCompression] = ..., effort: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., encoder: Union[str, ForeignHeifEncoder] = ..., tune: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def heifsave_target(self, target: Target, Q: int = ..., bitdepth: int = ..., lossless: bool = ..., compression: Union[str, ForeignHeifCompression] = ..., effort: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., encoder: Union[str, ForeignHeifEncoder] = ..., tune: str = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def hist_cum(self) -> Image: ... def hist_entropy(self) -> float: ... def hist_equal(self, band: int = ...) -> Image: ... @@ -348,9 +655,9 @@ class Image(VipsObject): def hist_plot(self) -> Image: ... def hough_circle(self, scale: int = ..., min_radius: int = ..., max_radius: int = ...) -> Image: ... def hough_line(self, width: int = ..., height: int = ...) -> Image: ... - def icc_export(self, pcs: Union[str, PCS] = ..., intent: Union[str, Intent] = ..., black_point_compensation: bool = ..., output_profile: str = ..., depth: int = ...) -> Image: ... - def icc_import(self, pcs: Union[str, PCS] = ..., intent: Union[str, Intent] = ..., black_point_compensation: bool = ..., embedded: bool = ..., input_profile: str = ...) -> Image: ... - def icc_transform(self, output_profile: str, pcs: Union[str, PCS] = ..., intent: Union[str, Intent] = ..., black_point_compensation: bool = ..., embedded: bool = ..., input_profile: str = ..., depth: int = ...) -> Image: ... + def icc_export(self, pcs: Union[str, PCS] = ..., intent: Union[str, Intent] = ..., black_point_compensation: bool = ..., output_profile: str | Path = ..., depth: int = ...) -> Image: ... + def icc_import(self, pcs: Union[str, PCS] = ..., intent: Union[str, Intent] = ..., black_point_compensation: bool = ..., embedded: bool = ..., input_profile: str | Path = ...) -> Image: ... + def icc_transform(self, output_profile: str | Path, pcs: Union[str, PCS] = ..., intent: Union[str, Intent] = ..., black_point_compensation: bool = ..., embedded: bool = ..., input_profile: str | Path = ..., depth: int = ...) -> Image: ... @staticmethod def identity(bands: int = ..., ushort: bool = ..., size: int = ...) -> Image: ... def insert(self, sub: Image, x: int, y: int, expand: bool = ..., background: list[float] = ...) -> Image: ... @@ -359,44 +666,46 @@ class Image(VipsObject): def invfft(self, real: bool = ...) -> Image: ... def join(self, in2: Image, direction: Union[str, Direction], expand: bool = ..., shim: int = ..., background: list[float] = ..., align: Union[str, Align] = ...) -> Image: ... @staticmethod - def jp2kload(filename: str, page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jp2kload(filename: str | Path, page: int = ..., oneshot: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def jp2kload_buffer(buffer: str, page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jp2kload_buffer(buffer: bytes, page: int = ..., oneshot: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def jp2kload_source(source: Source, page: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def jp2ksave(self, filename: str, tile_width: int = ..., tile_height: int = ..., lossless: bool = ..., Q: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def jp2ksave_buffer(self, tile_width: int = ..., tile_height: int = ..., lossless: bool = ..., Q: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def jp2ksave_target(self, target: Target, tile_width: int = ..., tile_height: int = ..., lossless: bool = ..., Q: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def jp2kload_source(source: Source, page: int = ..., oneshot: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jp2ksave(self, filename: str | Path, tile_width: int = ..., tile_height: int = ..., lossless: bool = ..., Q: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def jp2ksave_buffer(self, tile_width: int = ..., tile_height: int = ..., lossless: bool = ..., Q: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def jp2ksave_target(self, target: Target, tile_width: int = ..., tile_height: int = ..., lossless: bool = ..., Q: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... @staticmethod - def jpegload(filename: str, shrink: int = ..., autorotate: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jpegload(filename: str | Path, shrink: int = ..., autorotate: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def jpegload_buffer(buffer: str, shrink: int = ..., autorotate: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jpegload_buffer(buffer: bytes, shrink: int = ..., autorotate: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def jpegload_source(source: Source, shrink: int = ..., autorotate: bool = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def jpegsave(self, filename: str, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def jpegsave_buffer(self, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def jpegsave_mime(self, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def jpegsave_target(self, target: Target, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def jpegsave(self, filename: str | Path, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def jpegsave_buffer(self, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def jpegsave_mime(self, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def jpegsave_target(self, target: Target, Q: int = ..., optimize_coding: bool = ..., interlace: bool = ..., trellis_quant: bool = ..., overshoot_deringing: bool = ..., optimize_scans: bool = ..., quant_table: int = ..., subsample_mode: Union[str, ForeignSubsample] = ..., restart_interval: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... @staticmethod - def jxlload(filename: str, page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jxlload(filename: str | Path, page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def jxlload_buffer(buffer: str, page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def jxlload_buffer(buffer: bytes, page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def jxlload_source(source: Source, page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def jxlsave(self, filename: str, tier: int = ..., distance: float = ..., effort: int = ..., lossless: bool = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def jxlsave_buffer(self, tier: int = ..., distance: float = ..., effort: int = ..., lossless: bool = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def jxlsave_target(self, target: Target, tier: int = ..., distance: float = ..., effort: int = ..., lossless: bool = ..., Q: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def jxlsave(self, filename: str | Path, tier: int = ..., distance: float = ..., effort: int = ..., lossless: bool = ..., Q: int = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def jxlsave_buffer(self, tier: int = ..., distance: float = ..., effort: int = ..., lossless: bool = ..., Q: int = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def jxlsave_target(self, target: Target, tier: int = ..., distance: float = ..., effort: int = ..., lossless: bool = ..., Q: int = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def labelregions(self, segments: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... def linear(self, a: list[float], b: list[float], uchar: bool = ...) -> Image: ... def linecache(self, tile_height: int = ..., access: Union[str, Access] = ..., threaded: bool = ..., persistent: bool = ...) -> Image: ... @staticmethod def logmat(sigma: float, min_ampl: float, separable: bool = ..., precision: Union[str, Precision] = ...) -> Image: ... @staticmethod - def magickload(filename: str, density: str = ..., page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def magickload(filename: str | Path, density: str = ..., page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def magickload_buffer(buffer: str, density: str = ..., page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def magicksave(self, filename: str, format: str = ..., quality: int = ..., optimize_gif_frames: bool = ..., optimize_gif_transparency: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def magicksave_buffer(self, format: str = ..., quality: int = ..., optimize_gif_frames: bool = ..., optimize_gif_transparency: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... + def magickload_buffer(buffer: bytes, density: str = ..., page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + @staticmethod + def magickload_source(source: Source, density: str = ..., page: int = ..., n: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def magicksave(self, filename: str | Path, format: str = ..., quality: int = ..., optimize_gif_frames: bool = ..., optimize_gif_transparency: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def magicksave_buffer(self, format: str = ..., quality: int = ..., optimize_gif_frames: bool = ..., optimize_gif_transparency: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... def mapim(self, index: Image, interpolate: GObject = ..., background: list[float] = ..., premultiplied: bool = ..., extend: Union[str, Extend] = ...) -> Image: ... def maplut(self, lut: Image, band: int = ...) -> Image: ... @staticmethod @@ -424,15 +733,16 @@ class Image(VipsObject): def math2(self, right: Image, math2: Union[str, OperationMath2]) -> Image: ... def math2_const(self, math2: Union[str, OperationMath2], c: list[float]) -> Image: ... @staticmethod - def matload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def matload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... def matrixinvert(self) -> Image: ... @staticmethod - def matrixload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def matrixload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def matrixload_source(source: Source, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def matrixprint(self, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def matrixsave(self, filename: str, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def matrixsave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def matrixmultiply(self, right: Image) -> Image: ... + def matrixprint(self, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def matrixsave(self, filename: str | Path, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def matrixsave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def max(self, size: int = ..., x: bool = ..., y: bool = ..., out_array: bool = ..., x_array: bool = ..., y_array: bool = ...) -> Union[float, tuple[float, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... def maxpair(self, right: Image) -> Image: ... def measure(self, h: int, v: int, left: int = ..., top: int = ..., width: int = ..., height: int = ...) -> Image: ... @@ -445,59 +755,61 @@ class Image(VipsObject): def msb(self, band: int = ...) -> Image: ... def multiply(self, right: Image) -> Image: ... @staticmethod - def openexrload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def openexrload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def openslideload(filename: str, level: int = ..., autocrop: bool = ..., associated: str = ..., attach_associated: bool = ..., rgb: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def openslideload(filename: str | Path, level: int = ..., autocrop: bool = ..., associated: str = ..., attach_associated: bool = ..., rgb: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def openslideload_source(source: Source, level: int = ..., autocrop: bool = ..., associated: str = ..., attach_associated: bool = ..., rgb: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def pdfload(filename: str, page: int = ..., n: int = ..., dpi: float = ..., scale: float = ..., background: list[float] = ..., password: str = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def pdfload(filename: str | Path, page: int = ..., n: int = ..., dpi: float = ..., scale: float = ..., background: list[float] = ..., password: str = ..., page_box: Union[str, ForeignPdfPageBox] = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def pdfload_buffer(buffer: str, page: int = ..., n: int = ..., dpi: float = ..., scale: float = ..., background: list[float] = ..., password: str = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def pdfload_buffer(buffer: bytes, page: int = ..., n: int = ..., dpi: float = ..., scale: float = ..., background: list[float] = ..., password: str = ..., page_box: Union[str, ForeignPdfPageBox] = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def pdfload_source(source: Source, page: int = ..., n: int = ..., dpi: float = ..., scale: float = ..., background: list[float] = ..., password: str = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def pdfload_source(source: Source, page: int = ..., n: int = ..., dpi: float = ..., scale: float = ..., background: list[float] = ..., password: str = ..., page_box: Union[str, ForeignPdfPageBox] = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... def percent(self, percent: float) -> int: ... @staticmethod def perlin(width: int, height: int, cell_size: int = ..., uchar: bool = ..., seed: int = ...) -> Image: ... def phasecor(self, in2: Image) -> Image: ... @staticmethod - def pngload(filename: str, unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def pngload(filename: str | Path, unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def pngload_buffer(buffer: str, unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def pngload_buffer(buffer: bytes, unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def pngload_source(source: Source, unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def pngsave(self, filename: str, compression: int = ..., interlace: bool = ..., filter: int = ..., palette: bool = ..., Q: int = ..., dither: float = ..., bitdepth: int = ..., effort: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def pngsave_buffer(self, compression: int = ..., interlace: bool = ..., filter: int = ..., palette: bool = ..., Q: int = ..., dither: float = ..., bitdepth: int = ..., effort: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def pngsave_target(self, target: Target, compression: int = ..., interlace: bool = ..., filter: int = ..., palette: bool = ..., Q: int = ..., dither: float = ..., bitdepth: int = ..., effort: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def pngsave(self, filename: str | Path, compression: int = ..., interlace: bool = ..., filter: int = ..., palette: bool = ..., Q: int = ..., dither: float = ..., bitdepth: int = ..., effort: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def pngsave_buffer(self, compression: int = ..., interlace: bool = ..., filter: int = ..., palette: bool = ..., Q: int = ..., dither: float = ..., bitdepth: int = ..., effort: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def pngsave_target(self, target: Target, compression: int = ..., interlace: bool = ..., filter: int = ..., palette: bool = ..., Q: int = ..., dither: float = ..., bitdepth: int = ..., effort: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + @staticmethod + def ppmload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def ppmload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def ppmload_buffer(buffer: bytes, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def ppmload_source(source: Source, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def ppmsave(self, filename: str, format: Union[str, ForeignPpmFormat] = ..., ascii: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def ppmsave_target(self, target: Target, format: Union[str, ForeignPpmFormat] = ..., ascii: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def ppmsave(self, filename: str | Path, format: Union[str, ForeignPpmFormat] = ..., ascii: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def ppmsave_target(self, target: Target, format: Union[str, ForeignPpmFormat] = ..., ascii: bool = ..., bitdepth: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def premultiply(self, max_alpha: float = ...) -> Image: ... def prewitt(self) -> Image: ... def profile(self) -> tuple[Image, Image]: ... @staticmethod - def profile_load(name: str) -> str: ... + def profile_load(name: str) -> bytes: ... def project(self) -> tuple[Image, Image]: ... def quadratic(self, coeff: Image, interpolate: GObject = ...) -> Image: ... def rad2float(self) -> Image: ... @staticmethod - def radload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def radload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def radload_buffer(buffer: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def radload_buffer(buffer: bytes, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def radload_source(source: Source, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def radsave(self, filename: str, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def radsave_buffer(self, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def radsave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def radsave(self, filename: str | Path, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def radsave_buffer(self, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def radsave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def rank(self, width: int, height: int, index: int) -> Image: ... @staticmethod - def rawload(filename: str, width: int, height: int, bands: int, offset: int = ..., format: Union[str, BandFormat] = ..., interpretation: Union[str, Interpretation] = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def rawsave(self, filename: str, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def rawsave_buffer(self, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def rawsave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def rawload(filename: str | Path, width: int, height: int, bands: int, offset: int = ..., format: Union[str, BandFormat] = ..., interpretation: Union[str, Interpretation] = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def rawsave(self, filename: str | Path, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def rawsave_buffer(self, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def rawsave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def recomb(self, m: Image) -> Image: ... def reduce(self, hshrink: float, vshrink: float, kernel: Union[str, Kernel] = ..., gap: float = ...) -> Image: ... def reduceh(self, hshrink: float, kernel: Union[str, Kernel] = ..., gap: float = ...) -> Image: ... @@ -506,6 +818,7 @@ class Image(VipsObject): def relational_const(self, relational: Union[str, OperationRelational], c: list[float]) -> Image: ... def remainder(self, right: Image) -> Image: ... def remainder_const(self, c: list[float]) -> Image: ... + def remosaic(self, old_str: str, new_str: str) -> Image: ... def replicate(self, across: int, down: int) -> Image: ... def resize(self, scale: float, kernel: Union[str, Kernel] = ..., gap: float = ..., vscale: float = ...) -> Image: ... def rot(self, angle: Union[str, Angle]) -> Image: ... @@ -540,54 +853,64 @@ class Image(VipsObject): @staticmethod def sum(in_: list[Image]) -> Image: ... @staticmethod - def svgload(filename: str, dpi: float = ..., scale: float = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def svgload(filename: str | Path, dpi: float = ..., scale: float = ..., unlimited: bool = ..., stylesheet: str = ..., high_bitdepth: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def svgload_buffer(buffer: str, dpi: float = ..., scale: float = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def svgload_buffer(buffer: bytes, dpi: float = ..., scale: float = ..., unlimited: bool = ..., stylesheet: str = ..., high_bitdepth: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def svgload_source(source: Source, dpi: float = ..., scale: float = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def svgload_source(source: Source, dpi: float = ..., scale: float = ..., unlimited: bool = ..., stylesheet: str = ..., high_bitdepth: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def switch(tests: list[Image]) -> Image: ... @staticmethod - def system(cmd_format: str, in_: list[Image] = ..., out_format: str = ..., in_format: str = ..., out: bool = ..., log: bool = ...) -> Union[None, tuple[Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def system(cmd_format: str, in_: list[Image] = ..., in_format: str = ..., out_format: str = ..., cache: bool = ..., out: bool = ..., log: bool = ...) -> Union[None, tuple[Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def text(text: str, font: str = ..., width: int = ..., height: int = ..., align: Union[str, Align] = ..., justify: bool = ..., dpi: int = ..., spacing: int = ..., fontfile: str = ..., rgba: bool = ..., wrap: Union[str, TextWrap] = ..., autofit_dpi: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def thumbnail(filename: str, width: int, height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., import_profile: str = ..., export_profile: str = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... + def thumbnail(filename: str | Path, width: int, height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., input_profile: str | Path = ..., output_profile: str | Path = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... @staticmethod - def thumbnail_buffer(buffer: str, width: int, option_string: str = ..., height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., import_profile: str = ..., export_profile: str = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... - def thumbnail_image(self, width: int, height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., import_profile: str = ..., export_profile: str = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... + def thumbnail_buffer(buffer: bytes, width: int, option_string: str = ..., height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., input_profile: str | Path = ..., output_profile: str | Path = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... + def thumbnail_image(self, width: int, height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., input_profile: str | Path = ..., output_profile: str | Path = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... @staticmethod - def thumbnail_source(source: Source, width: int, option_string: str = ..., height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., import_profile: str = ..., export_profile: str = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... + def thumbnail_source(source: Source, width: int, option_string: str = ..., height: int = ..., size: Union[str, Size] = ..., no_rotate: bool = ..., crop: Union[str, Interesting] = ..., linear: bool = ..., input_profile: str | Path = ..., output_profile: str | Path = ..., intent: Union[str, Intent] = ..., fail_on: Union[str, FailOn] = ...) -> Image: ... @staticmethod - def tiffload(filename: str, page: int = ..., subifd: int = ..., n: int = ..., autorotate: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def tiffload(filename: str | Path, page: int = ..., n: int = ..., autorotate: bool = ..., subifd: int = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def tiffload_buffer(buffer: str, page: int = ..., subifd: int = ..., n: int = ..., autorotate: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def tiffload_buffer(buffer: bytes, page: int = ..., n: int = ..., autorotate: bool = ..., subifd: int = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def tiffload_source(source: Source, page: int = ..., subifd: int = ..., n: int = ..., autorotate: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def tiffsave(self, filename: str, compression: Union[str, ForeignTiffCompression] = ..., Q: int = ..., predictor: Union[str, ForeignTiffPredictor] = ..., tile: bool = ..., tile_width: int = ..., tile_height: int = ..., pyramid: bool = ..., miniswhite: bool = ..., bitdepth: int = ..., resunit: Union[str, ForeignTiffResunit] = ..., xres: float = ..., yres: float = ..., bigtiff: bool = ..., properties: bool = ..., region_shrink: Union[str, RegionShrink] = ..., level: int = ..., lossless: bool = ..., depth: Union[str, ForeignDzDepth] = ..., subifd: bool = ..., premultiply: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def tiffsave_buffer(self, compression: Union[str, ForeignTiffCompression] = ..., Q: int = ..., predictor: Union[str, ForeignTiffPredictor] = ..., tile: bool = ..., tile_width: int = ..., tile_height: int = ..., pyramid: bool = ..., miniswhite: bool = ..., bitdepth: int = ..., resunit: Union[str, ForeignTiffResunit] = ..., xres: float = ..., yres: float = ..., bigtiff: bool = ..., properties: bool = ..., region_shrink: Union[str, RegionShrink] = ..., level: int = ..., lossless: bool = ..., depth: Union[str, ForeignDzDepth] = ..., subifd: bool = ..., premultiply: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def tiffsave_target(self, target: Target, compression: Union[str, ForeignTiffCompression] = ..., Q: int = ..., predictor: Union[str, ForeignTiffPredictor] = ..., tile: bool = ..., tile_width: int = ..., tile_height: int = ..., pyramid: bool = ..., miniswhite: bool = ..., bitdepth: int = ..., resunit: Union[str, ForeignTiffResunit] = ..., xres: float = ..., yres: float = ..., bigtiff: bool = ..., properties: bool = ..., region_shrink: Union[str, RegionShrink] = ..., level: int = ..., lossless: bool = ..., depth: Union[str, ForeignDzDepth] = ..., subifd: bool = ..., premultiply: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def tiffload_source(source: Source, page: int = ..., n: int = ..., autorotate: bool = ..., subifd: int = ..., unlimited: bool = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def tiffsave(self, filename: str | Path, compression: Union[str, ForeignTiffCompression] = ..., Q: int = ..., predictor: Union[str, ForeignTiffPredictor] = ..., tile: bool = ..., tile_width: int = ..., tile_height: int = ..., pyramid: bool = ..., miniswhite: bool = ..., bitdepth: int = ..., resunit: Union[str, ForeignTiffResunit] = ..., xres: float = ..., yres: float = ..., bigtiff: bool = ..., properties: bool = ..., region_shrink: Union[str, RegionShrink] = ..., level: int = ..., lossless: bool = ..., depth: Union[str, ForeignDzDepth] = ..., subifd: bool = ..., premultiply: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def tiffsave_buffer(self, compression: Union[str, ForeignTiffCompression] = ..., Q: int = ..., predictor: Union[str, ForeignTiffPredictor] = ..., tile: bool = ..., tile_width: int = ..., tile_height: int = ..., pyramid: bool = ..., miniswhite: bool = ..., bitdepth: int = ..., resunit: Union[str, ForeignTiffResunit] = ..., xres: float = ..., yres: float = ..., bigtiff: bool = ..., properties: bool = ..., region_shrink: Union[str, RegionShrink] = ..., level: int = ..., lossless: bool = ..., depth: Union[str, ForeignDzDepth] = ..., subifd: bool = ..., premultiply: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def tiffsave_target(self, target: Target, compression: Union[str, ForeignTiffCompression] = ..., Q: int = ..., predictor: Union[str, ForeignTiffPredictor] = ..., tile: bool = ..., tile_width: int = ..., tile_height: int = ..., pyramid: bool = ..., miniswhite: bool = ..., bitdepth: int = ..., resunit: Union[str, ForeignTiffResunit] = ..., xres: float = ..., yres: float = ..., bigtiff: bool = ..., properties: bool = ..., region_shrink: Union[str, RegionShrink] = ..., level: int = ..., lossless: bool = ..., depth: Union[str, ForeignDzDepth] = ..., subifd: bool = ..., premultiply: bool = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def tilecache(self, tile_width: int = ..., tile_height: int = ..., max_tiles: int = ..., access: Union[str, Access] = ..., threaded: bool = ..., persistent: bool = ...) -> Image: ... @staticmethod def tonelut(in_max: int = ..., out_max: int = ..., Lb: float = ..., Lw: float = ..., Ps: float = ..., Pm: float = ..., Ph: float = ..., S: float = ..., M: float = ..., H: float = ...) -> Image: ... def transpose3d(self, page_height: int = ...) -> Image: ... + def uhdr2scRGB(self) -> Image: ... + @staticmethod + def uhdrload(filename: str | Path, shrink: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + @staticmethod + def uhdrload_buffer(buffer: bytes, shrink: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + @staticmethod + def uhdrload_source(source: Source, shrink: int = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def uhdrsave(self, filename: str | Path, Q: int = ..., gainmap_scale_factor: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def uhdrsave_buffer(self, Q: int = ..., gainmap_scale_factor: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def uhdrsave_target(self, target: Target, Q: int = ..., gainmap_scale_factor: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... def unpremultiply(self, max_alpha: float = ..., alpha_band: int = ...) -> Image: ... @staticmethod - def vipsload(filename: str, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def vipsload(filename: str | Path, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def vipsload_source(source: Source, memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def vipssave(self, filename: str, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def vipssave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def vipssave(self, filename: str | Path, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def vipssave_target(self, target: Target, keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... @staticmethod - def webpload(filename: str, page: int = ..., n: int = ..., scale: float = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def webpload(filename: str | Path, page: int = ..., n: int = ..., scale: float = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod - def webpload_buffer(buffer: str, page: int = ..., n: int = ..., scale: float = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... + def webpload_buffer(buffer: bytes, page: int = ..., n: int = ..., scale: float = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... @staticmethod def webpload_source(source: Source, page: int = ..., n: int = ..., scale: float = ..., memory: bool = ..., access: Union[str, Access] = ..., fail_on: Union[str, FailOn] = ..., revalidate: bool = ..., flags: bool = ...) -> Union[Image, tuple[Image, Dict[str, Union[bool, int, float, str, Image, list[int], list[float], list[Image]]]]]: ... - def webpsave(self, filename: str, Q: int = ..., lossless: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def webpsave_buffer(self, Q: int = ..., lossless: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> str: ... - def webpsave_mime(self, Q: int = ..., lossless: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... - def webpsave_target(self, target: Target, Q: int = ..., lossless: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str = ...) -> None: ... + def webpsave(self, filename: str | Path, Q: int = ..., lossless: bool = ..., exact: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def webpsave_buffer(self, Q: int = ..., lossless: bool = ..., exact: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> bytes: ... + def webpsave_mime(self, Q: int = ..., lossless: bool = ..., exact: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... + def webpsave_target(self, target: Target, Q: int = ..., lossless: bool = ..., exact: bool = ..., preset: Union[str, ForeignWebpPreset] = ..., smart_subsample: bool = ..., near_lossless: bool = ..., alpha_q: int = ..., min_size: bool = ..., kmin: int = ..., kmax: int = ..., effort: int = ..., target_size: int = ..., mixed: bool = ..., smart_deblock: bool = ..., passes: int = ..., keep: int = ..., background: list[float] = ..., page_height: int = ..., profile: str | Path = ...) -> None: ... @staticmethod def worley(width: int, height: int, cell_size: int = ..., seed: int = ...) -> Image: ... def wrap(self, x: int = ..., y: int = ...) -> Image: ... @@ -634,9 +957,44 @@ class Image(VipsObject): def __call__(self, x: int, y: int) -> List[float]: ... def __repr__(self) -> str: ... +class Operation(VipsObject): + @staticmethod + def new_from_name(operation_name: str) -> "Operation": ... + def set( + self, + name: str, + flags: int, + match_image: Optional[Image], + value: Any, + ) -> None: ... + @staticmethod + def call(operation_name: str, *args: Any, **kwargs: Any) -> Any: ... + @staticmethod + def generate_docstring(operation_name: str) -> str: ... + @staticmethod + def generate_sphinx(operation_name: str) -> str: ... + @staticmethod + def generate_sphinx_all() -> None: ... + +class Introspect(object): + description: str + flags: int + details: Dict[str, Dict[str, Any]] + + required_input: List[str] + optional_input: List[str] + required_output: List[str] + optional_output: List[str] -class Operation: ... -class Introspect: ... + doc_optional_input: List[str] + doc_optional_output: List[str] + + member_x: Optional[str] + method_args: List[str] + + def __init__(self, operation_name: str) -> None: ... + @classmethod + def get(cls: Type["Introspect"], operation_name: str) -> "Introspect": ... # Global functions def cache_set_max(mx: int) -> None: ... diff --git a/pyvips/gvalue.py b/pyvips/gvalue.py index 04069e8..6d53275 100644 --- a/pyvips/gvalue.py +++ b/pyvips/gvalue.py @@ -54,7 +54,7 @@ class GValue(object): _gtype_to_python = { gbool_type: 'bool', gint_type: 'int', - guint64_type: 'long', # Note: int and long are unified in Python 3 + guint64_type: 'int', gdouble_type: 'float', gstr_type: 'str', refstr_type: 'str', @@ -65,7 +65,7 @@ class GValue(object): array_int_type: 'list[int]', array_double_type: 'list[float]', array_image_type: 'list[Image]', - blob_type: 'str', + blob_type: 'bytes', source_type: 'Source', target_type: 'Target', } diff --git a/pyvips/voperation.py b/pyvips/voperation.py index 4d1b37d..3f6466e 100644 --- a/pyvips/voperation.py +++ b/pyvips/voperation.py @@ -337,6 +337,15 @@ def set_reference(x): return result + @staticmethod + def _argtype_to_python(name: str, type): + if ( + name in ("filename", "input_profile", "output_profile", "profile") + and type == GValue.gstr_type + ): + return "str | Path" + return GValue.gtype_to_python(type) + @staticmethod def generate_docstring(operation_name): """Make a google-style docstring. @@ -365,8 +374,10 @@ def generate_docstring(operation_name): args = [] args += intro.method_args - args += [x + '=' + GValue.gtype_to_python(intro.details[x]['type']) - for x in intro.doc_optional_input] + args += [ + x + '=' + Operation._argtype_to_python(x, intro.details[x]['type']) + for x in intro.doc_optional_input + ] args += [x + '=bool' for x in intro.doc_optional_output] result += ", ".join(args) + ')\n' @@ -375,7 +386,7 @@ def argstr(name): details = intro.details[name] return (u' {0} ({1}): {2}\n'. format(name, - GValue.gtype_to_python(details['type']), + Operation._argtype_to_python(name, details['type']), details['blurb'])) result += '\nReturns:\n' @@ -431,8 +442,10 @@ def generate_sphinx(operation_name): result = '.. staticmethod:: ' args = [] args += intro.method_args - args += [x + '=' + GValue.gtype_to_python(intro.details[x]['type']) - for x in doc_optional_input] + args += [ + x + '=' + Operation._argtype_to_python(x, intro.details[x]['type']) + for x in doc_optional_input + ] args += [x + '=bool' for x in intro.doc_optional_output] result += operation_name + '(' + ", ".join(args) + ')\n\n' @@ -450,23 +463,29 @@ def generate_sphinx(operation_name): result += 'pyvips.Image.' + operation_name + '(' args = [] args += intro.method_args - args += [x + '=' + GValue.gtype_to_python(intro.details[x]['type']) - for x in doc_optional_input] + args += [ + x + '=' + Operation._argtype_to_python(x, intro.details[x]['type']) + for x in doc_optional_input + ] result += ', '.join(args) result += ')\n\n' for name in intro.method_args + doc_optional_input: details = intro.details[name] result += f':param {name}: {details["blurb"]}\n' - result += (f':type {name}: ' - f'{GValue.gtype_to_python(details["type"])}\n') + result += ( + f':type {name}: ' + f'{Operation._argtype_to_python(name, details["type"])}\n' + ) for name in intro.doc_optional_output: result += (f':param {name}: ' f'enable output: {intro.details[name]["blurb"]}\n') result += f':type {name}: bool\n' - output_types = [GValue.gtype_to_python(intro.details[name]['type']) - for name in intro.required_output] + output_types = [ + Operation._argtype_to_python(name, intro.details[name]['type']) + for name in intro.required_output + ] if len(output_types) == 1: output_type = output_types[0] else: