Image
¶ Main methods¶
Wrap a VipsImage object.
Methods
Wrap around a pointer.
Wraps a GObject instance around an underlying pointer. When the instance is garbage-collected, the underlying object is unreferenced.
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:
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.
vips_filename (str) – The disc file to load the image from, with optional appended arguments.
All loaders support at least the following options:
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, use VIPS_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.
A new Image
.
.Error –
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.
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:
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.
A new Image
.
.Error –
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 operator Image.conv()
.
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.
A new Image
.
.Error –
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 |
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’
The new image.
See also
_guess_interpretation()
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.
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.
A new Image
.
.Error –
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.
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:
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.
A new Image
.
.Error –
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 uses GetTempPath()
to find the temporary directory.
vips uses g_mkstemp()
to make the temporary filename. They generally look something like "vips-12-EJKJFGH.v"
.
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.
A new Image
.
.Error –
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 to value
.
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.
A new Image
.
.Error –
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.
A new Image
.
.Error –
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:
at the command-line to see a summary of the available options for the JPEG saver.
vips_filename (str) – The disc file to save the image to, with optional appended arguments.
Other arguments depend upon the save operation.
None
.Error –
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:
at the command-line to see a summary of the available options for the JPEG saver.
format_string (str) – The suffix, plus any string-form arguments.
Other arguments depend upon the save operation.
A byte string.
.Error –
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:
at the command-line to see a summary of the available options for the JPEG saver.
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.
None
.Error –
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.
buffer
.Error –
Write an image to another image.
This function writes self
to another image. Use something like Image.new_temp_file()
to make an image that can be written to.
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.
None
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.
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 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
.
name (str) – The name of the piece of metadata to get the type of.
The GType
, or 0.
None –
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.
name (str) – The name of the piece of metadata to get.
The metadata item as a Python value.
.Error –
Get a list of all the metadata fields on an image.
[string]
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.
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.
None
None –
Set the value of an item of metadata.
Sets the value of an item of metadata. The metadata item must already exist.
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.
None
.Error –
Remove an item of metadata.
The named metadata item is removed.
name (str) – The name of the piece of metadata to remove.
None
None –
Return a single-band image as a list of lists.
list of lists of values
Conversion to a NumPy array.
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.
Single-band images lose their channel axis.
Single-pixel single-band images are converted to a 0D array.
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
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.
dtype (str or numpy dtype) – The dtype to use for the numpy array. If None, the default dtype of the image is used.
The image as a numpy array.
numpy.ndarray
See also
FORMAT_TO_TYPESTR: Global dictionary mapping libvips format strings to numpy dtype strings.
Return repr(self).
Divert unknown names to libvips.
Unknown attributes are first looked up in the image properties as accessors, for example:
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.
name (str) – The name of the piece of metadata to get.
Mixed.
.Error –
Overload [] to pull out band elements from an image.
The following arguments types are accepted:
int:
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.
Fetch a pixel value.
x (int) – The x coordinate to fetch.
y (int) – The y coordinate to fetch.
Pixel as an array of floating point numbers.
.Error –
Return self|value.
Return value|self.
Return self>value.
Return self>=value.
Return self<value.
Return self<=value.
Return self==value.
Return self!=value.
Return the largest integral value not greater than the argument.
Return the smallest integral value not less than the argument.
Return the nearest integral value.
AND image bands together.
OR image bands together.
EOR image bands together.
Split an n-band image into n separate images.
Append a set of images or constants bandwise.
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.
Get the page height in a many-page image, or height.
Split an N-page image into a list of N separate images.
Join a set of pages vertically to make a multipage image.
Also sets the page-height property on the result.
Composite a set of images with a set of modes.
Band-wise rank filter a set of images.
Return the coordinates of the image maximum.
Return the coordinates of the image minimum.
Return the real part of a complex image.
Return the imaginary part of a complex image.
Return an image converted to polar coordinates.
Return an image converted to rectangular coordinates.
Return the complex conjugate of an image.
Return the sine of an image in degrees.
Return the cosine of an image in degrees.
Return the tangent of an image in degrees.
Return the inverse sine of an image in degrees.
Return the inverse cosine of an image in degrees.
Return the inverse tangent of an image in degrees.
Return the hyperbolic sine of an image in radians.
Return the hyperbolic cosine of an image in radians.
Return the hyperbolic tangent of an image in radians.
Return the inverse hyperbolic sine of an image in radians.
Return the inverse hyperbolic cosine of an image in radians.
Return the inverse hyperbolic tangent of an image in radians.
Return the natural log of an image.
Return the log base 10 of an image.
Return e ** pixel.
Return 10 ** pixel.
Erode with a structuring element.
Dilate with a structuring element.
size x size median filter.
Flip horizontally.
Flip vertically.
Rotate 90 degrees clockwise.
Rotate 180 degrees.
Rotate 270 degrees clockwise.
True if the image has an alpha channel.
Add an alpha channel.
Ifthenelse an image.
Example
out = cond.ifthenelse(in1, in2, blend=bool)
Scale an image to 0 - 255.
This is the libvips scale
operation, renamed to avoid a clash with the scale
for convolution masks.
exp (float) – Exponent for log scale.
log (bool) – Switch to turn on log scaling.
A new Image
.
.Error –
Scale an image to uchar.
int, read-only: Image width in pixels.
int, read-only: Image height in pixels.
int, read-only: Number of bands in image.
BandFormat
, read-only: Image format.
Interpretation
, read-only: Suggested interpretation of image pixel values.
Coding
, read-only: Pixel coding.
str, read-only: Filename image was loaded from, or None.
int, read-only: Image X offset.
int, read-only: Image Y offset.
float, read-only: Image X resolution, in pixels / mm
float, read-only: Image Y resolution, in pixels / mm.
float, read-only: Image scale.
float, read-only: Image offset.
Methods
Transform float Lab to LabQ coding.
out = in.Lab2LabQ()
Transform float Lab to signed short.
out = in.Lab2LabS()
Transform CIELAB to XYZ.
out = in.Lab2XYZ(temp=list[float])
Unpack a LabQ image to float Lab.
out = in.LabQ2Lab()
Unpack a LabQ image to short Lab.
out = in.LabQ2LabS()
Convert a LabQ image to sRGB.
out = in.LabQ2sRGB()
Transform signed short Lab to float.
out = in.LabS2Lab()
Transform short Lab to LabQ coding.
out = in.LabS2LabQ()
Transform XYZ to Lab.
out = in.XYZ2Lab(temp=list[float])
Add two images.
out = left.add(right)
Affine transform of an image.
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])
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
Error –
Load an Analyze6 image.
out = pyvips.Image.analyzeload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Join an array of images.
out = pyvips.Image.arrayjoin(in, across=int, shim=int, background=list[float], halign=Union[str, Align], valign=Union[str, Align], hspacing=int, vspacing=int)
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
Error –
Autorotate image by exif tag.
out = in.autorot()
Find image average.
out = in.avg()
float
Error –
Boolean operation across image bands.
out = in.bandbool(boolean)
boolean (Union[str, OperationBoolean]) – Boolean to perform
Error –
Fold up x axis into bands.
out = in.bandfold(factor=int)
Append a constant band to an image.
out = in.bandjoin_const(c)
Unfold image bands into x axis.
out = in.bandunfold(factor=int)
Make a black image.
out = pyvips.Image.black(width, height, bands=int)
Boolean operation on two images.
out = left.boolean(right, boolean)
right (Image) – Right-hand image argument
boolean (Union[str, OperationBoolean]) – Boolean to perform
Error –
Boolean operations against a constant.
out = in.boolean_const(boolean, c)
boolean (Union[str, OperationBoolean]) – Boolean to perform
c (list[float]) – Array of constants
Error –
Cache an image.
out = in.cache(max_tiles=int, tile_height=int, tile_width=int)
Canny edge detector.
out = in.canny(sigma=float, precision=Union[str, Precision])
Use pixel values to pick cases from an array of images.
out = index.case(cases)
Cast an image.
out = in.cast(format, shift=bool)
format (Union[str, BandFormat]) – Format to cast to
shift (bool) – Shift integer values up and down
Error –
Convert to a new colorspace.
out = in.colourspace(space, source_space=Union[str, Interpretation])
space (Union[str, Interpretation]) – Destination color space
source_space (Union[str, Interpretation]) – Source color space
Error –
Convolve with rotating mask.
out = in.compass(mask, times=int, angle=Union[str, Angle45], combine=Union[str, Combine], precision=Union[str, Precision], layers=int, cluster=int)
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
Error –
Perform a complex operation on an image.
out = in.complex(cmplx)
cmplx (Union[str, OperationComplex]) – Complex to perform
Error –
Complex binary operations on two images.
out = left.complex2(right, cmplx)
right (Image) – Right-hand image argument
cmplx (Union[str, OperationComplex2]) – Binary complex operation to perform
Error –
Form a complex image from two real images.
out = left.complexform(right)
Get a component from a complex image.
out = in.complexget(get)
get (Union[str, OperationComplexget]) – Complex to perform
Error –
Blend an array of images with an array of blend modes.
out = pyvips.Image.composite(in, mode, x=list[int], y=list[int], compositing_space=Union[str, Interpretation], premultiplied=bool)
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
Error –
Blend a pair of images with a blend mode.
out = base.composite2(overlay, mode, x=int, y=int, compositing_space=Union[str, Interpretation], premultiplied=bool)
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
Error –
Convolution operation.
out = in.conv(mask, precision=Union[str, Precision], layers=int, cluster=int)
Approximate integer convolution.
out = in.conva(mask, layers=int, cluster=int)
Approximate separable integer convolution.
out = in.convasep(mask, layers=int)
Float convolution operation.
out = in.convf(mask)
Int convolution operation.
out = in.convi(mask)
Seperable convolution operation.
out = in.convsep(mask, precision=Union[str, Precision], layers=int, cluster=int)
Copy an image.
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)
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
Error –
Count lines in an image.
nolines = in.countlines(direction)
Extract an area from an image.
out = input.crop(left, top, width, height)
Load csv.
out = pyvips.Image.csvload(filename, skip=int, lines=int, whitespace=str, separator=str, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load csv.
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])
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
Error –
Save image to csv.
in.csvsave(filename, separator=str, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Save image to csv.
in.csvsave_target(target, separator=str, strip=bool, background=list[float], page_height=int)
Calculate dE00.
out = left.dE00(right)
Calculate dE76.
out = left.dE76(right)
Calculate dECMC.
out = left.dECMC(right)
Find image standard deviation.
out = in.deviate()
float
Error –
Divide two images.
out = left.divide(right)
Draw a circle on an image.
image = image.draw_circle(ink, cx, cy, radius, fill=bool)
Flood-fill an area.
image = image.draw_flood(ink, x, y, test=Image, equal=bool)
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
Error –
Paint an image into another image.
image = image.draw_image(sub, x, y, mode=Union[str, CombineMode])
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
Error –
Draw a line on an image.
image = image.draw_line(ink, x1, y1, x2, y2)
Draw a mask on an image.
image = image.draw_mask(ink, mask, x, y)
Paint a rectangle on an image.
image = image.draw_rect(ink, left, top, width, height, fill=bool)
Blur a rectangle on an image.
image = image.draw_smudge(left, top, width, height)
Save image to deepzoom file.
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)
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
list[]
Error –
Save image to dz buffer.
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)
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
str
Error –
Save image to deepzoom target.
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)
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
list[]
Error –
Embed an image in a larger image.
out = in.embed(x, y, width, height, extend=Union[str, Extend], background=list[float])
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
Error –
Extract an area from an image.
out = input.extract_area(left, top, width, height)
Extract band from an image.
out = in.extract_band(band, n=int)
Make an image showing the eye’s spatial response.
out = pyvips.Image.eye(width, height, uchar=bool, factor=float)
False-color an image.
out = in.falsecolour()
Fast correlation.
out = in.fastcor(ref)
Fill image zeros with nearest non-zero pixel.
out = in.fill_nearest()
Search an image for non-edge areas.
left, top, width, height = in.find_trim(threshold=float, background=list[float])
threshold (float) – Object threshold
background (list[float]) – Color for background pixels
list[int, int, int, int]
Error –
Load a FITS image.
out = pyvips.Image.fitsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load FITS from a source.
out = pyvips.Image.fitsload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image to fits file.
in.fitssave(filename, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Flatten alpha out of an image.
out = in.flatten(background=list[float], max_alpha=float)
Flip an image.
out = in.flip(direction)
Transform float RGB to Radiance coding.
out = in.float2rad()
Make a fractal surface.
out = pyvips.Image.fractsurf(width, height, fractal_dimension)
Frequency-domain filtering.
out = in.freqmult(mask)
Gamma an image.
out = in.gamma(exponent=float)
Gaussian blur.
out = in.gaussblur(sigma, min_ampl=float, precision=Union[str, Precision])
Make a gaussian image.
out = pyvips.Image.gaussmat(sigma, min_ampl, separable=bool, precision=Union[str, Precision])
Make a gaussnoise image.
out = pyvips.Image.gaussnoise(width, height, sigma=float, mean=float, seed=int)
Read a point from an image.
out_array = in.getpoint(x, y)
x (int) – Point to read
y (int) – Point to read
list[float]
Error –
Load GIF with libnsgif.
out = pyvips.Image.gifload(filename, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load GIF with libnsgif.
out = pyvips.Image.gifload_buffer(buffer, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load gif from source.
out = pyvips.Image.gifload_source(source, n=int, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Save as gif.
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)
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
list[]
Error –
Save as gif.
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)
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
str
Error –
Save as gif.
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)
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
list[]
Error –
Global balance an image mosaic.
out = in.globalbalance(gamma=float, int_output=bool)
Place an image within a larger image with a certain gravity.
out = in.gravity(direction, width, height, extend=Union[str, Extend], background=list[float])
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
Error –
Make a grey ramp image.
out = pyvips.Image.grey(width, height, uchar=bool)
Grid an image.
out = in.grid(tile_height, across, down)
Load a HEIF image.
out = pyvips.Image.heifload(filename, page=int, n=int, thumbnail=bool, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load a HEIF image.
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])
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
Error –
Load a HEIF image.
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])
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
Error –
Save image in HEIF format.
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)
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
list[]
Error –
Save image in HEIF format.
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)
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
str
Error –
Save image in HEIF format.
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)
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
list[]
Error –
Form cumulative histogram.
out = in.hist_cum()
Estimate image entropy.
out = in.hist_entropy()
float
Error –
Histogram equalisation.
out = in.hist_equal(band=int)
Find image histogram.
out = in.hist_find(band=int)
Find indexed image histogram.
out = in.hist_find_indexed(index, combine=Union[str, Combine])
Find n-dimensional image histogram.
out = in.hist_find_ndim(bins=int)
Test for monotonicity.
monotonic = in.hist_ismonotonic()
bool
Error –
Local histogram equalisation.
out = in.hist_local(width, height, max_slope=int)
Match two histograms.
out = in.hist_match(ref)
Find hough circle transform.
out = in.hough_circle(scale=int, min_radius=int, max_radius=int)
Find hough line transform.
out = in.hough_line(width=int, height=int)
Output to device with ICC profile.
out = in.icc_export(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, output_profile=str, depth=int)
Error –
Import from device with ICC profile.
out = in.icc_import(pcs=Union[str, PCS], intent=Union[str, Intent], black_point_compensation=bool, embedded=bool, input_profile=str)
Error –
Transform between devices with ICC profiles.
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)
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
Error –
Make a 1D image where pixel values are indexes.
out = pyvips.Image.identity(bands=int, ushort=bool, size=int)
Insert image @sub into @main at @x, @y.
out = main.insert(sub, x, y, expand=bool, background=list[float])
Build an inverted look-up table.
out = in.invertlut(size=int)
Inverse FFT.
out = in.invfft(real=bool)
Join a pair of images.
out = in1.join(in2, direction, expand=bool, shim=int, background=list[float], align=Union[str, Align])
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
Error –
Load JPEG2000 image.
out = pyvips.Image.jp2kload(filename, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load JPEG2000 image.
out = pyvips.Image.jp2kload_buffer(buffer, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load JPEG2000 image.
out = pyvips.Image.jp2kload_source(source, page=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image in JPEG2000 format.
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)
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
list[]
Error –
Save image in JPEG2000 format.
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)
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
str
Error –
Save image in JPEG2000 format.
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)
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
list[]
Error –
Load jpeg from file.
out = pyvips.Image.jpegload(filename, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load jpeg from buffer.
out = pyvips.Image.jpegload_buffer(buffer, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load image from jpeg source.
out = pyvips.Image.jpegload_source(source, shrink=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Save image to jpeg file.
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)
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
list[]
Error –
Save image to jpeg buffer.
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)
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
str
Error –
Save image to jpeg mime.
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)
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
list[]
Error –
Save image to jpeg target.
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)
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
list[]
Error –
Load JPEG-XL image.
out = pyvips.Image.jxlload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load JPEG-XL image.
out = pyvips.Image.jxlload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load JPEG-XL image.
out = pyvips.Image.jxlload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image in JPEG-XL format.
in.jxlsave(filename, tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Save image in JPEG-XL format.
buffer = in.jxlsave_buffer(tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)
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
str
Error –
Save image in JPEG-XL format.
in.jxlsave_target(target, tier=int, distance=float, effort=int, lossless=bool, Q=int, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Label regions in an image.
mask = in.labelregions()
Calculate (a * in + b).
out = in.linear(a, b, uchar=bool)
Cache an image as a set of lines.
out = in.linecache(tile_height=int, access=Union[str, Access], threaded=bool, persistent=bool)
Make a Laplacian of Gaussian image.
out = pyvips.Image.logmat(sigma, min_ampl, separable=bool, precision=Union[str, Precision])
Load file with ImageMagick.
out = pyvips.Image.magickload(filename, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load buffer with ImageMagick.
out = pyvips.Image.magickload_buffer(buffer, density=str, page=int, n=int, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Save file with ImageMagick.
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)
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
list[]
Error –
Save image to magick buffer.
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)
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
str
Error –
Resample with a map image.
out = in.mapim(index, interpolate=GObject, background=list[float], premultiplied=bool, extend=Union[str, Extend])
Map an image though a lut.
out = in.maplut(lut, band=int)
Make a butterworth filter.
out = pyvips.Image.mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make a butterworth_band filter.
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)
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
Error –
Make a butterworth ring filter.
out = pyvips.Image.mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make fractal filter.
out = pyvips.Image.mask_fractal(width, height, fractal_dimension, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make a gaussian filter.
out = pyvips.Image.mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make a gaussian filter.
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)
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
Error –
Make a gaussian ring filter.
out = pyvips.Image.mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make an ideal filter.
out = pyvips.Image.mask_ideal(width, height, frequency_cutoff, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make an ideal band filter.
out = pyvips.Image.mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
Make an ideal ring filter.
out = pyvips.Image.mask_ideal_ring(width, height, frequency_cutoff, ringwidth, uchar=bool, nodc=bool, reject=bool, optical=bool)
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
Error –
First-order match of two images.
out = ref.match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow=int, harea=int, search=bool, interpolate=GObject)
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
Error –
Apply a math operation to an image.
out = in.math(math)
math (Union[str, OperationMath]) – Math to perform
Error –
Binary math operations.
out = left.math2(right, math2)
right (Image) – Right-hand image argument
math2 (Union[str, OperationMath2]) – Math to perform
Error –
Binary math operations with a constant.
out = in.math2_const(math2, c)
math2 (Union[str, OperationMath2]) – Math to perform
c (list[float]) – Array of constants
Error –
Load mat from file.
out = pyvips.Image.matload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load matrix.
out = pyvips.Image.matrixload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load matrix.
out = pyvips.Image.matrixload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Print matrix.
in.matrixprint(strip=bool, background=list[float], page_height=int)
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
list[]
Error –
Save image to matrix.
in.matrixsave(filename, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Save image to matrix.
in.matrixsave_target(target, strip=bool, background=list[float], page_height=int)
Find image maximum.
out = in.max(size=int)
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
float or list[float, Dict[str, mixed]]
Error –
Measure a set of patches on a color chart.
out = in.measure(h, v, left=int, top=int, width=int, height=int)
Merge two images.
out = ref.merge(sec, direction, dx, dy, mblend=int)
Find image minimum.
out = in.min(size=int)
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
float or list[float, Dict[str, mixed]]
Error –
Morphology operation.
out = in.morph(mask, morph)
mask (Image) – Input matrix image
morph (Union[str, OperationMorphology]) – Morphological operation to perform
Error –
Mosaic two images.
out = ref.mosaic(sec, direction, xref, yref, xsec, ysec, hwindow=int, harea=int, mblend=int, bandno=int)
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
Error –
First-order mosaic of two images.
out = ref.mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, hwindow=int, harea=int, search=bool, interpolate=GObject, mblend=int)
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
Error –
Pick most-significant byte from an image.
out = in.msb(band=int)
Multiply two images.
out = left.multiply(right)
Load NIfTI volume.
out = pyvips.Image.niftiload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load NIfTI volumes.
out = pyvips.Image.niftiload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image to nifti file.
in.niftisave(filename, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Load an OpenEXR image.
out = pyvips.Image.openexrload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load file with OpenSlide.
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])
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
Error –
Load source with OpenSlide.
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])
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
Error –
Load PDF from file.
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])
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
Error –
Load PDF from buffer.
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])
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
Error –
Load PDF from source.
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])
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
Error –
Find threshold for percent of pixels.
threshold = in.percent(percent)
percent (float) – Percent of pixels
int
Error –
Make a perlin noise image.
out = pyvips.Image.perlin(width, height, cell_size=int, uchar=bool, seed=int)
Calculate phase correlation.
out = in.phasecor(in2)
Load png from file.
out = pyvips.Image.pngload(filename, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load png from buffer.
out = pyvips.Image.pngload_buffer(buffer, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load png from source.
out = pyvips.Image.pngload_source(source, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Save image to file as PNG.
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)
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
list[]
Error –
Save image to buffer as PNG.
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)
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
str
Error –
Save image to target as PNG.
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)
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
list[]
Error –
Load ppm from file.
out = pyvips.Image.ppmload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load ppm base class.
out = pyvips.Image.ppmload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image to ppm file.
in.ppmsave(filename, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Save to ppm.
in.ppmsave_target(target, format=Union[str, ForeignPpmFormat], ascii=bool, bitdepth=int, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Premultiply image alpha.
out = in.premultiply(max_alpha=float)
Find image profiles.
columns, rows = in.profile()
Load named ICC profile.
profile = pyvips.Image.profile_load(name)
name (str) – Profile name
str
Error –
Find image projections.
columns, rows = in.project()
Resample an image with a quadratic transform.
out = in.quadratic(coeff, interpolate=GObject)
Unpack Radiance coding to float RGB.
out = in.rad2float()
Load a Radiance image from a file.
out = pyvips.Image.radload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load rad from buffer.
out = pyvips.Image.radload_buffer(buffer, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load rad from source.
out = pyvips.Image.radload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image to Radiance file.
in.radsave(filename, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Save image to Radiance buffer.
buffer = in.radsave_buffer(strip=bool, background=list[float], page_height=int)
strip (bool) – Strip all metadata from image
background (list[float]) – Background value
page_height (int) – Set page height for multipage save
str
Error –
Save image to Radiance target.
in.radsave_target(target, strip=bool, background=list[float], page_height=int)
Rank filter.
out = in.rank(width, height, index)
Load raw data from a file.
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])
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
Error –
Save image to raw file.
in.rawsave(filename, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Write raw image to file descriptor.
in.rawsave_fd(fd, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Linear recombination with matrix.
out = in.recomb(m)
Reduce an image.
out = in.reduce(hshrink, vshrink, kernel=Union[str, Kernel], gap=float)
Shrink an image horizontally.
out = in.reduceh(hshrink, kernel=Union[str, Kernel], gap=float)
Shrink an image vertically.
out = in.reducev(vshrink, kernel=Union[str, Kernel], gap=float)
Relational operation on two images.
out = left.relational(right, relational)
right (Image) – Right-hand image argument
relational (Union[str, OperationRelational]) – Relational to perform
Error –
Relational operations against a constant.
out = in.relational_const(relational, c)
relational (Union[str, OperationRelational]) – Relational to perform
c (list[float]) – Array of constants
Error –
Remainder after integer division of two images.
out = left.remainder(right)
Remainder after integer division of an image and a constant.
out = in.remainder_const(c)
Replicate an image.
out = in.replicate(across, down)
Resize an image.
out = in.resize(scale, kernel=Union[str, Kernel], gap=float, vscale=float)
Rotate an image.
out = in.rot(angle)
Rotate an image.
out = in.rot45(angle=Union[str, Angle45])
Rotate an image by a number of degrees.
out = in.rotate(angle, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float)
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
Error –
Perform a round function on an image.
out = in.round(round)
round (Union[str, OperationRound]) – Rounding operation to perform
Error –
Convert an sRGB image to scRGB.
out = in.sRGB2scRGB()
Convert scRGB to BW.
out = in.scRGB2BW(depth=int)
Convert an scRGB image to sRGB.
out = in.scRGB2sRGB(depth=int)
Check sequential access.
out = in.sequential(tile_height=int)
Unsharp masking for print.
out = in.sharpen(sigma=float, x1=float, y2=float, y3=float, m1=float, m2=float)
Shrink an image.
out = in.shrink(hshrink, vshrink, ceil=bool)
Shrink an image horizontally.
out = in.shrinkh(hshrink, ceil=bool)
Shrink an image vertically.
out = in.shrinkv(vshrink, ceil=bool)
Similarity transform of an image.
out = in.similarity(scale=float, angle=float, interpolate=GObject, background=list[float], odx=float, ody=float, idx=float, idy=float)
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
Error –
Make a 2D sine wave.
out = pyvips.Image.sines(width, height, uchar=bool, hfreq=float, vfreq=float)
Extract an area from an image.
out = input.smartcrop(width, height, interesting=Union[str, Interesting])
width (int) – Width of extract area
height (int) – Height of extract area
interesting (Union[str, Interesting]) – How to measure interestingness
Error –
Spatial correlation.
out = in.spcor(ref)
Make displayable power spectrum.
out = in.spectrum()
Statistical difference.
out = in.stdif(width, height, s0=float, b=float, m0=float, a=float)
Subsample an image.
out = input.subsample(xfac, yfac, point=bool)
Subtract two images.
out = left.subtract(right)
Sum an array of images.
out = pyvips.Image.sum(in)
Load SVG with rsvg.
out = pyvips.Image.svgload(filename, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load SVG with rsvg.
out = pyvips.Image.svgload_buffer(buffer, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load svg from source.
out = pyvips.Image.svgload_source(source, dpi=float, scale=float, unlimited=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Find the index of the first non-zero pixel in tests.
out = pyvips.Image.switch(tests)
Run an external command.
pyvips.Image.system(cmd_format, in=list[Image], out_format=str, in_format=str)
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
list[] or list[Dict[str, mixed]]
Error –
Make a text image.
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)
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
Error –
Generate thumbnail from file.
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])
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
Error –
Generate thumbnail from buffer.
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])
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
Error –
Generate thumbnail from image.
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])
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
Error –
Generate thumbnail from source.
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])
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
Error –
Load tiff from file.
out = pyvips.Image.tiffload(filename, page=int, subifd=int, n=int, autorotate=bool, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load tiff from buffer.
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])
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
Error –
Load tiff from source.
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])
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
Error –
Save image to tiff file.
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)
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
list[]
Error –
Save image to tiff buffer.
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)
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
str
Error –
Save image to tiff target.
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)
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
list[]
Error –
Cache an image as a set of tiles.
out = in.tilecache(tile_width=int, tile_height=int, max_tiles=int, access=Union[str, Access], threaded=bool, persistent=bool)
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
Error –
Build a look-up table.
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)
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
Error –
Transpose3d an image.
out = in.transpose3d(page_height=int)
Unpremultiply image alpha.
out = in.unpremultiply(max_alpha=float, alpha_band=int)
Load vips from file.
out = pyvips.Image.vipsload(filename, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Load vips from source.
out = pyvips.Image.vipsload_source(source, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
Error –
Save image to file in vips format.
in.vipssave(filename, strip=bool, background=list[float], page_height=int)
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
list[]
Error –
Save image to target in vips format.
in.vipssave_target(target, strip=bool, background=list[float], page_height=int)
Load webp from file.
out = pyvips.Image.webpload(filename, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load webp from buffer.
out = pyvips.Image.webpload_buffer(buffer, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Load webp from source.
out = pyvips.Image.webpload_source(source, page=int, n=int, scale=float, memory=bool, access=Union[str, Access], fail_on=Union[str, FailOn])
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
Error –
Save image to webp file.
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)
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
list[]
Error –
Save image to webp buffer.
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)
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
str
Error –
Save image to webp target.
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)
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
list[]
Error –
Make a worley noise image.
out = pyvips.Image.worley(width, height, cell_size=int, seed=int)
Wrap image origin.
out = in.wrap(x=int, y=int)
Make an image where pixel values are coordinates.
out = pyvips.Image.xyz(width, height, csize=int, dsize=int, esize=int)
Make a zone plate.
out = pyvips.Image.zone(width, height, uchar=bool)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4