diff --git a/README.rst b/README.rst index 75ddb1e..047a380 100644 --- a/README.rst +++ b/README.rst @@ -225,7 +225,7 @@ then .. code-block:: shell $ cd examples; \ - ./gen-enums.py ~/GIT/libvips/libvips/Vips-8.0.gir > enums.py + ./gen-enums.py ~/GIT/libvips/build/libvips/Vips-8.0.gir > enums.py Then check and move `enums.py` into `pyvips/`. diff --git a/doc/vimage.rst b/doc/vimage.rst index 3fb491c..3806112 100644 --- a/doc/vimage.rst +++ b/doc/vimage.rst @@ -111,6 +111,7 @@ Autogenerated methods ~Yxy2XYZ ~abs ~add + ~addalpha ~affine ~analyzeload ~arrayjoin @@ -126,10 +127,10 @@ Autogenerated methods ~boolean_const ~buildlut ~byteswap - ~cache ~canny ~case ~cast + ~clamp ~colourspace ~compass ~complex @@ -277,9 +278,11 @@ Autogenerated methods ~matrixsave ~matrixsave_target ~max + ~maxpair ~measure ~merge ~min + ~minpair ~morph ~mosaic ~mosaic1 @@ -323,7 +326,8 @@ Autogenerated methods ~rank ~rawload ~rawsave - ~rawsave_fd + ~rawsave_buffer + ~rawsave_target ~recomb ~reduce ~reduceh @@ -344,6 +348,7 @@ Autogenerated methods ~scRGB2XYZ ~scRGB2sRGB ~scharr + ~sdf ~sequential ~sharpen ~shrink @@ -615,6 +620,16 @@ Autogenerated methods :rtype: Image :raises Error: + .. method:: addalpha() + + Append an alpha channel. + + Example: + out = in.addalpha() + + :rtype: Image + :raises Error: + .. method:: affine(matrix, interpolate=GObject, oarea=list[int], odx=float, ody=float, idx=float, idy=float, background=list[float], premultiplied=bool, extend=Union[str, Extend]) Affine transform of an image. @@ -839,22 +854,6 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: cache(max_tiles=int, tile_height=int, tile_width=int) - - Cache an image. - - Example: - out = in.cache(max_tiles=int, tile_height=int, tile_width=int) - - :param max_tiles: Maximum number of tiles to cache - :type max_tiles: int - :param tile_height: Tile height in pixels - :type tile_height: int - :param tile_width: Tile width in pixels - :type tile_width: int - :rtype: Image - :raises Error: - .. method:: canny(sigma=float, precision=Union[str, Precision]) Canny edge detector. @@ -895,6 +894,20 @@ Autogenerated methods :rtype: Image :raises Error: + .. method:: clamp(min=float, max=float) + + Clamp values of an image. + + Example: + out = in.clamp(min=float, max=float) + + :param min: Minimum value + :type min: float + :param max: Maximum value + :type max: float + :rtype: Image + :raises Error: + .. method:: colourspace(space, source_space=Union[str, Interpretation]) Convert to a new colorspace. @@ -1237,17 +1250,15 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: csvsave(filename, profile=str, separator=str, keep=int, background=list[float], page_height=int) + .. method:: csvsave(filename, separator=str, keep=int, background=list[float], page_height=int, profile=str) Save image to csv. Example: - in.csvsave(filename, profile=str, separator=str, keep=int, background=list[float], page_height=int) + in.csvsave(filename, separator=str, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param separator: Separator characters :type separator: str :param keep: Which metadata to retain @@ -1256,20 +1267,20 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: csvsave_target(target, profile=str, separator=str, keep=int, background=list[float], page_height=int) + .. method:: csvsave_target(target, separator=str, keep=int, background=list[float], page_height=int, profile=str) Save image to csv. Example: - in.csvsave_target(target, profile=str, separator=str, keep=int, background=list[float], page_height=int) + in.csvsave_target(target, separator=str, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target - :param profile: Filename of ICC profile to embed - :type profile: str :param separator: Separator characters :type separator: str :param keep: Which metadata to retain @@ -1278,6 +1289,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -1483,12 +1496,12 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: dzsave(filename, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, profile=str, 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) + .. 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) Save image to deepzoom file. Example: - in.dzsave(filename, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, profile=str, 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) + 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) :param filename: Filename to save to :type filename: str @@ -1502,8 +1515,6 @@ Autogenerated methods :type overlap: int :param tile_size: Tile size in pixels :type tile_size: int - :param profile: Filename of ICC profile to embed - :type profile: str :param centre: Center image in tile :type centre: bool :param depth: Pyramid depth @@ -1528,15 +1539,17 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: dzsave_buffer(imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, profile=str, 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) + .. 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) Save image to dz buffer. Example: - buffer = in.dzsave_buffer(imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, profile=str, 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) + 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) :param imagename: Image name :type imagename: str @@ -1548,8 +1561,6 @@ Autogenerated methods :type overlap: int :param tile_size: Tile size in pixels :type tile_size: int - :param profile: Filename of ICC profile to embed - :type profile: str :param centre: Center image in tile :type centre: bool :param depth: Pyramid depth @@ -1574,15 +1585,17 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: dzsave_target(target, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, profile=str, 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) + .. 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) Save image to deepzoom target. Example: - in.dzsave_target(target, imagename=str, layout=Union[str, ForeignDzLayout], suffix=str, overlap=int, tile_size=int, profile=str, 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) + 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) :param target: Target to save to :type target: Target @@ -1596,8 +1609,6 @@ Autogenerated methods :type overlap: int :param tile_size: Tile size in pixels :type tile_size: int - :param profile: Filename of ICC profile to embed - :type profile: str :param centre: Center image in tile :type centre: bool :param depth: Pyramid depth @@ -1622,6 +1633,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -1791,23 +1804,23 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: fitssave(filename, profile=str, keep=int, background=list[float], page_height=int) + .. method:: fitssave(filename, keep=int, background=list[float], page_height=int, profile=str) Save image to fits file. Example: - in.fitssave(filename, profile=str, keep=int, background=list[float], page_height=int) + in.fitssave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: @@ -1951,17 +1964,19 @@ Autogenerated methods :rtype: Image :raises Error: - .. method:: getpoint(x, y) + .. method:: getpoint(x, y, unpack_complex=bool) Read a point from an image. Example: - out_array = in.getpoint(x, y) + out_array = in.getpoint(x, y, unpack_complex=bool) :param x: Point to read :type x: int :param y: Point to read :type y: int + :param unpack_complex: Complex pixels should be unpacked + :type unpack_complex: bool :rtype: list[float] :raises Error: @@ -2043,12 +2058,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: gifsave(filename, dither=float, effort=int, profile=str, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int) + .. method:: gifsave(filename, 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) Save as gif. Example: - in.gifsave(filename, dither=float, effort=int, profile=str, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int) + in.gifsave(filename, 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) :param filename: Filename to save to :type filename: str @@ -2056,8 +2071,6 @@ Autogenerated methods :type dither: float :param effort: Quantisation effort :type effort: int - :param profile: Filename of ICC profile to embed - :type profile: str :param bitdepth: Number of bits per pixel :type bitdepth: int :param interframe_maxerror: Maximum inter-frame error for transparency @@ -2074,22 +2087,22 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: gifsave_buffer(dither=float, effort=int, profile=str, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int) + .. method:: gifsave_buffer(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) Save as gif. Example: - buffer = in.gifsave_buffer(dither=float, effort=int, profile=str, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int) + buffer = in.gifsave_buffer(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) :param dither: Amount of dithering :type dither: float :param effort: Quantisation effort :type effort: int - :param profile: Filename of ICC profile to embed - :type profile: str :param bitdepth: Number of bits per pixel :type bitdepth: int :param interframe_maxerror: Maximum inter-frame error for transparency @@ -2106,15 +2119,17 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: gifsave_target(target, dither=float, effort=int, profile=str, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int) + .. method:: gifsave_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) Save as gif. Example: - in.gifsave_target(target, dither=float, effort=int, profile=str, bitdepth=int, interframe_maxerror=float, reuse=bool, interpalette_maxerror=float, interlace=bool, keep=int, background=list[float], page_height=int) + in.gifsave_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) :param target: Target to save to :type target: Target @@ -2122,8 +2137,6 @@ Autogenerated methods :type dither: float :param effort: Quantisation effort :type effort: int - :param profile: Filename of ICC profile to embed - :type profile: str :param bitdepth: Number of bits per pixel :type bitdepth: int :param interframe_maxerror: Maximum inter-frame error for transparency @@ -2140,6 +2153,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -2299,12 +2314,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: heifsave(filename, Q=int, bitdepth=int, profile=str, 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) + .. method:: heifsave(filename, 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) Save image in HEIF format. Example: - in.heifsave(filename, Q=int, bitdepth=int, profile=str, 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) + in.heifsave(filename, 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) :param filename: Filename to save to :type filename: str @@ -2312,8 +2327,6 @@ Autogenerated methods :type Q: int :param bitdepth: Number of bits per pixel :type bitdepth: int - :param profile: Filename of ICC profile to embed - :type profile: str :param lossless: Enable lossless compression :type lossless: bool :param compression: Compression format @@ -2330,22 +2343,22 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: heifsave_buffer(Q=int, bitdepth=int, profile=str, 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) + .. method:: heifsave_buffer(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) Save image in HEIF format. Example: - buffer = in.heifsave_buffer(Q=int, bitdepth=int, profile=str, 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) + 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], keep=int, background=list[float], page_height=int, profile=str) :param Q: Q factor :type Q: int :param bitdepth: Number of bits per pixel :type bitdepth: int - :param profile: Filename of ICC profile to embed - :type profile: str :param lossless: Enable lossless compression :type lossless: bool :param compression: Compression format @@ -2362,15 +2375,17 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: heifsave_target(target, Q=int, bitdepth=int, profile=str, 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) + .. 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], keep=int, background=list[float], page_height=int, profile=str) Save image in HEIF format. Example: - in.heifsave_target(target, Q=int, bitdepth=int, profile=str, 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) + 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], keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target @@ -2378,8 +2393,6 @@ Autogenerated methods :type Q: int :param bitdepth: Number of bits per pixel :type bitdepth: int - :param profile: Filename of ICC profile to embed - :type profile: str :param lossless: Enable lossless compression :type lossless: bool :param compression: Compression format @@ -2396,6 +2409,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -2785,19 +2800,17 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: jp2ksave(filename, tile_width=int, profile=str, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int) + .. 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) Save image in JPEG2000 format. Example: - in.jp2ksave(filename, tile_width=int, profile=str, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int) + 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) - :param filename: Filename to load from + :param filename: Filename to save to :type filename: str :param tile_width: Tile width in pixels :type tile_width: int - :param profile: Filename of ICC profile to embed - :type profile: str :param tile_height: Tile height in pixels :type tile_height: int :param lossless: Enable lossless compression @@ -2812,20 +2825,20 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: jp2ksave_buffer(tile_width=int, profile=str, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int) + .. 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) Save image in JPEG2000 format. Example: - buffer = in.jp2ksave_buffer(tile_width=int, profile=str, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int) + 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) :param tile_width: Tile width in pixels :type tile_width: int - :param profile: Filename of ICC profile to embed - :type profile: str :param tile_height: Tile height in pixels :type tile_height: int :param lossless: Enable lossless compression @@ -2840,22 +2853,22 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: jp2ksave_target(target, tile_width=int, profile=str, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int) + .. 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) Save image in JPEG2000 format. Example: - in.jp2ksave_target(target, tile_width=int, profile=str, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], keep=int, background=list[float], page_height=int) + 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) :param target: Target to save to :type target: Target :param tile_width: Tile width in pixels :type tile_width: int - :param profile: Filename of ICC profile to embed - :type profile: str :param tile_height: Tile height in pixels :type tile_height: int :param lossless: Enable lossless compression @@ -2870,6 +2883,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -2957,19 +2972,17 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: jpegsave(filename, Q=int, profile=str, 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) + .. 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) Save image to jpeg file. Example: - in.jpegsave(filename, Q=int, profile=str, 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) + 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) :param filename: Filename to save to :type filename: str :param Q: Q factor :type Q: int - :param profile: Filename of ICC profile to embed - :type profile: str :param optimize_coding: Compute optimal Huffman coding tables :type optimize_coding: bool :param interlace: Generate an interlaced (progressive) jpeg @@ -2992,20 +3005,20 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: jpegsave_buffer(Q=int, profile=str, 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) + .. 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) Save image to jpeg buffer. Example: - buffer = in.jpegsave_buffer(Q=int, profile=str, 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) + 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) :param Q: Q factor :type Q: int - :param profile: Filename of ICC profile to embed - :type profile: str :param optimize_coding: Compute optimal Huffman coding tables :type optimize_coding: bool :param interlace: Generate an interlaced (progressive) jpeg @@ -3028,20 +3041,20 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: jpegsave_mime(Q=int, profile=str, 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) + .. 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) Save image to jpeg mime. Example: - in.jpegsave_mime(Q=int, profile=str, 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) + 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) :param Q: Q factor :type Q: int - :param profile: Filename of ICC profile to embed - :type profile: str :param optimize_coding: Compute optimal Huffman coding tables :type optimize_coding: bool :param interlace: Generate an interlaced (progressive) jpeg @@ -3064,22 +3077,22 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: jpegsave_target(target, Q=int, profile=str, 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) + .. 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) Save image to jpeg target. Example: - in.jpegsave_target(target, Q=int, profile=str, 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) + 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) :param target: Target to save to :type target: Target :param Q: Q factor :type Q: int - :param profile: Filename of ICC profile to embed - :type profile: str :param optimize_coding: Compute optimal Huffman coding tables :type optimize_coding: bool :param interlace: Generate an interlaced (progressive) jpeg @@ -3102,18 +3115,24 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. staticmethod:: jxlload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: jxlload(filename, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load JPEG-XL image. Example: - out = pyvips.Image.jxlload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + 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 + :param page: First page to load + :type page: int + :param n: Number of pages to load, -1 for all + :type n: int :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -3127,15 +3146,19 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: jxlload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: jxlload_buffer(buffer, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load JPEG-XL image. Example: - out = pyvips.Image.jxlload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.jxlload_buffer(buffer, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param buffer: Buffer to load from :type buffer: str + :param page: First page to load + :type page: int + :param n: Number of pages to load, -1 for all + :type n: int :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -3149,15 +3172,19 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. staticmethod:: jxlload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) + .. staticmethod:: jxlload_source(source, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool, flags=bool) Load JPEG-XL image. Example: - out = pyvips.Image.jxlload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) + out = pyvips.Image.jxlload_source(source, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], revalidate=bool) :param source: Source to load from :type source: Source + :param page: First page to load + :type page: int + :param n: Number of pages to load, -1 for all + :type n: int :param memory: Force open via memory :type memory: bool :param access: Required access pattern for this file @@ -3171,21 +3198,19 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: jxlsave(filename, tier=int, distance=float, profile=str, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int) + .. method:: jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int, profile=str) Save image in JPEG-XL format. Example: - in.jxlsave(filename, tier=int, distance=float, profile=str, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int) + in.jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int, profile=str) - :param filename: Filename to load from + :param filename: Filename to save to :type filename: str :param tier: Decode speed tier :type tier: int :param distance: Target butteraugli distance :type distance: float - :param profile: Filename of ICC profile to embed - :type profile: str :param effort: Encoding effort :type effort: int :param lossless: Enable lossless compression @@ -3198,22 +3223,22 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: jxlsave_buffer(tier=int, distance=float, profile=str, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int) + .. method:: jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int, profile=str) Save image in JPEG-XL format. Example: - buffer = in.jxlsave_buffer(tier=int, distance=float, profile=str, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int) + buffer = in.jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int, profile=str) :param tier: Decode speed tier :type tier: int :param distance: Target butteraugli distance :type distance: float - :param profile: Filename of ICC profile to embed - :type profile: str :param effort: Encoding effort :type effort: int :param lossless: Enable lossless compression @@ -3226,15 +3251,17 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: jxlsave_target(target, tier=int, distance=float, profile=str, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int) + .. method:: jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int, profile=str) Save image in JPEG-XL format. Example: - in.jxlsave_target(target, tier=int, distance=float, profile=str, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int) + in.jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target @@ -3242,8 +3269,6 @@ Autogenerated methods :type tier: int :param distance: Target butteraugli distance :type distance: float - :param profile: Filename of ICC profile to embed - :type profile: str :param effort: Encoding effort :type effort: int :param lossless: Enable lossless compression @@ -3256,6 +3281,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -3379,12 +3406,12 @@ 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, profile=str, keep=int, background=list[float], page_height=int) + .. 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) Save file with ImageMagick. Example: - in.magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, profile=str, keep=int, background=list[float], page_height=int) + 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) :param filename: Filename to save to :type filename: str @@ -3398,23 +3425,23 @@ Autogenerated methods :type optimize_gif_transparency: bool :param bitdepth: Number of bits per pixel :type bitdepth: int - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, profile=str, keep=int, background=list[float], page_height=int) + .. 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) Save image to magick buffer. Example: - buffer = in.magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, profile=str, keep=int, background=list[float], page_height=int) + 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) :param format: Format to save in :type format: str @@ -3426,14 +3453,14 @@ Autogenerated methods :type optimize_gif_transparency: bool :param bitdepth: Number of bits per pixel :type bitdepth: int - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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 :raises Error: @@ -3899,61 +3926,61 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: matrixprint(profile=str, keep=int, background=list[float], page_height=int) + .. method:: matrixprint(keep=int, background=list[float], page_height=int, profile=str) Print matrix. Example: - in.matrixprint(profile=str, keep=int, background=list[float], page_height=int) + in.matrixprint(keep=int, background=list[float], page_height=int, profile=str) - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: matrixsave(filename, profile=str, keep=int, background=list[float], page_height=int) + .. method:: matrixsave(filename, keep=int, background=list[float], page_height=int, profile=str) Save image to matrix. Example: - in.matrixsave(filename, profile=str, keep=int, background=list[float], page_height=int) + in.matrixsave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: matrixsave_target(target, profile=str, keep=int, background=list[float], page_height=int) + .. method:: matrixsave_target(target, keep=int, background=list[float], page_height=int, profile=str) Save image to matrix. Example: - in.matrixsave_target(target, profile=str, keep=int, background=list[float], page_height=int) + in.matrixsave_target(target, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: @@ -3979,6 +4006,18 @@ Autogenerated methods :rtype: float or list[float, Dict[str, mixed]] :raises Error: + .. method:: maxpair(right) + + Maximum of a pair of images. + + Example: + out = left.maxpair(right) + + :param right: Right-hand image argument + :type right: Image + :rtype: Image + :raises Error: + .. method:: measure(h, v, left=int, top=int, width=int, height=int) Measure a set of patches on a color chart. @@ -4043,6 +4082,18 @@ Autogenerated methods :rtype: float or list[float, Dict[str, mixed]] :raises Error: + .. method:: minpair(right) + + Minimum of a pair of images. + + Example: + out = left.minpair(right) + + :param right: Right-hand image argument + :type right: Image + :rtype: Image + :raises Error: + .. method:: morph(mask, morph) Morphology operation. @@ -4207,23 +4258,23 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: niftisave(filename, profile=str, keep=int, background=list[float], page_height=int) + .. method:: niftisave(filename, keep=int, background=list[float], page_height=int, profile=str) Save image to nifti file. Example: - in.niftisave(filename, profile=str, keep=int, background=list[float], page_height=int) + in.niftisave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: @@ -4531,12 +4582,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: pngsave(filename, compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int) + .. 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) - Save image to png file. + Save image to file as PNG. Example: - in.pngsave(filename, compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int) + 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) :param filename: Filename to save to :type filename: str @@ -4544,9 +4595,7 @@ Autogenerated methods :type compression: int :param interlace: Interlace image :type interlace: bool - :param profile: Filename of ICC profile to embed - :type profile: str - :param filter: libpng row filter flag(s) + :param filter: libspng row filter flag(s) :type filter: int :param palette: Quantise to 8bpp palette :type palette: bool @@ -4564,23 +4613,23 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: pngsave_buffer(compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int) + .. 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) - Save image to png buffer. + Save image to buffer as PNG. Example: - buffer = in.pngsave_buffer(compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int) + 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) :param compression: Compression factor :type compression: int :param interlace: Interlace image :type interlace: bool - :param profile: Filename of ICC profile to embed - :type profile: str - :param filter: libpng row filter flag(s) + :param filter: libspng row filter flag(s) :type filter: int :param palette: Quantise to 8bpp palette :type palette: bool @@ -4598,15 +4647,17 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: pngsave_target(target, compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int) + .. 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) Save image to target as PNG. Example: - in.pngsave_target(target, compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, keep=int, background=list[float], page_height=int) + 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) :param target: Target to save to :type target: Target @@ -4614,9 +4665,7 @@ Autogenerated methods :type compression: int :param interlace: Interlace image :type interlace: bool - :param profile: Filename of ICC profile to embed - :type profile: str - :param filter: libpng row filter flag(s) + :param filter: libspng row filter flag(s) :type filter: int :param palette: Quantise to 8bpp palette :type palette: bool @@ -4634,6 +4683,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -4681,12 +4732,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, profile=str, bitdepth=int, keep=int, background=list[float], page_height=int) + .. method:: ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) Save image to ppm file. Example: - in.ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, profile=str, bitdepth=int, keep=int, background=list[float], page_height=int) + in.ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str @@ -4694,8 +4745,6 @@ Autogenerated methods :type format: Union[str, ForeignPpmFormat] :param ascii: Save as ascii :type ascii: bool - :param profile: Filename of ICC profile to embed - :type profile: str :param bitdepth: Set to 1 to write as a 1 bit image :type bitdepth: int :param keep: Which metadata to retain @@ -4704,15 +4753,17 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, profile=str, bitdepth=int, keep=int, background=list[float], page_height=int) + .. method:: ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) Save to ppm. Example: - in.ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, profile=str, bitdepth=int, keep=int, background=list[float], page_height=int) + in.ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target @@ -4720,8 +4771,6 @@ Autogenerated methods :type format: Union[str, ForeignPpmFormat] :param ascii: Save as ascii :type ascii: bool - :param profile: Filename of ICC profile to embed - :type profile: str :param bitdepth: Set to 1 to write as a 1 bit image :type bitdepth: int :param keep: Which metadata to retain @@ -4730,6 +4779,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -4877,61 +4928,61 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: radsave(filename, profile=str, keep=int, background=list[float], page_height=int) + .. method:: radsave(filename, keep=int, background=list[float], page_height=int, profile=str) Save image to Radiance file. Example: - in.radsave(filename, profile=str, keep=int, background=list[float], page_height=int) + in.radsave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: radsave_buffer(profile=str, keep=int, background=list[float], page_height=int) + .. method:: radsave_buffer(keep=int, background=list[float], page_height=int, profile=str) Save image to Radiance buffer. Example: - buffer = in.radsave_buffer(profile=str, keep=int, background=list[float], page_height=int) + buffer = in.radsave_buffer(keep=int, background=list[float], page_height=int, profile=str) - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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 :raises Error: - .. method:: radsave_target(target, profile=str, keep=int, background=list[float], page_height=int) + .. method:: radsave_target(target, keep=int, background=list[float], page_height=int, profile=str) Save image to Radiance target. Example: - in.radsave_target(target, profile=str, keep=int, background=list[float], page_height=int) + in.radsave_target(target, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: @@ -4985,43 +5036,61 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: rawsave(filename, profile=str, keep=int, background=list[float], page_height=int) + .. method:: rawsave(filename, keep=int, background=list[float], page_height=int, profile=str) Save image to raw file. Example: - in.rawsave(filename, profile=str, keep=int, background=list[float], page_height=int) + in.rawsave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: rawsave_fd(fd, profile=str, keep=int, background=list[float], page_height=int) + .. method:: rawsave_buffer(keep=int, background=list[float], page_height=int, profile=str) - Write raw image to file descriptor. + Write raw image to buffer. Example: - in.rawsave_fd(fd, profile=str, keep=int, background=list[float], page_height=int) + buffer = in.rawsave_buffer(keep=int, background=list[float], page_height=int, profile=str) - :param fd: File descriptor to write to - :type fd: int + :param keep: Which metadata to retain + :type keep: int + :param background: Background value + :type background: list[float] + :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 + :raises Error: + + .. method:: rawsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + + Write raw image to target. + + Example: + in.rawsave_target(target, keep=int, background=list[float], page_height=int, profile=str) + + :param target: Target to save to + :type target: Target :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: @@ -5202,7 +5271,7 @@ Autogenerated methods Example: out = in.rotate(angle, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float) - :param angle: Rotate anticlockwise by this many degrees + :param angle: Rotate clockwise by this many degrees :type angle: float :param interpolate: Interpolate pixels with this :type interpolate: GObject @@ -5295,6 +5364,30 @@ Autogenerated methods :rtype: Image :raises Error: + .. staticmethod:: sdf(width, height, shape, r=float, a=list[float], b=list[float], corners=list[float]) + + Create an SDF image. + + Example: + out = pyvips.Image.sdf(width, height, shape, r=float, a=list[float], b=list[float], corners=list[float]) + + :param width: Image width in pixels + :type width: int + :param height: Image height in pixels + :type height: int + :param shape: SDF shape to create + :type shape: Union[str, SdfShape] + :param r: Radius + :type r: float + :param a: Point a + :type a: list[float] + :param b: Point b + :type b: list[float] + :param corners: Corner radii + :type corners: list[float] + :rtype: Image + :raises Error: + .. method:: sequential(tile_height=int) Check sequential access. @@ -5392,7 +5485,7 @@ Autogenerated methods :param scale: Scale by this factor :type scale: float - :param angle: Rotate anticlockwise by this many degrees + :param angle: Rotate clockwise by this many degrees :type angle: float :param interpolate: Interpolate pixels with this :type interpolate: GObject @@ -5927,12 +6020,12 @@ 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, profile=str, 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) + .. 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) Save image to tiff file. Example: - in.tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, profile=str, 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) + 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) :param filename: Filename to save to :type filename: str @@ -5946,8 +6039,6 @@ Autogenerated methods :type tile: bool :param tile_width: Tile width in pixels :type tile_width: int - :param profile: Filename of ICC profile to embed - :type profile: str :param tile_height: Tile height in pixels :type tile_height: int :param pyramid: Write a pyramidal tiff @@ -5968,7 +6059,7 @@ Autogenerated methods :type properties: bool :param region_shrink: Method to shrink regions :type region_shrink: Union[str, RegionShrink] - :param level: ZSTD compression level + :param level: Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level :type level: int :param lossless: Enable WEBP lossless mode :type lossless: bool @@ -5984,15 +6075,17 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: - .. method:: tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, profile=str, 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) + .. 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) 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, profile=str, 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) + 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) :param compression: Compression for this file :type compression: Union[str, ForeignTiffCompression] @@ -6004,8 +6097,6 @@ Autogenerated methods :type tile: bool :param tile_width: Tile width in pixels :type tile_width: int - :param profile: Filename of ICC profile to embed - :type profile: str :param tile_height: Tile height in pixels :type tile_height: int :param pyramid: Write a pyramidal tiff @@ -6026,7 +6117,7 @@ Autogenerated methods :type properties: bool :param region_shrink: Method to shrink regions :type region_shrink: Union[str, RegionShrink] - :param level: ZSTD compression level + :param level: Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level :type level: int :param lossless: Enable WEBP lossless mode :type lossless: bool @@ -6042,15 +6133,17 @@ Autogenerated methods :type background: list[float] :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 :raises Error: - .. method:: tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], tile=bool, tile_width=int, profile=str, 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) + .. 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) 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, profile=str, 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) + 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) :param target: Target to save to :type target: Target @@ -6064,8 +6157,6 @@ Autogenerated methods :type tile: bool :param tile_width: Tile width in pixels :type tile_width: int - :param profile: Filename of ICC profile to embed - :type profile: str :param tile_height: Tile height in pixels :type tile_height: int :param pyramid: Write a pyramidal tiff @@ -6086,7 +6177,7 @@ Autogenerated methods :type properties: bool :param region_shrink: Method to shrink regions :type region_shrink: Union[str, RegionShrink] - :param level: ZSTD compression level + :param level: Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level :type level: int :param lossless: Enable WEBP lossless mode :type lossless: bool @@ -6102,6 +6193,8 @@ Autogenerated methods :type background: list[float] :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: list[] :raises Error: @@ -6227,43 +6320,43 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: vipssave(filename, profile=str, keep=int, background=list[float], page_height=int) + .. method:: vipssave(filename, keep=int, background=list[float], page_height=int, profile=str) Save image to file in vips format. Example: - in.vipssave(filename, profile=str, keep=int, background=list[float], page_height=int) + in.vipssave(filename, keep=int, background=list[float], page_height=int, profile=str) :param filename: Filename to save to :type filename: str - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: vipssave_target(target, profile=str, keep=int, background=list[float], page_height=int) + .. method:: vipssave_target(target, keep=int, background=list[float], page_height=int, profile=str) Save image to target in vips format. Example: - in.vipssave_target(target, profile=str, keep=int, background=list[float], page_height=int) + in.vipssave_target(target, keep=int, background=list[float], page_height=int, profile=str) :param target: Target to save to :type target: Target - :param profile: Filename of ICC profile to embed - :type profile: str :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: @@ -6351,12 +6444,12 @@ Autogenerated methods :rtype: Image or list[Image, Dict[str, mixed]] :raises Error: - .. method:: webpsave(filename, Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + .. method:: webpsave(filename, 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) Save as WebP. Example: - in.webpsave(filename, Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + in.webpsave(filename, 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) :param filename: Filename to save to :type filename: str @@ -6364,8 +6457,6 @@ Autogenerated methods :type Q: int :param lossless: Enable lossless compression :type lossless: bool - :param profile: Filename of ICC profile to embed - :type profile: str :param preset: Preset for lossy compression :type preset: Union[str, ForeignWebpPreset] :param smart_subsample: Enable high quality chroma subsampling @@ -6382,30 +6473,36 @@ Autogenerated methods :type kmax: int :param effort: Level of CPU effort to reduce file size :type effort: int + :param target_size: Desired target size in bytes + :type target_size: int :param mixed: Allow mixed encoding (might reduce file size) :type mixed: bool + :param smart_deblock: Enable auto-adjusting of the deblocking filter + :type smart_deblock: bool + :param passes: Number of entropy-analysis passes (in [1..10]) + :type passes: int :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: webpsave_buffer(Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + .. method:: webpsave_buffer(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) Save as WebP. Example: - buffer = in.webpsave_buffer(Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + buffer = in.webpsave_buffer(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) :param Q: Q factor :type Q: int :param lossless: Enable lossless compression :type lossless: bool - :param profile: Filename of ICC profile to embed - :type profile: str :param preset: Preset for lossy compression :type preset: Union[str, ForeignWebpPreset] :param smart_subsample: Enable high quality chroma subsampling @@ -6422,30 +6519,36 @@ Autogenerated methods :type kmax: int :param effort: Level of CPU effort to reduce file size :type effort: int + :param target_size: Desired target size in bytes + :type target_size: int :param mixed: Allow mixed encoding (might reduce file size) :type mixed: bool + :param smart_deblock: Enable auto-adjusting of the deblocking filter + :type smart_deblock: bool + :param passes: Number of entropy-analysis passes (in [1..10]) + :type passes: int :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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 :raises Error: - .. method:: webpsave_mime(Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + .. method:: webpsave_mime(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) Save image to webp mime. Example: - in.webpsave_mime(Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + in.webpsave_mime(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) :param Q: Q factor :type Q: int :param lossless: Enable lossless compression :type lossless: bool - :param profile: Filename of ICC profile to embed - :type profile: str :param preset: Preset for lossy compression :type preset: Union[str, ForeignWebpPreset] :param smart_subsample: Enable high quality chroma subsampling @@ -6462,23 +6565,31 @@ Autogenerated methods :type kmax: int :param effort: Level of CPU effort to reduce file size :type effort: int + :param target_size: Desired target size in bytes + :type target_size: int :param mixed: Allow mixed encoding (might reduce file size) :type mixed: bool + :param smart_deblock: Enable auto-adjusting of the deblocking filter + :type smart_deblock: bool + :param passes: Number of entropy-analysis passes (in [1..10]) + :type passes: int :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: - .. method:: webpsave_target(target, Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + .. method:: webpsave_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) Save as WebP. Example: - in.webpsave_target(target, Q=int, lossless=bool, profile=str, preset=Union[str, ForeignWebpPreset], smart_subsample=bool, near_lossless=bool, alpha_q=int, min_size=bool, kmin=int, kmax=int, effort=int, mixed=bool, keep=int, background=list[float], page_height=int) + in.webpsave_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) :param target: Target to save to :type target: Target @@ -6486,8 +6597,6 @@ Autogenerated methods :type Q: int :param lossless: Enable lossless compression :type lossless: bool - :param profile: Filename of ICC profile to embed - :type profile: str :param preset: Preset for lossy compression :type preset: Union[str, ForeignWebpPreset] :param smart_subsample: Enable high quality chroma subsampling @@ -6504,14 +6613,22 @@ Autogenerated methods :type kmax: int :param effort: Level of CPU effort to reduce file size :type effort: int + :param target_size: Desired target size in bytes + :type target_size: int :param mixed: Allow mixed encoding (might reduce file size) :type mixed: bool + :param smart_deblock: Enable auto-adjusting of the deblocking filter + :type smart_deblock: bool + :param passes: Number of entropy-analysis passes (in [1..10]) + :type passes: int :param keep: Which metadata to retain :type keep: int :param background: Background value :type background: list[float] :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: list[] :raises Error: diff --git a/examples/gen-enums.py b/examples/gen-enums.py index 3e61f06..ec2d9fb 100755 --- a/examples/gen-enums.py +++ b/examples/gen-enums.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import sys import xml.etree.ElementTree as ET diff --git a/pyvips/enums.py b/pyvips/enums.py index 66bf25e..1f125a8 100644 --- a/pyvips/enums.py +++ b/pyvips/enums.py @@ -832,6 +832,31 @@ class TextWrap(object): NONE = 'none' +class SdfShape(object): + """SdfShape. + +The SDF to generate, + +See also: vips_sdf(). + +Attributes: + + CIRCLE (str): a circle at @a, radius @r + + BOX (str): a box from @a to @b + + ROUNDED_BOX (str): a box with rounded @corners from @a to @b + + LINE (str): a line from @a to @b + + """ + + CIRCLE = 'circle' + BOX = 'box' + ROUNDED_BOX = 'rounded-box' + LINE = 'line' + + class FailOn(object): """FailOn.