Image
¶
Main methods¶
- class pyvips.Image(pointer)[source]¶
Wrap a VipsImage object.
Methods
- __init__(pointer)[source]¶
Wrap around a pointer.
Wraps a GObject instance around an underlying pointer. When the instance is garbage-collected, the underlying object is unreferenced.
- static new_from_file(vips_filename, **kwargs)[source]¶
Load an image from a file.
This method can load images in any format supported by vips. The filename can include load options, for example:
image = pyvips.Image.new_from_file('fred.jpg[shrink=2]')
You can also supply options as keyword arguments, for example:
image = pyvips.Image.new_from_file('fred.jpg', shrink=2)
The full set of options available depend upon the load operation that will be executed. Try something like:
$ vips jpegload
at the command-line to see a summary of the available options for the JPEG loader.
Loading is fast: only enough of the image is loaded to be able to fill out the header. Pixels will only be decompressed when they are needed.
- Parameters
vips_filename (str) – The disc file to load the image from, with optional appended arguments.
All loaders support at least the following options:
- Keyword Arguments
memory (bool) – If set True, load the image via memory rather than via a temporary disc file. See
new_temp_file()
for notes on where temporary files are created. Small images are loaded via memory by default, useVIPS_DISC_THRESHOLD
to set the definition of small.access (Access) – Hint the expected access pattern for the image.
fail (bool) – If set True, the loader will fail with an error on the first serious error in the file. By default, libvips will attempt to read everything it can from a damaged image.
- Returns
A new
Image
.- Raises
.Error –
- static new_from_buffer(data, options, **kwargs)[source]¶
Load a formatted image from memory.
This behaves exactly as
new_from_file()
, but the image is loaded from the memory object rather than from a file. The memory object can be anything that supports the Python buffer protocol.- Parameters
data (array, bytearray, bytes, buffer) – The memory object to load the image from.
options (str) – Load options as a string. Use
""
for no options.
All loaders support at least the following options:
- Keyword Arguments
access (Access) – Hint the expected access pattern for the image.
fail (bool) – If set True, the loader will fail with an error on the first serious error in the image. By default, libvips will attempt to read everything it can from a damaged image.
- Returns
A new
Image
.- Raises
.Error –
- static new_from_list(array, scale=1.0, offset=0.0)[source]¶
Create an image from a list or list of lists.
A new one-band image with
BandFormat
'double'
pixels is created from the array. These image are useful with the libvips convolution operatorImage.conv()
.- Parameters
array (list[list[float]]) – Create the image from these values. 1D arrays become a single row of pixels.
scale (float) – Default to 1.0. What to divide each pixel by after convolution. Useful for integer convolution masks.
offset (float) – Default to 0.0. What to subtract from each pixel after convolution. Useful for integer convolution masks.
- Returns
A new
Image
.- Raises
.Error –
- classmethod new_from_array(obj, scale=1.0, offset=0.0, interpretation=None)[source]¶
Create a new Image from a list or an array-like object.
Array-like objects are those which define __array_interface__ or __array__. For details about the array interface, see The Array Interface.
If __array_interface__ is not available, __array__ is used as a fallback.
The behavior for input objects with different dimensions is summarized as:
| array ndim | array shape | Image w | Image h | Image bands | |------------|-------------|---------|---------|-------------| | 0 | () | 1 | 1 | 1 | | 1 | (W,) | W | 1 | 1 | | 2 | (H, W) | W | H | 1 | | 3 | (H, W, C) | W | H | C |
- Parameters
obj (list or object width __array_interface__ or __array__) –
The object to convert to an image.
If the input object is a list, Image.new_from_list is used with the given scale and offset
If the input object is an array-like object, a new image is created from the object’s data and shape. The memory is shared except in the following cases:
The object’s memory is not contiguous. In this case, a copy is made by attempting to call the object’s tobytes() method or its tostring() method.
The object is an array of bools, in which case it is converted to a pyvips uchar image with True values becoming 255 and False values becoming 0.
scale (float) – Default to 1.0. Ignored for non-list inputs. What to divide each pixel by after convolution. Useful for integer convolution masks.
offset (float) – Default to 0.0. Ignored for non-list inputs. What to subtract from each pixel after convolution. Useful for integer convolution masks.
interpretation (str, optional) –
Ignored for list inputs The libvips interpretation of the array. If None, the interpretation defaults to the pyvips one for Image.new_from_memory.
If ‘auto’, a heuristic is used to determine a best-guess interpretation as defined in the _guess_interpretation function.
Must be one of None, ‘auto’, ‘error’, ‘multiband’, ‘b-w’, ‘histogram’, ‘xyz’, ‘lab’, ‘cmyk’, ‘labq’, ‘rgb’, ‘cmc’, ‘lch’, ‘labs’, ‘srgb’, ‘yxy’, ‘fourier’, ‘rgb16’, ‘grey16’, ‘matrix’, ‘scrgb’, or ‘hsv’
- Returns
The new image.
See also
_guess_interpretation()
- static new_from_memory(data, width, height, bands, format)[source]¶
Wrap an image around a memory array.
Wraps an Image around an area of memory containing a C-style array. For example, if the
data
memory array contains four bytes with the values 1, 2, 3, 4, you can make a one-band, 2x2 uchar image from it like this:image = Image.new_from_memory(data, 2, 2, 1, 'uchar')
A reference is kept to the data object, so it will not be garbage-collected until the returned image is garbage-collected.
This method is useful for efficiently transferring images from PIL or NumPy into libvips.
See
write_to_memory()
for the opposite operation.Use
copy()
to set other image attributes.- Parameters
data (bytes) – A memoryview or buffer object.
width (int) – Image width in pixels.
height (int) – Image height in pixels.
bands (int) – Number of bands.
format (BandFormat) – Band format.
- Returns
A new
Image
.- Raises
.Error –
- static new_from_source(source, options, **kwargs)[source]¶
Load a formatted image from a source.
This behaves exactly as
new_from_file()
, but the image is loaded from the source rather than from a file.- Parameters
source (Source) – The source to load the image from.
options (str) – Load options as a string. Use
""
for no options.
All loaders support at least the following options:
- Keyword Arguments
access (Access) – Hint the expected access pattern for the image.
fail (bool) – If set True, the loader will fail with an error on the first serious error in the image. By default, libvips will attempt to read everything it can from a damaged image.
- Returns
A new
Image
.- Raises
.Error –
- static new_temp_file(format)[source]¶
Make a new temporary image.
Returns an image backed by a temporary file. When written to with
Image.write()
, a temporary file will be created on disc in the specified format. When the image is closed, the file will be deleted automatically.The file is created in the temporary directory. This is set with the environment variable
TMPDIR
. If this is not set, then on Unix systems, vips will default to/tmp
. On Windows, vips usesGetTempPath()
to find the temporary directory.vips uses
g_mkstemp()
to make the temporary filename. They generally look something like"vips-12-EJKJFGH.v"
.- Parameters
format (str) – The format for the temp file, for example
"%s.v"
for a vips format file. The%s
is substituted by the file path.- Returns
A new
Image
.- Raises
.Error –
- new_from_image(value)[source]¶
Make a new image from an existing one.
A new image is created which has the same size, format, interpretation and resolution as
self
, but with every pixel set tovalue
.- Parameters
value (float, list[float]) – The value for the pixels. Use a single number to make a one-band image; use an array constant to make a many-band image.
- Returns
A new
Image
.- Raises
.Error –
- copy_memory()[source]¶
Copy an image to memory.
A large area of memory is allocated, the image is rendered to that memory area, and a new image is returned which wraps that large memory area.
- Returns
A new
Image
.- Raises
.Error –
- write_to_file(vips_filename, **kwargs)[source]¶
Write an image to a file on disc.
This method can save images in any format supported by vips. The format is selected from the filename suffix. The filename can include embedded save options, see
Image.new_from_file()
.For example:
image.write_to_file('fred.jpg[Q=95]')
You can also supply options as keyword arguments, for example:
image.write_to_file('fred.jpg', Q=95)
The full set of options available depend upon the load operation that will be executed. Try something like:
$ vips jpegsave
at the command-line to see a summary of the available options for the JPEG saver.
- Parameters
vips_filename (str) – The disc file to save the image to, with optional appended arguments.
Other arguments depend upon the save operation.
- Returns
None
- Raises
.Error –
- write_to_buffer(format_string, **kwargs)[source]¶
Write an image to memory.
This method can save images in any format supported by vips. The format is selected from the suffix in the format string. This can include embedded save options, see
Image.write_to_file()
.For example:
data = image.write_to_buffer('.jpg[Q=95]')
You can also supply options as keyword arguments, for example:
data = image.write_to_buffer('.jpg', Q=95)
The full set of options available depend upon the load operation that will be executed. Try something like:
$ vips jpegsave_buffer
at the command-line to see a summary of the available options for the JPEG saver.
- Parameters
format_string (str) – The suffix, plus any string-form arguments.
Other arguments depend upon the save operation.
- Returns
A byte string.
- Raises
.Error –
- write_to_target(target, format_string, **kwargs)[source]¶
Write an image to a target.
This method will write the image to the target in the format specified in the suffix in the format string. This can include embedded save options, see
Image.write_to_file()
.For example:
image.write_to_target(target, '.jpg[Q=95]')
You can also supply options as keyword arguments, for example:
image.write_to_target(target, '.jpg', Q=95)
The full set of options available depend upon the save operation that will be executed. Try something like:
$ vips jpegsave_target
at the command-line to see a summary of the available options for the JPEG saver.
- Parameters
target (Target) – The target to write the image to
format_string (str) – The suffix, plus any string-form arguments.
Other arguments depend upon the save operation.
- Returns
None
- Raises
.Error –
- write_to_memory()[source]¶
Write the image to a large memory array.
A large area of memory is allocated, the image is rendered to that memory array, and the array is returned as a buffer.
For example, if you have a 2x2 uchar image containing the bytes 1, 2, 3, 4, read left-to-right, top-to-bottom, then:
buf = image.write_to_memory()
will return a four byte buffer containing the values 1, 2, 3, 4.
- Returns
buffer
- Raises
.Error –
- write(other)[source]¶
Write an image to another image.
This function writes
self
to another image. Use something likeImage.new_temp_file()
to make an image that can be written to.
- invalidate()[source]¶
Drop caches on an image, and any downstream images.
This method drops all pixel caches on an image and on all downstream images. Any operations which depend on this image, directly or indirectly, are also dropped from the libvips operation cache.
This method can be useful if you wrap a libvips image around an area of memory with
new_from_memory()
and then change some bytes without libvips knowing.- Returns
None
- set_progress(progress)[source]¶
Enable progress reporting on an image.
When progress reporting is enabled, evaluation of the most downstream image from this image will report progress using the ::preeval, ::eval, and ::posteval signals.
- set_kill(kill)[source]¶
Kill processing of an image.
Use this to kill evaluation of an image. You can call it from one of the progress signals, for example. See
set_progress()
.
- get_typeof(name)[source]¶
Get the GType of an item of metadata.
Fetch the GType of a piece of metadata, or 0 if the named item does not exist. See
GValue
.- Parameters
name (str) – The name of the piece of metadata to get the type of.
- Returns
The
GType
, or 0.- Raises
None –
- get(name)[source]¶
Get an item of metadata.
Fetches an item of metadata as a Python value. For example:
orientation = image.get('orientation')
would fetch the image orientation.
- Parameters
name (str) – The name of the piece of metadata to get.
- Returns
The metadata item as a Python value.
- Raises
.Error –
- set_type(gtype, name, value)[source]¶
Set the type and value of an item of metadata.
Sets the type and value of an item of metadata. Any old item of the same name is removed. See
GValue
for types.- Parameters
gtype (int) – The GType of the metadata item to create.
name (str) – The name of the piece of metadata to create.
value (mixed) – The value to set as a Python value. It is converted to the
gtype
, if possible.
- Returns
None
- Raises
None –
- set(name, value)[source]¶
Set the value of an item of metadata.
Sets the value of an item of metadata. The metadata item must already exist.
- Parameters
name (str) – The name of the piece of metadata to set the value of.
value (mixed) – The value to set as a Python value. It is converted to the type of the metadata item, if possible.
- Returns
None
- Raises
.Error –
- remove(name)[source]¶
Remove an item of metadata.
The named metadata item is removed.
- Parameters
name (str) – The name of the piece of metadata to remove.
- Returns
None
- Raises
None –
- __array__(dtype=None)[source]¶
Conversion to a NumPy array.
- Parameters
dtype (str or numpy dtype, optional) – numpy array. If None, the default dtype of the image is used as defined the global FORMAT_TO_TYPESTR dictionary.
- Returns
- The array representation of the image.
Single-band images lose their channel axis.
Single-pixel single-band images are converted to a 0D array.
- Return type
numpy.ndarray
See https://numpy.org/devdocs/user/basics.dispatch.html for more details.
This enables a
Image
to be used where a numpy array is expected, including in plotting and conversion to other array container types (pytorch, JAX, dask, etc.), for example.numpy is a runtime dependency of this function.
See Also Image.new_from_array for the inverse operation. #TODO
- numpy(dtype=None)[source]¶
Convenience function to allow numpy conversion to be at the end of a method chain.
This mimics the behavior of pytorch:
arr = im.op1().op2().numpy()
numpy is a runtime dependency of this function.
- Parameters
dtype (str or numpy dtype) – The dtype to use for the numpy array. If None, the default dtype of the image is used.
- Returns
The image as a numpy array.
- Return type
numpy.ndarray
See also
FORMAT_TO_TYPESTR: Global dictionary mapping libvips format strings to numpy dtype strings.
- __getattr__(name)[source]¶
Divert unknown names to libvips.
Unknown attributes are first looked up in the image properties as accessors, for example:
width = image.width
and then in the libvips operation table, where they become method calls, for example:
new_image = image.invert()
Use
get()
to fetch image metadata.A
__getattr__
on the metatype lets you call static members in the same way.- Parameters
name (str) – The name of the piece of metadata to get.
- Returns
Mixed.
- Raises
.Error –
- __getitem__(arg)[source]¶
Overload [] to pull out band elements from an image.
The following arguments types are accepted:
int:
green = rgb_image[1]
Will make a new one-band image from band 1 (the middle band).
slice:
last_two = rgb_image[1:] last_band = rgb_image[-1] middle_few = multiband[1:-2] reversed = multiband[::-1] every_other = multiband[::2] other_every_other = multiband[1::2]
list of int:
# list of integers desired_bands = [1, 2, 2, -1] four_band = multiband[desired_bands]
list of bool:
wanted_bands = [True, False, True, True, False] three_band = five_band[wanted_bands]
In the case of integer or slice arguments, the semantics of slicing exactly match those of slicing range(self.bands).
In the case of list arguments, the semantics match those of numpy’s extended slicing syntax. Thus, lists of booleans must have as many elements as there are bands in the image.
- __call__(x, y)[source]¶
Fetch a pixel value.
- Parameters
x (int) – The x coordinate to fetch.
y (int) – The y coordinate to fetch.
- Returns
Pixel as an array of floating point numbers.
- Raises
.Error –
- get_n_pages()[source]¶
Get the number of pages in an image file, or 1.
This is the number of pages in the file the image was loaded from, not the number of pages in the image.
To get the number of pages in an image, divide the image height by the page height.
- pagejoin(other)[source]¶
Join a set of pages vertically to make a multipage image.
Also sets the page-height property on the result.
- ifthenelse(in1, in2, **kwargs)[source]¶
Ifthenelse an image.
Example
out = cond.ifthenelse(in1, in2, blend=bool)
- scaleimage(**kwargs)[source]¶
Scale an image to 0 - 255.
This is the libvips
scale
operation, renamed to avoid a clash with thescale
for convolution masks.- Keyword Arguments
exp (float) – Exponent for log scale.
log (bool) – Switch to turn on log scaling.
- Returns
A new
Image
.- Raises
.Error –
- __hash__ = None¶
Attributes¶
Scale an image to uchar. |
- class pyvips.Image¶
- width¶
int, read-only: Image width in pixels.
- height¶
int, read-only: Image height in pixels.
- bands¶
int, read-only: Number of bands in image.
- format¶
BandFormat
, read-only: Image format.
- interpretation¶
Interpretation
, read-only: Suggested interpretation of image pixel values.
- filename¶
str, read-only: Filename image was loaded from, or None.
- xoffset¶
int, read-only: Image X offset.
- yoffset¶
int, read-only: Image Y offset.
- xres¶
float, read-only: Image X resolution, in pixels / mm
- yres¶
float, read-only: Image Y resolution, in pixels / mm.
- scale¶
float, read-only: Image scale.
- offset¶
float, read-only: Image offset.
Autogenerated methods¶
- class pyvips.Image¶
Methods
Transform LCh to CMC.
Transform CMYK to XYZ.
Transform HSV to sRGB.
Transform LCh to CMC.
Transform LCh to Lab.
Transform Lab to LCh.
Transform float Lab to LabQ coding.
Transform float Lab to signed short.
Transform CIELAB to XYZ.
Unpack a LabQ image to float Lab.
Unpack a LabQ image to short Lab.
Convert a LabQ image to sRGB.
Transform signed short Lab to float.
Transform short Lab to LabQ coding.
Transform XYZ to CMYK.
Transform XYZ to Lab.
Transform XYZ to Yxy.
Transform XYZ to scRGB.
Transform Yxy to XYZ.
Absolute value of an image.
Add two images.
Affine transform of an image.
Load an Analyze6 image.
Join an array of images.
Autorotate image by exif tag.
Find image average.
Boolean operation across image bands.
Fold up x axis into bands.
Append a constant band to an image.
Band-wise average.
Unfold image bands into x axis.
Make a black image.
Boolean operation on two images.
Boolean operations against a constant.
Build a look-up table.
Byteswap an image.
Cache an image.
Canny edge detector.
Use pixel values to pick cases from an array of images.
Cast an image.
Convert to a new colourspace.
Convolve with rotating mask.
Perform a complex operation on an image.
Complex binary operations on two images.
Form a complex image from two real images.
Get a component from a complex image.
Composite a set of images with a set of modes.
Blend a pair of images with a blend mode.
Convolution operation.
Approximate integer convolution.
Approximate separable integer convolution.
Float convolution operation.
Int convolution operation.
Seperable convolution operation.
Copy an image.
Count lines in an image.
Extract an area from an image.
Load csv.
Load csv.
Save image to csv.
Save image to csv.
Calculate dE00.
Calculate dE76.
Calculate dECMC.
Find image standard deviation.
Divide two images.
Draw a circle on an image.
Flood-fill an area.
Paint an image into another image.
Draw a line on an image.
Draw a mask on an image.
Paint a rectangle on an image.
Blur a rectangle on an image.
Save image to deepzoom file.
Save image to dz buffer.
Save image to deepzoom target.
Embed an image in a larger image.
Extract an area from an image.
Extract band from an image.
Make an image showing the eye's spatial response.
False-colour an image.
Fast correlation.
Fill image zeros with nearest non-zero pixel.
Search an image for non-edge areas.
Load a FITS image.
Load FITS from a source.
Save image to fits file.
Flatten alpha out of an image.
Flip an image.
Transform float RGB to Radiance coding.
Make a fractal surface.
Frequency-domain filtering.
Forward FFT.
Gamma an image.
Gaussian blur.
Make a gaussian image.
Make a gaussnoise image.
Read a point from an image.
Load GIF with libnsgif.
Load GIF with libnsgif.
Load gif from source.
Save as gif.
Save as gif.
Save as gif.
Global balance an image mosaic.
Place an image within a larger image with a certain gravity.
Make a grey ramp image.
Grid an image.
Load a HEIF image.
Load a HEIF image.
Load a HEIF image.
Save image in HEIF format.
Save image in HEIF format.
Save image in HEIF format.
Form cumulative histogram.
Estimate image entropy.
Histogram equalisation.
Find image histogram.
Find indexed image histogram.
Find n-dimensional image histogram.
Test for monotonicity.
Local histogram equalisation.
Match two histograms.
Normalise histogram.
Plot histogram.
Find hough circle transform.
Find hough line transform.
Output to device with ICC profile.
Import from device with ICC profile.
Transform between devices with ICC profiles.
Make a 1D image where pixel values are indexes.
Insert image @sub into @main at @x, @y.
Invert an image.
Build an inverted look-up table.
Inverse FFT.
Join a pair of images.
Load JPEG2000 image.
Load JPEG2000 image.
Load JPEG2000 image.
Save image in JPEG2000 format.
Save image in JPEG2000 format.
Save image in JPEG2000 format.
Load jpeg from file.
Load jpeg from buffer.
Load image from jpeg source.
Save image to jpeg file.
Save image to jpeg buffer.
Save image to jpeg mime.
Save image to jpeg target.
Load JPEG-XL image.
Load JPEG-XL image.
Load JPEG-XL image.
Save image in JPEG-XL format.
Save image in JPEG-XL format.
Save image in JPEG-XL format.
Label regions in an image.
Calculate (a * in + b).
Cache an image as a set of lines.
Make a Laplacian of Gaussian image.
Load file with ImageMagick.
Load buffer with ImageMagick.
Save file with ImageMagick.
Save image to magick buffer.
Resample with a map image.
Map an image though a lut.
Make a butterworth filter.
Make a butterworth_band filter.
Make a butterworth ring filter.
Make fractal filter.
Make a gaussian filter.
Make a gaussian filter.
Make a gaussian ring filter.
Make an ideal filter.
Make an ideal band filter.
Make an ideal ring filter.
First-order match of two images.
Apply a math operation to an image.
Binary math operations.
Binary math operations with a constant.
Load mat from file.
Invert an matrix.
Load matrix.
Load matrix.
Print matrix.
Save image to matrix.
Save image to matrix.
Find image maximum.
Measure a set of patches on a colour chart.
Merge two images.
Find image minimum.
Morphology operation.
Mosaic two images.
First-order mosaic of two images.
Pick most-significant byte from an image.
Multiply two images.
Load NIfTI volume.
Load NIfTI volumes.
Save image to nifti file.
Load an OpenEXR image.
Load file with OpenSlide.
Load source with OpenSlide.
Load PDF from file.
Load PDF from buffer.
Load PDF from source.
Find threshold for percent of pixels.
Make a perlin noise image.
Calculate phase correlation.
Load png from file.
Load png from buffer.
Load png from source.
Save image to file as PNG.
Save image to buffer as PNG.
Save image to target as PNG.
Load ppm from file.
Load ppm base class.
Save image to ppm file.
Save to ppm.
Premultiply image alpha.
Find image profiles.
Load named ICC profile.
Find image projections.
Resample an image with a quadratic transform.
Unpack Radiance coding to float RGB.
Load a Radiance image from a file.
Load rad from buffer.
Load rad from source.
Save image to Radiance file.
Save image to Radiance buffer.
Save image to Radiance target.
Rank filter.
Load raw data from a file.
Save image to raw file.
Write raw image to file descriptor.
Linear recombination with matrix.
Reduce an image.
Shrink an image horizontally.
Shrink an image vertically.
Relational operation on two images.
Relational operations against a constant.
Remainder after integer division of two images.
Remainder after integer division of an image and a constant.
Replicate an image.
Resize an image.
Rotate an image.
Rotate an image.
Rotate an image by a number of degrees.
Perform a round function on an image.
Transform sRGB to HSV.
Convert an sRGB image to scRGB.
Convert scRGB to BW.
Transform scRGB to XYZ.
Convert an scRGB image to sRGB.
Check sequential access.
Unsharp masking for print.
Shrink an image.
Shrink an image horizontally.
Shrink an image vertically.
Unit vector of pixel.
Similarity transform of an image.
Make a 2D sine wave.
Extract an area from an image.
Sobel edge detector.
Spatial correlation.
Make displayable power spectrum.
Find many image stats.
Statistical difference.
Subsample an image.
Subtract two images.
Sum an array of images.
Load SVG with rsvg.
Load SVG with rsvg.
Load svg from source.
Find the index of the first non-zero pixel in tests.
Run an external command.
Make a text image.
Generate thumbnail from file.
Generate thumbnail from buffer.
Generate thumbnail from image.
Generate thumbnail from source.
Load tiff from file.
Load tiff from buffer.
Load tiff from source.
Save image to tiff file.
Save image to tiff buffer.
Save image to tiff target.
Cache an image as a set of tiles.
Build a look-up table.
Transpose3d an image.
Unpremultiply image alpha.
Load vips from file.
Load vips from source.
Save image to file in vips format.
Save image to target in vips format.
Load webp from file.
Load webp from buffer.
Load webp from source.
Save image to webp file.
Save image to webp buffer.
Save image to webp target.
Make a worley noise image.
Wrap image origin.
Make an image where pixel values are coordinates.
Make a zone plate.
Zoom an image.
- Lab2LabQ()¶
Transform float Lab to LabQ coding.
- Example:
out = in.Lab2LabQ()
- Lab2LabS()¶
Transform float Lab to signed short.
- Example:
out = in.Lab2LabS()
- Lab2XYZ(temp=list[float])¶
Transform CIELAB to XYZ.
- Example:
out = in.Lab2XYZ(temp=list[float])
- LabQ2Lab()¶
Unpack a LabQ image to float Lab.
- Example:
out = in.LabQ2Lab()
- LabQ2LabS()¶
Unpack a LabQ image to short Lab.
- Example:
out = in.LabQ2LabS()
- LabQ2sRGB()¶
Convert a LabQ image to sRGB.
- Example:
out = in.LabQ2sRGB()
- LabS2Lab()¶
Transform signed short Lab to float.
- Example:
out = in.LabS2Lab()
- LabS2LabQ()¶
Transform short Lab to LabQ coding.
- Example:
out = in.LabS2LabQ()
- XYZ2Lab(temp=list[float])¶
Transform XYZ to Lab.
- Example:
out = in.XYZ2Lab(temp=list[float])
- add(right)¶
Add two images.
- Example:
out = left.add(right)
- 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.
- Example:
out = in.affine(matrix, interpolate=GObject, oarea=list[int], odx=float, ody=float, idx=float, idy=float, background=list[float], premultiplied=bool, extend=Union[str, Extend])
- Parameters
matrix (list[float]) – Transformation matrix
interpolate (GObject) – Interpolate pixels with this
oarea (list[int]) – Area of output to generate
odx (float) – Horizontal output displacement
ody (float) – Vertical output displacement
idx (float) – Horizontal input displacement
idy (float) – Vertical input displacement
background (list[float]) – Background value
premultiplied (bool) – Images have premultiplied alpha
extend (Union[str, Extend]) – How to generate the extra pixels
- Return type
- Raises
Error –
- static analyzeload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load an Analyze6 image.
- Example:
out = pyvips.Image.analyzeload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static arrayjoin(in, across=int, shim=int, background=list[float], halign=Union[str, Align], valign=Union[str, Align], hspacing=int, vspacing=int)¶
Join an array of images.
- Example:
out = pyvips.Image.arrayjoin(in, across=int, shim=int, background=list[float], halign=Union[str, Align], valign=Union[str, Align], hspacing=int, vspacing=int)
- Parameters
in (list[Image]) – Array of input images
across (int) – Number of images across grid
shim (int) – Pixels between images
background (list[float]) – Colour for new pixels
halign (Union[str, Align]) – Align on the left, centre or right
valign (Union[str, Align]) – Align on the top, centre or bottom
hspacing (int) – Horizontal spacing between images
vspacing (int) – Vertical spacing between images
- Return type
- Raises
Error –
- autorot(angle=bool, flip=bool)¶
Autorotate image by exif tag.
- Example:
out = in.autorot()
- bandbool(boolean)¶
Boolean operation across image bands.
- Example:
out = in.bandbool(boolean)
- Parameters
boolean (Union[str, OperationBoolean]) – Boolean to perform
- Return type
- Raises
Error –
- bandfold(factor=int)¶
Fold up x axis into bands.
- Example:
out = in.bandfold(factor=int)
- bandjoin_const(c)¶
Append a constant band to an image.
- Example:
out = in.bandjoin_const(c)
- bandunfold(factor=int)¶
Unfold image bands into x axis.
- Example:
out = in.bandunfold(factor=int)
- static black(width, height, bands=int)¶
Make a black image.
- Example:
out = pyvips.Image.black(width, height, bands=int)
- boolean(right, boolean)¶
Boolean operation on two images.
- Example:
out = left.boolean(right, boolean)
- Parameters
right (Image) – Right-hand image argument
boolean (Union[str, OperationBoolean]) – Boolean to perform
- Return type
- Raises
Error –
- boolean_const(boolean, c)¶
Boolean operations against a constant.
- Example:
out = in.boolean_const(boolean, c)
- Parameters
boolean (Union[str, OperationBoolean]) – Boolean to perform
c (list[float]) – Array of constants
- Return type
- Raises
Error –
- 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)
- canny(sigma=float, precision=Union[str, Precision])¶
Canny edge detector.
- Example:
out = in.canny(sigma=float, precision=Union[str, Precision])
- case(cases)¶
Use pixel values to pick cases from an array of images.
- Example:
out = index.case(cases)
- cast(format, shift=bool)¶
Cast an image.
- Example:
out = in.cast(format, shift=bool)
- Parameters
format (Union[str, BandFormat]) – Format to cast to
shift (bool) – Shift integer values up and down
- Return type
- Raises
Error –
- colourspace(space, source_space=Union[str, Interpretation])¶
Convert to a new colorspace.
- Example:
out = in.colourspace(space, source_space=Union[str, Interpretation])
- Parameters
space (Union[str, Interpretation]) – Destination color space
source_space (Union[str, Interpretation]) – Source color space
- Return type
- Raises
Error –
- compass(mask, times=int, angle=Union[str, Angle45], combine=Union[str, Combine], precision=Union[str, Precision], layers=int, cluster=int)¶
Convolve with rotating mask.
- Example:
out = in.compass(mask, times=int, angle=Union[str, Angle45], combine=Union[str, Combine], precision=Union[str, Precision], layers=int, cluster=int)
- Parameters
mask (Image) – Input matrix image
times (int) – Rotate and convolve this many times
angle (Union[str, Angle45]) – Rotate mask by this much between convolutions
combine (Union[str, Combine]) – Combine convolution results like this
precision (Union[str, Precision]) – Convolve with this precision
layers (int) – Use this many layers in approximation
cluster (int) – Cluster lines closer than this in approximation
- Return type
- Raises
Error –
- complex(cmplx)¶
Perform a complex operation on an image.
- Example:
out = in.complex(cmplx)
- Parameters
cmplx (Union[str, OperationComplex]) – Complex to perform
- Return type
- Raises
Error –
- complex2(right, cmplx)¶
Complex binary operations on two images.
- Example:
out = left.complex2(right, cmplx)
- Parameters
right (Image) – Right-hand image argument
cmplx (Union[str, OperationComplex2]) – Binary complex operation to perform
- Return type
- Raises
Error –
- complexform(right)¶
Form a complex image from two real images.
- Example:
out = left.complexform(right)
- complexget(get)¶
Get a component from a complex image.
- Example:
out = in.complexget(get)
- Parameters
get (Union[str, OperationComplexget]) – Complex to perform
- Return type
- Raises
Error –
- static composite(in, mode, x=list[int], y=list[int], compositing_space=Union[str, Interpretation], premultiplied=bool)¶
Blend an array of images with an array of blend modes.
- Example:
out = pyvips.Image.composite(in, mode, x=list[int], y=list[int], compositing_space=Union[str, Interpretation], premultiplied=bool)
- Parameters
in (list[Image]) – Array of input images
mode (list[int]) – Array of VipsBlendMode to join with
x (list[int]) – Array of x coordinates to join at
y (list[int]) – Array of y coordinates to join at
compositing_space (Union[str, Interpretation]) – Composite images in this colour space
premultiplied (bool) – Images have premultiplied alpha
- Return type
- Raises
Error –
- composite2(overlay, mode, x=int, y=int, compositing_space=Union[str, Interpretation], premultiplied=bool)¶
Blend a pair of images with a blend mode.
- Example:
out = base.composite2(overlay, mode, x=int, y=int, compositing_space=Union[str, Interpretation], premultiplied=bool)
- Parameters
overlay (Image) – Overlay image
mode (Union[str, BlendMode]) – VipsBlendMode to join with
x (int) – x position of overlay
y (int) – y position of overlay
compositing_space (Union[str, Interpretation]) – Composite images in this colour space
premultiplied (bool) – Images have premultiplied alpha
- Return type
- Raises
Error –
- conv(mask, precision=Union[str, Precision], layers=int, cluster=int)¶
Convolution operation.
- Example:
out = in.conv(mask, precision=Union[str, Precision], layers=int, cluster=int)
- conva(mask, layers=int, cluster=int)¶
Approximate integer convolution.
- Example:
out = in.conva(mask, layers=int, cluster=int)
- convasep(mask, layers=int)¶
Approximate separable integer convolution.
- Example:
out = in.convasep(mask, layers=int)
- convf(mask)¶
Float convolution operation.
- Example:
out = in.convf(mask)
- convi(mask)¶
Int convolution operation.
- Example:
out = in.convi(mask)
- convsep(mask, precision=Union[str, Precision], layers=int, cluster=int)¶
Seperable convolution operation.
- Example:
out = in.convsep(mask, precision=Union[str, Precision], layers=int, cluster=int)
- copy(width=int, height=int, bands=int, format=Union[str, BandFormat], coding=Union[str, Coding], interpretation=Union[str, Interpretation], xres=float, yres=float, xoffset=int, yoffset=int)¶
Copy an image.
- Example:
out = in.copy(width=int, height=int, bands=int, format=Union[str, BandFormat], coding=Union[str, Coding], interpretation=Union[str, Interpretation], xres=float, yres=float, xoffset=int, yoffset=int)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
bands (int) – Number of bands in image
format (Union[str, BandFormat]) – Pixel format in image
coding (Union[str, Coding]) – Pixel coding
interpretation (Union[str, Interpretation]) – Pixel interpretation
xres (float) – Horizontal resolution in pixels/mm
yres (float) – Vertical resolution in pixels/mm
xoffset (int) – Horizontal offset of origin
yoffset (int) – Vertical offset of origin
- Return type
- Raises
Error –
- countlines(direction)¶
Count lines in an image.
- Example:
nolines = in.countlines(direction)
- crop(left, top, width, height)¶
Extract an area from an image.
- Example:
out = input.crop(left, top, width, height)
- static csvload(filename, skip=int, lines=int, whitespace=str, separator=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load csv.
- Example:
out = pyvips.Image.csvload(filename, skip=int, lines=int, whitespace=str, separator=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
skip (int) – Skip this many lines at the start of the file
lines (int) – Read this many lines from the file
whitespace (str) – Set of whitespace characters
separator (str) – Set of separator characters
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static csvload_source(source, skip=int, lines=int, whitespace=str, separator=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load csv.
- Example:
out = pyvips.Image.csvload_source(source, skip=int, lines=int, whitespace=str, separator=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
skip (int) – Skip this many lines at the start of the file
lines (int) – Read this many lines from the file
whitespace (str) – Set of whitespace characters
separator (str) – Set of separator characters
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- csvsave(filename, separator=str, strip=bool, background=list[float], page_height=int)¶
Save image to csv.
- Example:
in.csvsave(filename, separator=str, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
separator (str) – Separator characters
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- csvsave_target(target, separator=str, strip=bool, background=list[float], page_height=int)¶
Save image to csv.
- Example:
in.csvsave_target(target, separator=str, strip=bool, background=list[float], page_height=int)
- dE00(right)¶
Calculate dE00.
- Example:
out = left.dE00(right)
- dE76(right)¶
Calculate dE76.
- Example:
out = left.dE76(right)
- dECMC(right)¶
Calculate dECMC.
- Example:
out = left.dECMC(right)
- deviate()¶
Find image standard deviation.
- Example:
out = in.deviate()
- Return type
float
- Raises
Error –
- divide(right)¶
Divide two images.
- Example:
out = left.divide(right)
- draw_circle(ink, cx, cy, radius, fill=bool)¶
Draw a circle on an image.
- Example:
image = image.draw_circle(ink, cx, cy, radius, fill=bool)
- draw_flood(ink, x, y, test=Image, equal=bool, left=bool, top=bool, width=bool, height=bool)¶
Flood-fill an area.
- Example:
image = image.draw_flood(ink, x, y, test=Image, equal=bool)
- Parameters
ink (list[float]) – Color for pixels
x (int) – DrawFlood start point
y (int) – DrawFlood start point
test (Image) – Test pixels in this image
equal (bool) – DrawFlood while equal to edge
left (bool) – enable output: Left edge of modified area
top (bool) – enable output: Top edge of modified area
width (bool) – enable output: Width of modified area
height (bool) – enable output: Height of modified area
- Return type
- Raises
Error –
- draw_image(sub, x, y, mode=Union[str, CombineMode])¶
Paint an image into another image.
- Example:
image = image.draw_image(sub, x, y, mode=Union[str, CombineMode])
- Parameters
sub (Image) – Sub-image to insert into main image
x (int) – Draw image here
y (int) – Draw image here
mode (Union[str, CombineMode]) – Combining mode
- Return type
- Raises
Error –
- draw_line(ink, x1, y1, x2, y2)¶
Draw a line on an image.
- Example:
image = image.draw_line(ink, x1, y1, x2, y2)
- draw_mask(ink, mask, x, y)¶
Draw a mask on an image.
- Example:
image = image.draw_mask(ink, mask, x, y)
- draw_rect(ink, left, top, width, height, fill=bool)¶
Paint a rectangle on an image.
- Example:
image = image.draw_rect(ink, left, top, width, height, fill=bool)
- draw_smudge(left, top, width, height)¶
Blur a rectangle on an image.
- Example:
image = image.draw_smudge(left, top, width, height)
- dzsave(filename, basename=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, no_strip=bool, id=str, strip=bool, background=list[float], page_height=int)¶
Save image to deepzoom file.
- Example:
in.dzsave(filename, basename=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, no_strip=bool, id=str, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
basename (str) – Base name to save to
layout (Union[str, ForeignDzLayout]) – Directory layout
suffix (str) – Filename suffix for tiles
overlap (int) – Tile overlap in pixels
tile_size (int) – Tile size in pixels
centre (bool) – Center image in tile
depth (Union[str, ForeignDzDepth]) – Pyramid depth
angle (Union[str, Angle]) – Rotate image during save
container (Union[str, ForeignDzContainer]) – Pyramid container type
compression (int) – ZIP deflate compression level
region_shrink (Union[str, RegionShrink]) – Method to shrink regions
skip_blanks (int) – Skip tiles which are nearly equal to the background
no_strip (bool) – Don’t strip tile metadata
id (str) – Resource ID
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- dzsave_buffer(basename=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, no_strip=bool, id=str, strip=bool, background=list[float], page_height=int)¶
Save image to dz buffer.
- Example:
buffer = in.dzsave_buffer(basename=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, no_strip=bool, id=str, strip=bool, background=list[float], page_height=int)
- Parameters
basename (str) – Base name to save to
layout (Union[str, ForeignDzLayout]) – Directory layout
suffix (str) – Filename suffix for tiles
overlap (int) – Tile overlap in pixels
tile_size (int) – Tile size in pixels
centre (bool) – Center image in tile
depth (Union[str, ForeignDzDepth]) – Pyramid depth
angle (Union[str, Angle]) – Rotate image during save
container (Union[str, ForeignDzContainer]) – Pyramid container type
compression (int) – ZIP deflate compression level
region_shrink (Union[str, RegionShrink]) – Method to shrink regions
skip_blanks (int) – Skip tiles which are nearly equal to the background
no_strip (bool) – Don’t strip tile metadata
id (str) – Resource ID
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- dzsave_target(target, basename=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, no_strip=bool, id=str, strip=bool, background=list[float], page_height=int)¶
Save image to deepzoom target.
- Example:
in.dzsave_target(target, basename=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, no_strip=bool, id=str, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
basename (str) – Base name to save to
layout (Union[str, ForeignDzLayout]) – Directory layout
suffix (str) – Filename suffix for tiles
overlap (int) – Tile overlap in pixels
tile_size (int) – Tile size in pixels
centre (bool) – Center image in tile
depth (Union[str, ForeignDzDepth]) – Pyramid depth
angle (Union[str, Angle]) – Rotate image during save
container (Union[str, ForeignDzContainer]) – Pyramid container type
compression (int) – ZIP deflate compression level
region_shrink (Union[str, RegionShrink]) – Method to shrink regions
skip_blanks (int) – Skip tiles which are nearly equal to the background
no_strip (bool) – Don’t strip tile metadata
id (str) – Resource ID
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- embed(x, y, width, height, extend=Union[str, Extend], background=list[float])¶
Embed an image in a larger image.
- Example:
out = in.embed(x, y, width, height, extend=Union[str, Extend], background=list[float])
- Parameters
x (int) – Left edge of input in output
y (int) – Top edge of input in output
width (int) – Image width in pixels
height (int) – Image height in pixels
extend (Union[str, Extend]) – How to generate the extra pixels
background (list[float]) – Color for background pixels
- Return type
- Raises
Error –
- extract_area(left, top, width, height)¶
Extract an area from an image.
- Example:
out = input.extract_area(left, top, width, height)
- extract_band(band, n=int)¶
Extract band from an image.
- Example:
out = in.extract_band(band, n=int)
- static eye(width, height, uchar=bool, factor=float)¶
Make an image showing the eye’s spatial response.
- Example:
out = pyvips.Image.eye(width, height, uchar=bool, factor=float)
- falsecolour()¶
False-color an image.
- Example:
out = in.falsecolour()
- fastcor(ref)¶
Fast correlation.
- Example:
out = in.fastcor(ref)
- fill_nearest(distance=bool)¶
Fill image zeros with nearest non-zero pixel.
- Example:
out = in.fill_nearest()
- find_trim(threshold=float, background=list[float])¶
Search an image for non-edge areas.
- Example:
left, top, width, height = in.find_trim(threshold=float, background=list[float])
- Parameters
threshold (float) – Object threshold
background (list[float]) – Color for background pixels
- Return type
list[int, int, int, int]
- Raises
Error –
- static fitsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load a FITS image.
- Example:
out = pyvips.Image.fitsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static fitsload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load FITS from a source.
- Example:
out = pyvips.Image.fitsload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- fitssave(filename, strip=bool, background=list[float], page_height=int)¶
Save image to fits file.
- Example:
in.fitssave(filename, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- flatten(background=list[float], max_alpha=float)¶
Flatten alpha out of an image.
- Example:
out = in.flatten(background=list[float], max_alpha=float)
- flip(direction)¶
Flip an image.
- Example:
out = in.flip(direction)
- float2rad()¶
Transform float RGB to Radiance coding.
- Example:
out = in.float2rad()
- static fractsurf(width, height, fractal_dimension)¶
Make a fractal surface.
- Example:
out = pyvips.Image.fractsurf(width, height, fractal_dimension)
- freqmult(mask)¶
Frequency-domain filtering.
- Example:
out = in.freqmult(mask)
- gamma(exponent=float)¶
Gamma an image.
- Example:
out = in.gamma(exponent=float)
- gaussblur(sigma, min_ampl=float, precision=Union[str, Precision])¶
Gaussian blur.
- Example:
out = in.gaussblur(sigma, min_ampl=float, precision=Union[str, Precision])
- static gaussmat(sigma, min_ampl, separable=bool, precision=Union[str, Precision])¶
Make a gaussian image.
- Example:
out = pyvips.Image.gaussmat(sigma, min_ampl, separable=bool, precision=Union[str, Precision])
- static gaussnoise(width, height, sigma=float, mean=float, seed=int)¶
Make a gaussnoise image.
- Example:
out = pyvips.Image.gaussnoise(width, height, sigma=float, mean=float, seed=int)
- getpoint(x, y)¶
Read a point from an image.
- Example:
out_array = in.getpoint(x, y)
- Parameters
x (int) – Point to read
y (int) – Point to read
- Return type
list[float]
- Raises
Error –
- static gifload(filename, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load GIF with libnsgif.
- Example:
out = pyvips.Image.gifload(filename, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
n (int) – Load this many pages
page (int) – Load this page from the file
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static gifload_buffer(buffer, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load GIF with libnsgif.
- Example:
out = pyvips.Image.gifload_buffer(buffer, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
n (int) – Load this many pages
page (int) – Load this page from the file
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static gifload_source(source, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load gif from source.
- Example:
out = pyvips.Image.gifload_source(source, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
n (int) – Load this many pages
page (int) – Load this page from the file
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reoptimise=bool, interpalette_maxerror=float, strip=bool, background=list[float], page_height=int)¶
Save as gif.
- Example:
in.gifsave(filename, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reoptimise=bool, interpalette_maxerror=float, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
dither (float) – Amount of dithering
effort (int) – Quantisation effort
bitdepth (int) – Number of bits per pixel
interframe_maxerror (float) – Maximum inter-frame error for transparency
reoptimise (bool) – Reoptimise colour palettes
interpalette_maxerror (float) – Maximum inter-palette error for palette reusage
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reoptimise=bool, interpalette_maxerror=float, strip=bool, background=list[float], page_height=int)¶
Save as gif.
- Example:
buffer = in.gifsave_buffer(dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reoptimise=bool, interpalette_maxerror=float, strip=bool, background=list[float], page_height=int)
- Parameters
dither (float) – Amount of dithering
effort (int) – Quantisation effort
bitdepth (int) – Number of bits per pixel
interframe_maxerror (float) – Maximum inter-frame error for transparency
reoptimise (bool) – Reoptimise colour palettes
interpalette_maxerror (float) – Maximum inter-palette error for palette reusage
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reoptimise=bool, interpalette_maxerror=float, strip=bool, background=list[float], page_height=int)¶
Save as gif.
- Example:
in.gifsave_target(target, dither=float, effort=int, bitdepth=int, interframe_maxerror=float, reoptimise=bool, interpalette_maxerror=float, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
dither (float) – Amount of dithering
effort (int) – Quantisation effort
bitdepth (int) – Number of bits per pixel
interframe_maxerror (float) – Maximum inter-frame error for transparency
reoptimise (bool) – Reoptimise colour palettes
interpalette_maxerror (float) – Maximum inter-palette error for palette reusage
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- globalbalance(gamma=float, int_output=bool)¶
Global balance an image mosaic.
- Example:
out = in.globalbalance(gamma=float, int_output=bool)
- gravity(direction, width, height, extend=Union[str, Extend], background=list[float])¶
Place an image within a larger image with a certain gravity.
- Example:
out = in.gravity(direction, width, height, extend=Union[str, Extend], background=list[float])
- Parameters
direction (Union[str, CompassDirection]) – Direction to place image within width/height
width (int) – Image width in pixels
height (int) – Image height in pixels
extend (Union[str, Extend]) – How to generate the extra pixels
background (list[float]) – Color for background pixels
- Return type
- Raises
Error –
- static grey(width, height, uchar=bool)¶
Make a grey ramp image.
- Example:
out = pyvips.Image.grey(width, height, uchar=bool)
- grid(tile_height, across, down)¶
Grid an image.
- Example:
out = in.grid(tile_height, across, down)
- static heifload(filename, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load a HEIF image.
- Example:
out = pyvips.Image.heifload(filename, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
page (int) – Load this page from the file
n (int) – Load this many pages
thumbnail (bool) – Fetch thumbnail image
unlimited (bool) – Remove all denial of service limits
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static heifload_buffer(buffer, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load a HEIF image.
- Example:
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])
- Parameters
buffer (str) – Buffer to load from
page (int) – Load this page from the file
n (int) – Load this many pages
thumbnail (bool) – Fetch thumbnail image
unlimited (bool) – Remove all denial of service limits
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static heifload_source(source, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load a HEIF image.
- Example:
out = pyvips.Image.heifload_source(source, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
page (int) – Load this page from the file
n (int) – Load this many pages
thumbnail (bool) – Fetch thumbnail image
unlimited (bool) – Remove all denial of service limits
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- heifsave(filename, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)¶
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], strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
Q (int) – Q factor
bitdepth (int) – Number of bits per pixel
lossless (bool) – Enable lossless compression
compression (Union[str, ForeignHeifCompression]) – Compression format
effort (int) – CPU effort
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- heifsave_buffer(Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)¶
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], strip=bool, background=list[float], page_height=int)
- Parameters
Q (int) – Q factor
bitdepth (int) – Number of bits per pixel
lossless (bool) – Enable lossless compression
compression (Union[str, ForeignHeifCompression]) – Compression format
effort (int) – CPU effort
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- heifsave_target(target, Q=int, bitdepth=int, lossless=bool, compression=Union[str, ForeignHeifCompression], effort=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)¶
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], strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
Q (int) – Q factor
bitdepth (int) – Number of bits per pixel
lossless (bool) – Enable lossless compression
compression (Union[str, ForeignHeifCompression]) – Compression format
effort (int) – CPU effort
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- hist_entropy()¶
Estimate image entropy.
- Example:
out = in.hist_entropy()
- Return type
float
- Raises
Error –
- hist_equal(band=int)¶
Histogram equalisation.
- Example:
out = in.hist_equal(band=int)
- hist_find(band=int)¶
Find image histogram.
- Example:
out = in.hist_find(band=int)
- hist_find_indexed(index, combine=Union[str, Combine])¶
Find indexed image histogram.
- Example:
out = in.hist_find_indexed(index, combine=Union[str, Combine])
- hist_find_ndim(bins=int)¶
Find n-dimensional image histogram.
- Example:
out = in.hist_find_ndim(bins=int)
- hist_ismonotonic()¶
Test for monotonicity.
- Example:
monotonic = in.hist_ismonotonic()
- Return type
bool
- Raises
Error –
- hist_local(width, height, max_slope=int)¶
Local histogram equalisation.
- Example:
out = in.hist_local(width, height, max_slope=int)
- hist_match(ref)¶
Match two histograms.
- Example:
out = in.hist_match(ref)
- hough_circle(scale=int, min_radius=int, max_radius=int)¶
Find hough circle transform.
- Example:
out = in.hough_circle(scale=int, min_radius=int, max_radius=int)
- hough_line(width=int, height=int)¶
Find hough line transform.
- Example:
out = in.hough_line(width=int, height=int)
- icc_export(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, output_profile=str, 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)
- Parameters
- Return type
- Raises
Error –
- icc_import(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str)¶
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)
- Parameters
- Return type
- Raises
Error –
- icc_transform(output_profile, pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str, 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)
- Parameters
output_profile (str) – Filename to load output profile from
pcs (Union[str, PCS]) – Set Profile Connection Space
intent (Union[str, Intent]) – Rendering intent
black_point_compensation (bool) – Enable black point compensation
embedded (bool) – Use embedded input profile, if available
input_profile (str) – Filename to load input profile from
depth (int) – Output device space depth in bits
- Return type
- Raises
Error –
- static identity(bands=int, ushort=bool, size=int)¶
Make a 1D image where pixel values are indexes.
- Example:
out = pyvips.Image.identity(bands=int, ushort=bool, size=int)
- insert(sub, x, y, expand=bool, background=list[float])¶
Insert image @sub into @main at @x, @y.
- Example:
out = main.insert(sub, x, y, expand=bool, background=list[float])
- invertlut(size=int)¶
Build an inverted look-up table.
- Example:
out = in.invertlut(size=int)
- invfft(real=bool)¶
Inverse FFT.
- Example:
out = in.invfft(real=bool)
- join(in2, direction, expand=bool, shim=int, background=list[float], align=Union[str, Align])¶
Join a pair of images.
- Example:
out = in1.join(in2, direction, expand=bool, shim=int, background=list[float], align=Union[str, Align])
- Parameters
in2 (Image) – Second input image
direction (Union[str, Direction]) – Join left-right or up-down
expand (bool) – Expand output to hold all of both inputs
shim (int) – Pixels between images
background (list[float]) – Colour for new pixels
align (Union[str, Align]) – Align on the low, centre or high coordinate edge
- Return type
- Raises
Error –
- static jp2kload(filename, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load JPEG2000 image.
- Example:
out = pyvips.Image.jp2kload(filename, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static jp2kload_buffer(buffer, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load JPEG2000 image.
- Example:
out = pyvips.Image.jp2kload_buffer(buffer, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static jp2kload_source(source, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load JPEG2000 image.
- Example:
out = pyvips.Image.jp2kload_source(source, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- jp2ksave(filename, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)¶
Save image in JPEG2000 format.
- Example:
in.jp2ksave(filename, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to load from
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
lossless (bool) – Enable lossless compression
Q (int) – Q factor
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- jp2ksave_buffer(tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)¶
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], strip=bool, background=list[float], page_height=int)
- Parameters
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
lossless (bool) – Enable lossless compression
Q (int) – Q factor
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- jp2ksave_target(target, tile_width=int, tile_height=int, lossless=bool, Q=int, subsample_mode=Union[str, ForeignSubsample], strip=bool, background=list[float], page_height=int)¶
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], strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
lossless (bool) – Enable lossless compression
Q (int) – Q factor
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- static jpegload(filename, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load jpeg from file.
- Example:
out = pyvips.Image.jpegload(filename, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
shrink (int) – Shrink factor on load
autorotate (bool) – Rotate image using exif orientation
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static jpegload_buffer(buffer, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load jpeg from buffer.
- Example:
out = pyvips.Image.jpegload_buffer(buffer, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
shrink (int) – Shrink factor on load
autorotate (bool) – Rotate image using exif orientation
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static jpegload_source(source, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load image from jpeg source.
- Example:
out = pyvips.Image.jpegload_source(source, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
shrink (int) – Shrink factor on load
autorotate (bool) – Rotate image using exif orientation
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- 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, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
Q (int) – Q factor
profile (str) – ICC profile to embed
optimize_coding (bool) – Compute optimal Huffman coding tables
interlace (bool) – Generate an interlaced (progressive) jpeg
trellis_quant (bool) – Apply trellis quantisation to each 8x8 block
overshoot_deringing (bool) – Apply overshooting to samples with extreme values
optimize_scans (bool) – Split spectrum of DCT coefficients into separate scans
quant_table (int) – Use predefined quantization table with given index
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
restart_interval (int) – Add restart markers every specified number of mcu
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- 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, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
Q (int) – Q factor
profile (str) – ICC profile to embed
optimize_coding (bool) – Compute optimal Huffman coding tables
interlace (bool) – Generate an interlaced (progressive) jpeg
trellis_quant (bool) – Apply trellis quantisation to each 8x8 block
overshoot_deringing (bool) – Apply overshooting to samples with extreme values
optimize_scans (bool) – Split spectrum of DCT coefficients into separate scans
quant_table (int) – Use predefined quantization table with given index
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
restart_interval (int) – Add restart markers every specified number of mcu
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- 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, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
Q (int) – Q factor
profile (str) – ICC profile to embed
optimize_coding (bool) – Compute optimal Huffman coding tables
interlace (bool) – Generate an interlaced (progressive) jpeg
trellis_quant (bool) – Apply trellis quantisation to each 8x8 block
overshoot_deringing (bool) – Apply overshooting to samples with extreme values
optimize_scans (bool) – Split spectrum of DCT coefficients into separate scans
quant_table (int) – Use predefined quantization table with given index
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
restart_interval (int) – Add restart markers every specified number of mcu
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- 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, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
Q (int) – Q factor
profile (str) – ICC profile to embed
optimize_coding (bool) – Compute optimal Huffman coding tables
interlace (bool) – Generate an interlaced (progressive) jpeg
trellis_quant (bool) – Apply trellis quantisation to each 8x8 block
overshoot_deringing (bool) – Apply overshooting to samples with extreme values
optimize_scans (bool) – Split spectrum of DCT coefficients into separate scans
quant_table (int) – Use predefined quantization table with given index
subsample_mode (Union[str, ForeignSubsample]) – Select chroma subsample operation mode
restart_interval (int) – Add restart markers every specified number of mcu
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- static jxlload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load JPEG-XL image.
- Example:
out = pyvips.Image.jxlload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static jxlload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load JPEG-XL image.
- Example:
out = pyvips.Image.jxlload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static jxlload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load JPEG-XL image.
- Example:
out = pyvips.Image.jxlload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)¶
Save image in JPEG-XL format.
- Example:
in.jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to load from
tier (int) – Decode speed tier
distance (float) – Target butteraugli distance
effort (int) – Encoding effort
lossless (bool) – Enable lossless compression
Q (int) – Quality factor
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)¶
Save image in JPEG-XL format.
- Example:
buffer = in.jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)
- Parameters
tier (int) – Decode speed tier
distance (float) – Target butteraugli distance
effort (int) – Encoding effort
lossless (bool) – Enable lossless compression
Q (int) – Quality factor
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)¶
Save image in JPEG-XL format.
- Example:
in.jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
tier (int) – Decode speed tier
distance (float) – Target butteraugli distance
effort (int) – Encoding effort
lossless (bool) – Enable lossless compression
Q (int) – Quality factor
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- labelregions(segments=bool)¶
Label regions in an image.
- Example:
mask = in.labelregions()
- linear(a, b, uchar=bool)¶
Calculate (a * in + b).
- Example:
out = in.linear(a, b, uchar=bool)
- linecache(tile_height=int, access=Union[str, Access], threaded=bool, persistent=bool)¶
Cache an image as a set of lines.
- Example:
out = in.linecache(tile_height=int, access=Union[str, Access], threaded=bool, persistent=bool)
- static logmat(sigma, min_ampl, separable=bool, precision=Union[str, Precision])¶
Make a Laplacian of Gaussian image.
- Example:
out = pyvips.Image.logmat(sigma, min_ampl, separable=bool, precision=Union[str, Precision])
- static magickload(filename, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load file with ImageMagick.
- Example:
out = pyvips.Image.magickload(filename, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
density (str) – Canvas resolution for rendering vector formats like SVG
page (int) – Load this page from the file
n (int) – Load this many pages
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static magickload_buffer(buffer, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load buffer with ImageMagick.
- Example:
out = pyvips.Image.magickload_buffer(buffer, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
density (str) – Canvas resolution for rendering vector formats like SVG
page (int) – Load this page from the file
n (int) – Load this many pages
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)¶
Save file with ImageMagick.
- Example:
in.magicksave(filename, format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
format (str) – Format to save in
quality (int) – Quality to use
optimize_gif_frames (bool) – Apply GIF frames optimization
optimize_gif_transparency (bool) – Apply GIF transparency optimization
bitdepth (int) – Number of bits per pixel
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)¶
Save image to magick buffer.
- Example:
buffer = in.magicksave_buffer(format=str, quality=int, optimize_gif_frames=bool, optimize_gif_transparency=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)
- Parameters
format (str) – Format to save in
quality (int) – Quality to use
optimize_gif_frames (bool) – Apply GIF frames optimization
optimize_gif_transparency (bool) – Apply GIF transparency optimization
bitdepth (int) – Number of bits per pixel
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- mapim(index, interpolate=GObject, background=list[float], premultiplied=bool, extend=Union[str, Extend])¶
Resample with a map image.
- Example:
out = in.mapim(index, interpolate=GObject, background=list[float], premultiplied=bool, extend=Union[str, Extend])
- maplut(lut, band=int)¶
Map an image though a lut.
- Example:
out = in.maplut(lut, band=int)
- static mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make a butterworth filter.
- Example:
out = pyvips.Image.mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
order (float) – Filter order
frequency_cutoff (float) – Frequency cutoff
amplitude_cutoff (float) – Amplitude cutoff
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make a butterworth_band filter.
- Example:
out = pyvips.Image.mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
order (float) – Filter order
frequency_cutoff_x (float) – Frequency cutoff x
frequency_cutoff_y (float) – Frequency cutoff y
radius (float) – Radius of circle
amplitude_cutoff (float) – Amplitude cutoff
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make a butterworth ring filter.
- Example:
out = pyvips.Image.mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
order (float) – Filter order
frequency_cutoff (float) – Frequency cutoff
amplitude_cutoff (float) – Amplitude cutoff
ringwidth (float) – Ringwidth
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_fractal(width, height, fractal_dimension, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make fractal filter.
- Example:
out = pyvips.Image.mask_fractal(width, height, fractal_dimension, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
fractal_dimension (float) – Fractal dimension
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make a gaussian filter.
- Example:
out = pyvips.Image.mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
frequency_cutoff (float) – Frequency cutoff
amplitude_cutoff (float) – Amplitude cutoff
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make a gaussian filter.
- Example:
out = pyvips.Image.mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
frequency_cutoff_x (float) – Frequency cutoff x
frequency_cutoff_y (float) – Frequency cutoff y
radius (float) – Radius of circle
amplitude_cutoff (float) – Amplitude cutoff
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make a gaussian ring filter.
- Example:
out = pyvips.Image.mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
frequency_cutoff (float) – Frequency cutoff
amplitude_cutoff (float) – Amplitude cutoff
ringwidth (float) – Ringwidth
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_ideal(width, height, frequency_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make an ideal filter.
- Example:
out = pyvips.Image.mask_ideal(width, height, frequency_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
frequency_cutoff (float) – Frequency cutoff
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make an ideal band filter.
- Example:
out = pyvips.Image.mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
frequency_cutoff_x (float) – Frequency cutoff x
frequency_cutoff_y (float) – Frequency cutoff y
radius (float) – Radius of circle
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- static mask_ideal_ring(width, height, frequency_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)¶
Make an ideal ring filter.
- Example:
out = pyvips.Image.mask_ideal_ring(width, height, frequency_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)
- Parameters
width (int) – Image width in pixels
height (int) – Image height in pixels
frequency_cutoff (float) – Frequency cutoff
ringwidth (float) – Ringwidth
uchar (bool) – Output an unsigned char image
nodc (bool) – Remove DC component
reject (bool) – Invert the sense of the filter
optical (bool) – Rotate quadrants to optical space
- Return type
- Raises
Error –
- match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow=int, harea=int, search=bool, interpolate=GObject)¶
First-order match of two images.
- Example:
out = ref.match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow=int, harea=int, search=bool, interpolate=GObject)
- Parameters
sec (Image) – Secondary image
xr1 (int) – Position of first reference tie-point
yr1 (int) – Position of first reference tie-point
xs1 (int) – Position of first secondary tie-point
ys1 (int) – Position of first secondary tie-point
xr2 (int) – Position of second reference tie-point
yr2 (int) – Position of second reference tie-point
xs2 (int) – Position of second secondary tie-point
ys2 (int) – Position of second secondary tie-point
hwindow (int) – Half window size
harea (int) – Half area size
search (bool) – Search to improve tie-points
interpolate (GObject) – Interpolate pixels with this
- Return type
- Raises
Error –
- math(math)¶
Apply a math operation to an image.
- Example:
out = in.math(math)
- Parameters
math (Union[str, OperationMath]) – Math to perform
- Return type
- Raises
Error –
- math2(right, math2)¶
Binary math operations.
- Example:
out = left.math2(right, math2)
- Parameters
right (Image) – Right-hand image argument
math2 (Union[str, OperationMath2]) – Math to perform
- Return type
- Raises
Error –
- math2_const(math2, c)¶
Binary math operations with a constant.
- Example:
out = in.math2_const(math2, c)
- Parameters
math2 (Union[str, OperationMath2]) – Math to perform
c (list[float]) – Array of constants
- Return type
- Raises
Error –
- static matload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load mat from file.
- Example:
out = pyvips.Image.matload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static matrixload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load matrix.
- Example:
out = pyvips.Image.matrixload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static matrixload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load matrix.
- Example:
out = pyvips.Image.matrixload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- matrixprint(strip=bool, background=list[float], page_height=int)¶
Print matrix.
- Example:
in.matrixprint(strip=bool, background=list[float], page_height=int)
- Parameters
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- matrixsave(filename, strip=bool, background=list[float], page_height=int)¶
Save image to matrix.
- Example:
in.matrixsave(filename, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- matrixsave_target(target, strip=bool, background=list[float], page_height=int)¶
Save image to matrix.
- Example:
in.matrixsave_target(target, strip=bool, background=list[float], page_height=int)
- max(size=int, x=bool, y=bool, out_array=bool, x_array=bool, y_array=bool)¶
Find image maximum.
- Example:
out = in.max(size=int)
- Parameters
size (int) – Number of maximum values to find
x (bool) – enable output: Horizontal position of maximum
y (bool) – enable output: Vertical position of maximum
out_array (bool) – enable output: Array of output values
x_array (bool) – enable output: Array of horizontal positions
y_array (bool) – enable output: Array of vertical positions
- Return type
float or list[float, Dict[str, mixed]]
- Raises
Error –
- measure(h, v, left=int, top=int, width=int, height=int)¶
Measure a set of patches on a color chart.
- Example:
out = in.measure(h, v, left=int, top=int, width=int, height=int)
- merge(sec, direction, dx, dy, mblend=int)¶
Merge two images.
- Example:
out = ref.merge(sec, direction, dx, dy, mblend=int)
- min(size=int, x=bool, y=bool, out_array=bool, x_array=bool, y_array=bool)¶
Find image minimum.
- Example:
out = in.min(size=int)
- Parameters
size (int) – Number of minimum values to find
x (bool) – enable output: Horizontal position of minimum
y (bool) – enable output: Vertical position of minimum
out_array (bool) – enable output: Array of output values
x_array (bool) – enable output: Array of horizontal positions
y_array (bool) – enable output: Array of vertical positions
- Return type
float or list[float, Dict[str, mixed]]
- Raises
Error –
- morph(mask, morph)¶
Morphology operation.
- Example:
out = in.morph(mask, morph)
- Parameters
mask (Image) – Input matrix image
morph (Union[str, OperationMorphology]) – Morphological operation to perform
- Return type
- Raises
Error –
- mosaic(sec, direction, xref, yref, xsec, ysec, hwindow=int, harea=int, mblend=int, bandno=int, dx0=bool, dy0=bool, scale1=bool, angle1=bool, dy1=bool, dx1=bool)¶
Mosaic two images.
- Example:
out = ref.mosaic(sec, direction, xref, yref, xsec, ysec, hwindow=int, harea=int, mblend=int, bandno=int)
- Parameters
sec (Image) – Secondary image
direction (Union[str, Direction]) – Horizontal or vertical mosaic
xref (int) – Position of reference tie-point
yref (int) – Position of reference tie-point
xsec (int) – Position of secondary tie-point
ysec (int) – Position of secondary tie-point
hwindow (int) – Half window size
harea (int) – Half area size
mblend (int) – Maximum blend size
bandno (int) – Band to search for features on
dx0 (bool) – enable output: Detected integer offset
dy0 (bool) – enable output: Detected integer offset
scale1 (bool) – enable output: Detected scale
angle1 (bool) – enable output: Detected rotation
dy1 (bool) – enable output: Detected first-order displacement
dx1 (bool) – enable output: Detected first-order displacement
- Return type
- Raises
Error –
- mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow=int, harea=int, search=bool, interpolate=GObject, mblend=int)¶
First-order mosaic of two images.
- Example:
out = ref.mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow=int, harea=int, search=bool, interpolate=GObject, mblend=int)
- Parameters
sec (Image) – Secondary image
direction (Union[str, Direction]) – Horizontal or vertical mosaic
xr1 (int) – Position of first reference tie-point
yr1 (int) – Position of first reference tie-point
xs1 (int) – Position of first secondary tie-point
ys1 (int) – Position of first secondary tie-point
xr2 (int) – Position of second reference tie-point
yr2 (int) – Position of second reference tie-point
xs2 (int) – Position of second secondary tie-point
ys2 (int) – Position of second secondary tie-point
hwindow (int) – Half window size
harea (int) – Half area size
search (bool) – Search to improve tie-points
interpolate (GObject) – Interpolate pixels with this
mblend (int) – Maximum blend size
- Return type
- Raises
Error –
- msb(band=int)¶
Pick most-significant byte from an image.
- Example:
out = in.msb(band=int)
- multiply(right)¶
Multiply two images.
- Example:
out = left.multiply(right)
- static niftiload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load NIfTI volume.
- Example:
out = pyvips.Image.niftiload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static niftiload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load NIfTI volumes.
- Example:
out = pyvips.Image.niftiload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- niftisave(filename, strip=bool, background=list[float], page_height=int)¶
Save image to nifti file.
- Example:
in.niftisave(filename, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- static openexrload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load an OpenEXR image.
- Example:
out = pyvips.Image.openexrload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static openslideload(filename, attach_associated=bool, level=int, autocrop=bool, associated=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load file with OpenSlide.
- Example:
out = pyvips.Image.openslideload(filename, attach_associated=bool, level=int, autocrop=bool, associated=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
attach_associated (bool) – Attach all associated images
level (int) – Load this level from the file
autocrop (bool) – Crop to image bounds
associated (str) – Load this associated image
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static openslideload_source(source, attach_associated=bool, level=int, autocrop=bool, associated=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load source with OpenSlide.
- Example:
out = pyvips.Image.openslideload_source(source, attach_associated=bool, level=int, autocrop=bool, associated=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
attach_associated (bool) – Attach all associated images
level (int) – Load this level from the file
autocrop (bool) – Crop to image bounds
associated (str) – Load this associated image
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static pdfload(filename, page=int, n=int, dpi=float, scale=float, background=list[float], password=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load PDF from file.
- Example:
out = pyvips.Image.pdfload(filename, page=int, n=int, dpi=float, scale=float, background=list[float], password=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
page (int) – Load this page from the file
n (int) – Load this many pages
dpi (float) – Render at this DPI
scale (float) – Scale output by this factor
background (list[float]) – Background value
password (str) – Decrypt with this password
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static pdfload_buffer(buffer, page=int, n=int, dpi=float, scale=float, background=list[float], password=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load PDF from buffer.
- Example:
out = pyvips.Image.pdfload_buffer(buffer, page=int, n=int, dpi=float, scale=float, background=list[float], password=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
page (int) – Load this page from the file
n (int) – Load this many pages
dpi (float) – Render at this DPI
scale (float) – Scale output by this factor
background (list[float]) – Background value
password (str) – Decrypt with this password
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static pdfload_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], flags=bool)¶
Load PDF from source.
- Example:
out = pyvips.Image.pdfload_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])
- Parameters
source (Source) – Source to load from
page (int) – Load this page from the file
n (int) – Load this many pages
dpi (float) – Render at this DPI
scale (float) – Scale output by this factor
background (list[float]) – Background value
password (str) – Decrypt with this password
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- percent(percent)¶
Find threshold for percent of pixels.
- Example:
threshold = in.percent(percent)
- Parameters
percent (float) – Percent of pixels
- Return type
int
- Raises
Error –
- static perlin(width, height, cell_size=int, uchar=bool, seed=int)¶
Make a perlin noise image.
- Example:
out = pyvips.Image.perlin(width, height, cell_size=int, uchar=bool, seed=int)
- phasecor(in2)¶
Calculate phase correlation.
- Example:
out = in.phasecor(in2)
- static pngload(filename, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load png from file.
- Example:
out = pyvips.Image.pngload(filename, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
unlimited (bool) – Remove all denial of service limits
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static pngload_buffer(buffer, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load png from buffer.
- Example:
out = pyvips.Image.pngload_buffer(buffer, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static pngload_source(source, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load png from source.
- Example:
out = pyvips.Image.pngload_source(source, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
unlimited (bool) – Remove all denial of service limits
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- pngsave(filename, compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
compression (int) – Compression factor
interlace (bool) – Interlace image
profile (str) – ICC profile to embed
filter (int) – libspng row filter flag(s)
palette (bool) – Quantise to 8bpp palette
Q (int) – Quantisation quality
dither (float) – Amount of dithering
bitdepth (int) – Write as a 1, 2, 4, 8 or 16 bit image
effort (int) – Quantisation CPU effort
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- pngsave_buffer(compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
compression (int) – Compression factor
interlace (bool) – Interlace image
profile (str) – ICC profile to embed
filter (int) – libspng row filter flag(s)
palette (bool) – Quantise to 8bpp palette
Q (int) – Quantisation quality
dither (float) – Amount of dithering
bitdepth (int) – Write as a 1, 2, 4, 8 or 16 bit image
effort (int) – Quantisation CPU effort
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- pngsave_target(target, compression=int, interlace=bool, profile=str, filter=int, palette=bool, Q=int, dither=float, bitdepth=int, effort=int, strip=bool, background=list[float], page_height=int)¶
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, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
compression (int) – Compression factor
interlace (bool) – Interlace image
profile (str) – ICC profile to embed
filter (int) – libspng row filter flag(s)
palette (bool) – Quantise to 8bpp palette
Q (int) – Quantisation quality
dither (float) – Amount of dithering
bitdepth (int) – Write as a 1, 2, 4, 8 or 16 bit image
effort (int) – Quantisation CPU effort
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- static ppmload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load ppm from file.
- Example:
out = pyvips.Image.ppmload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static ppmload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load ppm base class.
- Example:
out = pyvips.Image.ppmload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)¶
Save image to ppm file.
- Example:
in.ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
format (Union[str, ForeignPpmFormat]) – Format to save in
ascii (bool) – Save as ascii
bitdepth (int) – Set to 1 to write as a 1 bit image
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)¶
Save to ppm.
- Example:
in.ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
format (Union[str, ForeignPpmFormat]) – Format to save in
ascii (bool) – Save as ascii
bitdepth (int) – Set to 1 to write as a 1 bit image
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- premultiply(max_alpha=float)¶
Premultiply image alpha.
- Example:
out = in.premultiply(max_alpha=float)
- profile()¶
Find image profiles.
- Example:
columns, rows = in.profile()
- static profile_load(name)¶
Load named ICC profile.
- Example:
profile = pyvips.Image.profile_load(name)
- Parameters
name (str) – Profile name
- Return type
str
- Raises
Error –
- project()¶
Find image projections.
- Example:
columns, rows = in.project()
- quadratic(coeff, interpolate=GObject)¶
Resample an image with a quadratic transform.
- Example:
out = in.quadratic(coeff, interpolate=GObject)
- rad2float()¶
Unpack Radiance coding to float RGB.
- Example:
out = in.rad2float()
- static radload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load a Radiance image from a file.
- Example:
out = pyvips.Image.radload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static radload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load rad from buffer.
- Example:
out = pyvips.Image.radload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static radload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load rad from source.
- Example:
out = pyvips.Image.radload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- radsave(filename, strip=bool, background=list[float], page_height=int)¶
Save image to Radiance file.
- Example:
in.radsave(filename, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- radsave_buffer(strip=bool, background=list[float], page_height=int)¶
Save image to Radiance buffer.
- Example:
buffer = in.radsave_buffer(strip=bool, background=list[float], page_height=int)
- Parameters
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- radsave_target(target, strip=bool, background=list[float], page_height=int)¶
Save image to Radiance target.
- Example:
in.radsave_target(target, strip=bool, background=list[float], page_height=int)
- rank(width, height, index)¶
Rank filter.
- Example:
out = in.rank(width, height, index)
- static 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], flags=bool)¶
Load raw data from a file.
- Example:
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])
- Parameters
filename (str) – Filename to load from
width (int) – Image width in pixels
height (int) – Image height in pixels
bands (int) – Number of bands in image
offset (long) – Offset in bytes from start of file
format (Union[str, BandFormat]) – Pixel format in image
interpretation (Union[str, Interpretation]) – Pixel interpretation
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- rawsave(filename, strip=bool, background=list[float], page_height=int)¶
Save image to raw file.
- Example:
in.rawsave(filename, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- rawsave_fd(fd, strip=bool, background=list[float], page_height=int)¶
Write raw image to file descriptor.
- Example:
in.rawsave_fd(fd, strip=bool, background=list[float], page_height=int)
- Parameters
fd (int) – File descriptor to write to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- recomb(m)¶
Linear recombination with matrix.
- Example:
out = in.recomb(m)
- reduce(hshrink, vshrink, kernel=Union[str, Kernel], gap=float)¶
Reduce an image.
- Example:
out = in.reduce(hshrink, vshrink, kernel=Union[str, Kernel], gap=float)
- reduceh(hshrink, kernel=Union[str, Kernel], gap=float)¶
Shrink an image horizontally.
- Example:
out = in.reduceh(hshrink, kernel=Union[str, Kernel], gap=float)
- reducev(vshrink, kernel=Union[str, Kernel], gap=float)¶
Shrink an image vertically.
- Example:
out = in.reducev(vshrink, kernel=Union[str, Kernel], gap=float)
- relational(right, relational)¶
Relational operation on two images.
- Example:
out = left.relational(right, relational)
- Parameters
right (Image) – Right-hand image argument
relational (Union[str, OperationRelational]) – Relational to perform
- Return type
- Raises
Error –
- relational_const(relational, c)¶
Relational operations against a constant.
- Example:
out = in.relational_const(relational, c)
- Parameters
relational (Union[str, OperationRelational]) – Relational to perform
c (list[float]) – Array of constants
- Return type
- Raises
Error –
- remainder(right)¶
Remainder after integer division of two images.
- Example:
out = left.remainder(right)
- remainder_const(c)¶
Remainder after integer division of an image and a constant.
- Example:
out = in.remainder_const(c)
- replicate(across, down)¶
Replicate an image.
- Example:
out = in.replicate(across, down)
- resize(scale, kernel=Union[str, Kernel], gap=float, vscale=float)¶
Resize an image.
- Example:
out = in.resize(scale, kernel=Union[str, Kernel], gap=float, vscale=float)
- rot(angle)¶
Rotate an image.
- Example:
out = in.rot(angle)
- rot45(angle=Union[str, Angle45])¶
Rotate an image.
- Example:
out = in.rot45(angle=Union[str, Angle45])
- rotate(angle, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float)¶
Rotate an image by a number of degrees.
- Example:
out = in.rotate(angle, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float)
- Parameters
angle (float) – Rotate anticlockwise by this many degrees
interpolate (GObject) – Interpolate pixels with this
background (list[float]) – Background value
odx (float) – Horizontal output displacement
ody (float) – Vertical output displacement
idx (float) – Horizontal input displacement
idy (float) – Vertical input displacement
- Return type
- Raises
Error –
- round(round)¶
Perform a round function on an image.
- Example:
out = in.round(round)
- Parameters
round (Union[str, OperationRound]) – Rounding operation to perform
- Return type
- Raises
Error –
- sRGB2scRGB()¶
Convert an sRGB image to scRGB.
- Example:
out = in.sRGB2scRGB()
- scRGB2BW(depth=int)¶
Convert scRGB to BW.
- Example:
out = in.scRGB2BW(depth=int)
- scRGB2sRGB(depth=int)¶
Convert an scRGB image to sRGB.
- Example:
out = in.scRGB2sRGB(depth=int)
- sequential(tile_height=int)¶
Check sequential access.
- Example:
out = in.sequential(tile_height=int)
- sharpen(sigma=float, x1=float, y2=float, y3=float, m1=float, m2=float)¶
Unsharp masking for print.
- Example:
out = in.sharpen(sigma=float, x1=float, y2=float, y3=float, m1=float, m2=float)
- shrink(hshrink, vshrink, ceil=bool)¶
Shrink an image.
- Example:
out = in.shrink(hshrink, vshrink, ceil=bool)
- shrinkh(hshrink, ceil=bool)¶
Shrink an image horizontally.
- Example:
out = in.shrinkh(hshrink, ceil=bool)
- shrinkv(vshrink, ceil=bool)¶
Shrink an image vertically.
- Example:
out = in.shrinkv(vshrink, ceil=bool)
- similarity(scale=float, angle=float, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float)¶
Similarity transform of an image.
- Example:
out = in.similarity(scale=float, angle=float, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float)
- Parameters
scale (float) – Scale by this factor
angle (float) – Rotate anticlockwise by this many degrees
interpolate (GObject) – Interpolate pixels with this
background (list[float]) – Background value
odx (float) – Horizontal output displacement
ody (float) – Vertical output displacement
idx (float) – Horizontal input displacement
idy (float) – Vertical input displacement
- Return type
- Raises
Error –
- static sines(width, height, uchar=bool, hfreq=float, vfreq=float)¶
Make a 2D sine wave.
- Example:
out = pyvips.Image.sines(width, height, uchar=bool, hfreq=float, vfreq=float)
- smartcrop(width, height, interesting=Union[str, Interesting])¶
Extract an area from an image.
- Example:
out = input.smartcrop(width, height, interesting=Union[str, Interesting])
- Parameters
width (int) – Width of extract area
height (int) – Height of extract area
interesting (Union[str, Interesting]) – How to measure interestingness
- Return type
- Raises
Error –
- spcor(ref)¶
Spatial correlation.
- Example:
out = in.spcor(ref)
- spectrum()¶
Make displayable power spectrum.
- Example:
out = in.spectrum()
- stdif(width, height, s0=float, b=float, m0=float, a=float)¶
Statistical difference.
- Example:
out = in.stdif(width, height, s0=float, b=float, m0=float, a=float)
- subsample(xfac, yfac, point=bool)¶
Subsample an image.
- Example:
out = input.subsample(xfac, yfac, point=bool)
- subtract(right)¶
Subtract two images.
- Example:
out = left.subtract(right)
- static sum(in)¶
Sum an array of images.
- Example:
out = pyvips.Image.sum(in)
- static svgload(filename, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load SVG with rsvg.
- Example:
out = pyvips.Image.svgload(filename, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
dpi (float) – Render at this DPI
scale (float) – Scale output by this factor
unlimited (bool) – Allow SVG of any size
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load SVG with rsvg.
- Example:
out = pyvips.Image.svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
dpi (float) – Render at this DPI
scale (float) – Scale output by this factor
unlimited (bool) – Allow SVG of any size
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static svgload_source(source, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load svg from source.
- Example:
out = pyvips.Image.svgload_source(source, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
dpi (float) – Render at this DPI
scale (float) – Scale output by this factor
unlimited (bool) – Allow SVG of any size
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static switch(tests)¶
Find the index of the first non-zero pixel in tests.
- Example:
out = pyvips.Image.switch(tests)
- static system(cmd_format, in=list[Image], out_format=str, in_format=str, out=bool, log=bool)¶
Run an external command.
- Example:
pyvips.Image.system(cmd_format, in=list[Image], out_format=str, in_format=str)
- Parameters
cmd_format (str) – Command to run
in (list[Image]) – Array of input images
out_format (str) – Format for output filename
in_format (str) – Format for input filename
out (bool) – enable output: Output image
log (bool) – enable output: Command log
- Return type
list[] or list[Dict[str, mixed]]
- Raises
Error –
- static text(text, font=str, width=int, height=int, align=Union[str, Align], rgba=bool, dpi=int, justify=bool, spacing=int, fontfile=str, autofit_dpi=bool)¶
Make a text image.
- Example:
out = pyvips.Image.text(text, font=str, width=int, height=int, align=Union[str, Align], rgba=bool, dpi=int, justify=bool, spacing=int, fontfile=str)
- Parameters
text (str) – Text to render
font (str) – Font to render with
width (int) – Maximum image width in pixels
height (int) – Maximum image height in pixels
align (Union[str, Align]) – Align on the low, centre or high edge
rgba (bool) – Enable RGBA output
dpi (int) – DPI to render at
justify (bool) – Justify lines
spacing (int) – Line spacing
fontfile (str) – Load this font file
autofit_dpi (bool) – enable output: DPI selected by autofit
- Return type
- Raises
Error –
- static thumbnail(filename, width, 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])¶
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, import_profile=str, export_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to read from
width (int) – Size to this width
height (int) – Size to this height
size (Union[str, Size]) – Only upsize, only downsize, or both
no_rotate (bool) – Don’t use orientation tags to rotate image upright
crop (Union[str, Interesting]) – Reduce to fill target rectangle, then crop
linear (bool) – Reduce in linear light
import_profile (str) – Fallback import profile
export_profile (str) – Fallback export profile
intent (Union[str, Intent]) – Rendering intent
fail_on (Union[str, FailOn]) – Error level to fail on
- Return type
- Raises
Error –
- static thumbnail_buffer(buffer, width, 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])¶
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, import_profile=str, export_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
width (int) – Size to this width
option_string (str) – Options that are passed on to the underlying loader
height (int) – Size to this height
size (Union[str, Size]) – Only upsize, only downsize, or both
no_rotate (bool) – Don’t use orientation tags to rotate image upright
crop (Union[str, Interesting]) – Reduce to fill target rectangle, then crop
linear (bool) – Reduce in linear light
import_profile (str) – Fallback import profile
export_profile (str) – Fallback export profile
intent (Union[str, Intent]) – Rendering intent
fail_on (Union[str, FailOn]) – Error level to fail on
- Return type
- Raises
Error –
- thumbnail_image(width, 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])¶
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, import_profile=str, export_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn])
- Parameters
width (int) – Size to this width
height (int) – Size to this height
size (Union[str, Size]) – Only upsize, only downsize, or both
no_rotate (bool) – Don’t use orientation tags to rotate image upright
crop (Union[str, Interesting]) – Reduce to fill target rectangle, then crop
linear (bool) – Reduce in linear light
import_profile (str) – Fallback import profile
export_profile (str) – Fallback export profile
intent (Union[str, Intent]) – Rendering intent
fail_on (Union[str, FailOn]) – Error level to fail on
- Return type
- Raises
Error –
- static thumbnail_source(source, width, 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])¶
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, import_profile=str, export_profile=str, intent=Union[str, Intent], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
width (int) – Size to this width
option_string (str) – Options that are passed on to the underlying loader
height (int) – Size to this height
size (Union[str, Size]) – Only upsize, only downsize, or both
no_rotate (bool) – Don’t use orientation tags to rotate image upright
crop (Union[str, Interesting]) – Reduce to fill target rectangle, then crop
linear (bool) – Reduce in linear light
import_profile (str) – Fallback import profile
export_profile (str) – Fallback export profile
intent (Union[str, Intent]) – Rendering intent
fail_on (Union[str, FailOn]) – Error level to fail on
- Return type
- Raises
Error –
- static tiffload(filename, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load tiff from file.
- Example:
out = pyvips.Image.tiffload(filename, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
page (int) – Load this page from the image
subifd (int) – Select subifd index
n (int) – Load this many pages
autorotate (bool) – Rotate image using orientation tag
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static tiffload_buffer(buffer, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load tiff from buffer.
- Example:
out = pyvips.Image.tiffload_buffer(buffer, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
page (int) – Load this page from the image
subifd (int) – Select subifd index
n (int) – Load this many pages
autorotate (bool) – Rotate image using orientation tag
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static tiffload_source(source, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load tiff from source.
- Example:
out = pyvips.Image.tiffload_source(source, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
page (int) – Load this page from the image
subifd (int) – Select subifd index
n (int) – Load this many pages
autorotate (bool) – Rotate image using orientation tag
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], profile=str, 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, strip=bool, background=list[float], page_height=int)¶
Save image to tiff file.
- Example:
in.tiffsave(filename, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], profile=str, 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, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
compression (Union[str, ForeignTiffCompression]) – Compression for this file
Q (int) – Q factor
predictor (Union[str, ForeignTiffPredictor]) – Compression prediction
profile (str) – ICC profile to embed
tile (bool) – Write a tiled tiff
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
pyramid (bool) – Write a pyramidal tiff
miniswhite (bool) – Use 0 for white in 1-bit images
bitdepth (int) – Write as a 1, 2, 4 or 8 bit image
resunit (Union[str, ForeignTiffResunit]) – Resolution unit
xres (float) – Horizontal resolution in pixels/mm
yres (float) – Vertical resolution in pixels/mm
bigtiff (bool) – Write a bigtiff image
properties (bool) – Write a properties document to IMAGEDESCRIPTION
region_shrink (Union[str, RegionShrink]) – Method to shrink regions
level (int) – ZSTD compression level
lossless (bool) – Enable WEBP lossless mode
depth (Union[str, ForeignDzDepth]) – Pyramid depth
subifd (bool) – Save pyr layers as sub-IFDs
premultiply (bool) – Save with premultiplied alpha
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], profile=str, 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, strip=bool, background=list[float], page_height=int)¶
Save image to tiff buffer.
- Example:
buffer = in.tiffsave_buffer(compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], profile=str, 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, strip=bool, background=list[float], page_height=int)
- Parameters
compression (Union[str, ForeignTiffCompression]) – Compression for this file
Q (int) – Q factor
predictor (Union[str, ForeignTiffPredictor]) – Compression prediction
profile (str) – ICC profile to embed
tile (bool) – Write a tiled tiff
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
pyramid (bool) – Write a pyramidal tiff
miniswhite (bool) – Use 0 for white in 1-bit images
bitdepth (int) – Write as a 1, 2, 4 or 8 bit image
resunit (Union[str, ForeignTiffResunit]) – Resolution unit
xres (float) – Horizontal resolution in pixels/mm
yres (float) – Vertical resolution in pixels/mm
bigtiff (bool) – Write a bigtiff image
properties (bool) – Write a properties document to IMAGEDESCRIPTION
region_shrink (Union[str, RegionShrink]) – Method to shrink regions
level (int) – ZSTD compression level
lossless (bool) – Enable WEBP lossless mode
depth (Union[str, ForeignDzDepth]) – Pyramid depth
subifd (bool) – Save pyr layers as sub-IFDs
premultiply (bool) – Save with premultiplied alpha
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], profile=str, 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, strip=bool, background=list[float], page_height=int)¶
Save image to tiff target.
- Example:
in.tiffsave_target(target, compression=Union[str, ForeignTiffCompression], Q=int, predictor=Union[str, ForeignTiffPredictor], profile=str, 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, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
compression (Union[str, ForeignTiffCompression]) – Compression for this file
Q (int) – Q factor
predictor (Union[str, ForeignTiffPredictor]) – Compression prediction
profile (str) – ICC profile to embed
tile (bool) – Write a tiled tiff
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
pyramid (bool) – Write a pyramidal tiff
miniswhite (bool) – Use 0 for white in 1-bit images
bitdepth (int) – Write as a 1, 2, 4 or 8 bit image
resunit (Union[str, ForeignTiffResunit]) – Resolution unit
xres (float) – Horizontal resolution in pixels/mm
yres (float) – Vertical resolution in pixels/mm
bigtiff (bool) – Write a bigtiff image
properties (bool) – Write a properties document to IMAGEDESCRIPTION
region_shrink (Union[str, RegionShrink]) – Method to shrink regions
level (int) – ZSTD compression level
lossless (bool) – Enable WEBP lossless mode
depth (Union[str, ForeignDzDepth]) – Pyramid depth
subifd (bool) – Save pyr layers as sub-IFDs
premultiply (bool) – Save with premultiplied alpha
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- tilecache(tile_width=int, tile_height=int, max_tiles=int, access=Union[str, Access], threaded=bool, persistent=bool)¶
Cache an image as a set of tiles.
- Example:
out = in.tilecache(tile_width=int, tile_height=int, max_tiles=int, access=Union[str, Access], threaded=bool, persistent=bool)
- Parameters
tile_width (int) – Tile width in pixels
tile_height (int) – Tile height in pixels
max_tiles (int) – Maximum number of tiles to cache
access (Union[str, Access]) – Expected access pattern
threaded (bool) – Allow threaded access
persistent (bool) – Keep cache between evaluations
- Return type
- Raises
Error –
- static tonelut(in_max=int, out_max=int, Lb=float, Lw=float, Ps=float, Pm=float, Ph=float, S=float, M=float, H=float)¶
Build a look-up table.
- Example:
out = pyvips.Image.tonelut(in_max=int, out_max=int, Lb=float, Lw=float, Ps=float, Pm=float, Ph=float, S=float, M=float, H=float)
- Parameters
in_max (int) – Size of LUT to build
out_max (int) – Maximum value in output LUT
Lb (float) – Lowest value in output
Lw (float) – Highest value in output
Ps (float) – Position of shadow
Pm (float) – Position of mid-tones
Ph (float) – Position of highlights
S (float) – Adjust shadows by this much
M (float) – Adjust mid-tones by this much
H (float) – Adjust highlights by this much
- Return type
- Raises
Error –
- transpose3d(page_height=int)¶
Transpose3d an image.
- Example:
out = in.transpose3d(page_height=int)
- unpremultiply(max_alpha=float, alpha_band=int)¶
Unpremultiply image alpha.
- Example:
out = in.unpremultiply(max_alpha=float, alpha_band=int)
- static vipsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load vips from file.
- Example:
out = pyvips.Image.vipsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- static vipsload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load vips from source.
- Example:
out = pyvips.Image.vipsload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
- Return type
- Raises
Error –
- vipssave(filename, strip=bool, background=list[float], page_height=int)¶
Save image to file in vips format.
- Example:
in.vipssave(filename, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- vipssave_target(target, strip=bool, background=list[float], page_height=int)¶
Save image to target in vips format.
- Example:
in.vipssave_target(target, strip=bool, background=list[float], page_height=int)
- static webpload(filename, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load webp from file.
- Example:
out = pyvips.Image.webpload(filename, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
filename (str) – Filename to load from
page (int) – Load this page from the file
n (int) – Load this many pages
scale (float) – Scale factor on load
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static webpload_buffer(buffer, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load webp from buffer.
- Example:
out = pyvips.Image.webpload_buffer(buffer, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
buffer (str) – Buffer to load from
page (int) – Load this page from the file
n (int) – Load this many pages
scale (float) – Scale factor on load
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- static webpload_source(source, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn], flags=bool)¶
Load webp from source.
- Example:
out = pyvips.Image.webpload_source(source, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
- Parameters
source (Source) – Source to load from
page (int) – Load this page from the file
n (int) – Load this many pages
scale (float) – Scale factor on load
memory (bool) – Force open via memory
access (Union[str, Access]) – Required access pattern for this file
fail_on (Union[str, FailOn]) – Error level to fail on
flags (bool) – enable output: Flags for this file
- Return type
- Raises
Error –
- 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, profile=str, mixed=bool, strip=bool, background=list[float], page_height=int)¶
Save image to webp file.
- Example:
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, profile=str, mixed=bool, strip=bool, background=list[float], page_height=int)
- Parameters
filename (str) – Filename to save to
Q (int) – Q factor
lossless (bool) – Enable lossless compression
preset (Union[str, ForeignWebpPreset]) – Preset for lossy compression
smart_subsample (bool) – Enable high quality chroma subsampling
near_lossless (bool) – Enable preprocessing in lossless mode (uses Q)
alpha_q (int) – Change alpha plane fidelity for lossy compression
min_size (bool) – Optimise for minimum size
kmin (int) – Minimum number of frames between key frames
kmax (int) – Maximum number of frames between key frames
effort (int) – Level of CPU effort to reduce file size
profile (str) – ICC profile to embed
mixed (bool) – Allow mixed encoding (might reduce file size)
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- 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, profile=str, mixed=bool, strip=bool, background=list[float], page_height=int)¶
Save image to webp buffer.
- Example:
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, profile=str, mixed=bool, strip=bool, background=list[float], page_height=int)
- Parameters
Q (int) – Q factor
lossless (bool) – Enable lossless compression
preset (Union[str, ForeignWebpPreset]) – Preset for lossy compression
smart_subsample (bool) – Enable high quality chroma subsampling
near_lossless (bool) – Enable preprocessing in lossless mode (uses Q)
alpha_q (int) – Change alpha plane fidelity for lossy compression
min_size (bool) – Optimise for minimum size
kmin (int) – Minimum number of frames between key frames
kmax (int) – Maximum number of frames between key frames
effort (int) – Level of CPU effort to reduce file size
profile (str) – ICC profile to embed
mixed (bool) – Allow mixed encoding (might reduce file size)
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
str
- Raises
Error –
- 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, profile=str, mixed=bool, strip=bool, background=list[float], page_height=int)¶
Save image to webp target.
- Example:
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, profile=str, mixed=bool, strip=bool, background=list[float], page_height=int)
- Parameters
target (Target) – Target to save to
Q (int) – Q factor
lossless (bool) – Enable lossless compression
preset (Union[str, ForeignWebpPreset]) – Preset for lossy compression
smart_subsample (bool) – Enable high quality chroma subsampling
near_lossless (bool) – Enable preprocessing in lossless mode (uses Q)
alpha_q (int) – Change alpha plane fidelity for lossy compression
min_size (bool) – Optimise for minimum size
kmin (int) – Minimum number of frames between key frames
kmax (int) – Maximum number of frames between key frames
effort (int) – Level of CPU effort to reduce file size
profile (str) – ICC profile to embed
mixed (bool) – Allow mixed encoding (might reduce file size)
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
- Return type
list[]
- Raises
Error –
- static worley(width, height, cell_size=int, seed=int)¶
Make a worley noise image.
- Example:
out = pyvips.Image.worley(width, height, cell_size=int, seed=int)
- wrap(x=int, y=int)¶
Wrap image origin.
- Example:
out = in.wrap(x=int, y=int)
- static xyz(width, height, csize=int, dsize=int, esize=int)¶
Make an image where pixel values are coordinates.
- Example:
out = pyvips.Image.xyz(width, height, csize=int, dsize=int, esize=int)
- static zone(width, height, uchar=bool)¶
Make a zone plate.
- Example:
out = pyvips.Image.zone(width, height, uchar=bool)