class

Vips::Image

Inherits Vips::VipsObject / Vips::GObject / Reference / Object

Constructors

imageize(match_image : Image, value) : Image

expand a constant into an image

Source
new_from_array(array : Array, scale = 1.0, offset = 0.0) : Image

Create a new Image from a 1D or 2D array. A 1D array becomes an image with height 1. Use scale and offset to set the scale and offset fields in the header. These are useful for integer convolutions.

For example:

image = Vips::Image.new_from_array [1, 2, 3]

or

image = Vips::Image.new_from_array [
  [-1, -1, -1],
  [-1, 16, -1],
  [-1, -1, -1],
], 8

for a simple sharpening mask.

Source
new_from_buffer(data : String | Bytes | IO, option_string : String = "", access : Enums::Access | Nil = nil, failon : Enums::FailOn | Nil = nil, **opts) : Image

Create a new Image for an image encoded in a format such as JPEG in a binary String, Bytes or IO. Load options may be passed as strings or appended as a keyword arguments. For example:

image = Vips::Image.new_from_buffer memory_buffer, "shrink=2"

or alternatively:

image = Vips::Image.new_from_buffer memory_buffer, "", shrink: 2

The options available depend on the file format. Try something like:

$ vips jpegload_buffer

at the command-line to see the available options. Not all loaders support load from buffer, but at least JPEG, PNG and TIFF images will work.

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.

Source
new_from_file(name : String, memory : Bool | Nil = nil, access : Enums::Access | Nil = nil, failon : Enums::FailOn | Nil = nil, **opts) : Image

Return a new Image for a file on disc. This method can load images in any format supported by vips. The filename can include load options, for example:

image = Vips::Image.new_from_file "fred.jpg[shrink=2]"

You can also supply options as keyword arguments (NamedTuple), for example:

image = Vips::Image.new_from_file "fred.jpg", shrink: 2

The full set of options available depend upon the load operation that will be executed. Try something like:

$ vips jpegload

at the command-line to see a summary of the available options for the JPEG loader.

Loading is fast: only enough of the image is loaded to be able to fill out the header. Pixels will only be decompressed when they are needed.

Source
new_from_memory(data : Bytes, width : Int32, height : Int32, bands : Int32, format : Enums::BandFormat) : Image

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, Enums::BandFormat::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 GDI+ into libvips.

Source
new_from_memory_copy(data : Pointer(Void), size : UInt64, width : Int32, height : Int32, bands : Int32, format : Enums::BandFormat) : Image

Create a new Image from memory and copies the memory area. See new_from_memory for a version of this method which does not copy the memory area.

Source
new_from_source(source : Source, option_string : String = "", access : Enums::Access | Nil = nil, failon : Enums::FailOn | Nil = nil, **opts) : Image

Create a new Image from a source. Load options may be passed as strings or appended as a hash. For example:

source = Vips::Source.new_from_file("k2.jpg")
image = Vips::Image.new_from_source source, "shrink=2"

or alternatively:

image = Vips::Image.new_from_source source, shrink: 2

The options available depend on the file format. Try something like:

$ vips jpegload_source

at the command-line to see the available options. Not all loaders support load from source, but at least JPEG, PNG and TIFF images will work.

Loading is fast: only enough data is read to be able to fill out the header. Pixels will only be read and decompressed when they are needed.

Source
new_from_stream(stream : IO, option_string : String = "", access : Enums::Access | Nil = nil, failon : Enums::FailOn | Nil = nil, **opts) : Image

Load a formatted image from a stream This behaves exactly as new_from_source, but the image is loaded from a stream rathar than from a source. Note: AT least libvips 8.9 is needed

Source
new_temp_file(format : String) : Image

Make a new temporary image. Returns an image backed by a temporary file. When written to with 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 director.

vips uses g_mkstemp() to make the temporary filename. They generally look something like vips-12-EJKFGH.v format is the format for the temp file, for example %s.v for a vips format file. The %s is subsituted by the file path.

Note: VipsException is raised, if unable to make temp file from format

Source

Class methods

analyzeload(filename : String, **kwargs)

Load an analyze6 image

# out_, flags = Vips::Image.analyzeload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
arrayjoin(in_ : Array(Image), **kwargs)

Join an array of images

# out_ = Vips::Image.arrayjoin(in_, {across: Int32, shim: Int32, background: Array(Float64), halign: Enums::Align, valign: Enums::Align, hspacing: Int32, vspacing: Int32})

Input Parameters

Required

in : Array(Image) - Array of input images

Optionals

across : Int32 - Number of images across grid

shim : Int32 - Pixels between images

background : Array(Float64) - Colour for new pixels

halign : Enums::Align - Align on the left, centre or right

valign : Enums::Align - Align on the top, centre or bottom

hspacing : Int32 - Horizontal spacing between images

vspacing : Int32 - Vertical spacing between images

Returns

Output image

Source
black(width : Int32, height : Int32, **kwargs)

Make a black image

# out_ = Vips::Image.black(width, height, {bands: Int32})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

bands : Int32 - Number of bands in image

Returns

Output image

Source
csvload(filename : String, **kwargs)

Load csv

# out_, flags = Vips::Image.csvload(filename, {skip: Int32, lines: Int32, whitespace: String, separator: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

skip : Int32 - Skip this many lines at the start of the file

lines : Int32 - Read this many lines from the file

whitespace : String - Set of whitespace characters

separator : String - Set of separator characters

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
csvload_source(source : Source, **kwargs)

Load csv

# out_, flags = Vips::Image.csvload_source(source, {skip: Int32, lines: Int32, whitespace: String, separator: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

skip : Int32 - Skip this many lines at the start of the file

lines : Int32 - Read this many lines from the file

whitespace : String - Set of whitespace characters

separator : String - Set of separator characters

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
csvload_stream(stream : IO, **kwargs)

Load csv

# out_, flags = Vips::Image.csvload_stream(stream, {skip: Int32, lines: Int32, whitespace: String, separator: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

skip : Int32 - Skip this many lines at the start of the file

lines : Int32 - Read this many lines from the file

whitespace : String - Set of whitespace characters

separator : String - Set of separator characters

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
eye(width : Int32, height : Int32, **kwargs)

Make an image showing the eye's spatial response

# out_ = Vips::Image.eye(width, height, {uchar: Bool, factor: Float64})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

uchar : Bool - Output an unsigned char image

factor : Float64 - Maximum spatial frequency

Returns

Output image

Source
find_load(filename : String)

Find the name of the load operation vips will use to load a file. For example "VipsForeignLoadJpegFile". You can use this to work out what options to pass to new_from_file

Source
find_load_buffer(data : Bytes)

Find the name of the load operation vips will use to load a buffer. For example "VipsForeignLoadJpegBuffer". You can use this to work out what options to pass to new_from_buffer

Source
find_load_buffer(data : String)

Find the name of the load operation vips will use to load a buffer. For example "VipsForeignLoadJpegBuffer". You can use this to work out what options to pass to new_from_buffer

Source
find_load_source(source : Source)

Find the name of the load operation vips will use to load a source. For example "VipsForeignLoadJpegSource". You can use this to work out what options to pass to new_from_source

Source
find_load_stream(stream : Stream)

Find the name of the load operation vips will use to load a stream. For example "VipsForeignLoadJpegSource". You can use this to work out what options to pass to new_from_stream

Source
fitsload(filename : String, **kwargs)

Load a fits image

# out_, flags = Vips::Image.fitsload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
fitsload_source(source : Source, **kwargs)

Load fits from a source

# out_, flags = Vips::Image.fitsload_source(source, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
fitsload_stream(stream : IO, **kwargs)

Load fits from a stream

# out_, flags = Vips::Image.fitsload_stream(stream, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
fractsurf(width : Int32, height : Int32, fractal_dimension : Float64)

Make a fractal surface

# out_ = Vips::Image.fractsurf(width, height, fractal_dimension)

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

fractal_dimension : Float64 - Fractal dimension

Returns

Output image

Source
gaussmat(sigma : Float64, min_ampl : Float64, **kwargs)

Make a gaussian image

# out_ = Vips::Image.gaussmat(sigma, min_ampl, {separable: Bool, precision: Enums::Precision})

Input Parameters

Required

sigma : Float64 - Sigma of Gaussian

min_ampl : Float64 - Minimum amplitude of Gaussian

Optionals

separable : Bool - Generate separable Gaussian

precision : Enums::Precision - Generate with this precision

Returns

Output image

Source
gaussnoise(width : Int32, height : Int32, **kwargs)

Make a gaussnoise image

# out_ = Vips::Image.gaussnoise(width, height, {sigma: Float64, mean: Float64, seed: Int32})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

sigma : Float64 - Standard deviation of pixels in generated image

mean : Float64 - Mean of pixels in generated image

seed : Int32 - Random number seed

Returns

Output image

Source
gifload(filename : String, **kwargs)

Load gif with libnsgif

# out_, flags = Vips::Image.gifload(filename, {n: Int32, page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

n : Int32 - Number of pages to load, -1 for all

page : Int32 - First page to load

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
gifload_buffer(buffer : Bytes, **kwargs)

Load gif with libnsgif

# out_, flags = Vips::Image.gifload_buffer(buffer, {n: Int32, page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

n : Int32 - Number of pages to load, -1 for all

page : Int32 - First page to load

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
gifload_source(source : Source, **kwargs)

Load gif from source

# out_, flags = Vips::Image.gifload_source(source, {n: Int32, page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

n : Int32 - Number of pages to load, -1 for all

page : Int32 - First page to load

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
gifload_stream(stream : IO, **kwargs)

Load gif from stream

# out_, flags = Vips::Image.gifload_stream(stream, {n: Int32, page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

n : Int32 - Number of pages to load, -1 for all

page : Int32 - First page to load

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
grey(width : Int32, height : Int32, **kwargs)

Make a grey ramp image

# out_ = Vips::Image.grey(width, height, {uchar: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

uchar : Bool - Output an unsigned char image

Returns

Output image

Source
heifload(filename : String, **kwargs)

Load a heif image

# out_, flags = Vips::Image.heifload(filename, {page: Int32, n: Int32, thumbnail: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

thumbnail : Bool - Fetch thumbnail image

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
heifload_buffer(buffer : Bytes, **kwargs)

Load a heif image

# out_, flags = Vips::Image.heifload_buffer(buffer, {page: Int32, n: Int32, thumbnail: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

thumbnail : Bool - Fetch thumbnail image

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
heifload_source(source : Source, **kwargs)

Load a heif image

# out_, flags = Vips::Image.heifload_source(source, {page: Int32, n: Int32, thumbnail: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

thumbnail : Bool - Fetch thumbnail image

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
heifload_stream(stream : IO, **kwargs)

Load a heif image

# out_, flags = Vips::Image.heifload_stream(stream, {page: Int32, n: Int32, thumbnail: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

thumbnail : Bool - Fetch thumbnail image

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
identity

Make a 1d image where pixel values are indexes

# out_ = Vips::Image.identity({bands: Int32, ushort: Bool, size: Int32})

Input Parameters

Optionals

bands : Int32 - Number of bands in LUT

ushort : Bool - Create a 16-bit LUT

size : Int32 - Size of 16-bit LUT

Returns

Output image

Source
jp2kload(filename : String, **kwargs)

Load jpeg2000 image

# out_, flags = Vips::Image.jp2kload(filename, {page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

page : Int32 - Load this page from the image

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jp2kload_buffer(buffer : Bytes, **kwargs)

Load jpeg2000 image

# out_, flags = Vips::Image.jp2kload_buffer(buffer, {page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

page : Int32 - Load this page from the image

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jp2kload_source(source : Source, **kwargs)

Load jpeg2000 image

# out_, flags = Vips::Image.jp2kload_source(source, {page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

page : Int32 - Load this page from the image

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jp2kload_stream(stream : IO, **kwargs)

Load jpeg2000 image

# out_, flags = Vips::Image.jp2kload_stream(stream, {page: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

page : Int32 - Load this page from the image

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jpegload(filename : String, **kwargs)

Load jpeg from file

# out_, flags = Vips::Image.jpegload(filename, {shrink: Int32, autorotate: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

shrink : Int32 - Shrink factor on load

autorotate : Bool - Rotate image using exif orientation

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jpegload_buffer(buffer : Bytes, **kwargs)

Load jpeg from buffer

# out_, flags = Vips::Image.jpegload_buffer(buffer, {shrink: Int32, autorotate: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

shrink : Int32 - Shrink factor on load

autorotate : Bool - Rotate image using exif orientation

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jpegload_source(source : Source, **kwargs)

Load image from jpeg source

# out_, flags = Vips::Image.jpegload_source(source, {shrink: Int32, autorotate: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

shrink : Int32 - Shrink factor on load

autorotate : Bool - Rotate image using exif orientation

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jpegload_stream(stream : IO, **kwargs)

Load image from jpeg stream

# out_, flags = Vips::Image.jpegload_stream(stream, {shrink: Int32, autorotate: Bool, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

shrink : Int32 - Shrink factor on load

autorotate : Bool - Rotate image using exif orientation

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jxlload(filename : String, **kwargs)

Load jpeg-xl image

# out_, flags = Vips::Image.jxlload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jxlload_buffer(buffer : Bytes, **kwargs)

Load jpeg-xl image

# out_, flags = Vips::Image.jxlload_buffer(buffer, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jxlload_source(source : Source, **kwargs)

Load jpeg-xl image

# out_, flags = Vips::Image.jxlload_source(source, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
jxlload_stream(stream : IO, **kwargs)

Load jpeg-xl image

# out_, flags = Vips::Image.jxlload_stream(stream, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
logmat(sigma : Float64, min_ampl : Float64, **kwargs)

Make a laplacian of gaussian image

# out_ = Vips::Image.logmat(sigma, min_ampl, {separable: Bool, precision: Enums::Precision})

Input Parameters

Required

sigma : Float64 - Radius of Gaussian

min_ampl : Float64 - Minimum amplitude of Gaussian

Optionals

separable : Bool - Generate separable Gaussian

precision : Enums::Precision - Generate with this precision

Returns

Output image

Source
magickload(filename : String, **kwargs)

Load file with imagemagick7

# out_, flags = Vips::Image.magickload(filename, {density: String, page: Int32, n: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

density : String - Canvas resolution for rendering vector formats like SVG

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
magickload_buffer(buffer : Bytes, **kwargs)

Load buffer with imagemagick7

# out_, flags = Vips::Image.magickload_buffer(buffer, {density: String, page: Int32, n: Int32, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

density : String - Canvas resolution for rendering vector formats like SVG

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
mask_butterworth(width : Int32, height : Int32, order : Float64, frequency_cutoff : Float64, amplitude_cutoff : Float64, **kwargs)

Make a butterworth filter

# out_ = Vips::Image.mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

order : Float64 - Filter order

frequency_cutoff : Float64 - Frequency cutoff

amplitude_cutoff : Float64 - Amplitude cutoff

Optionals

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

Returns

Output image

Source
mask_butterworth_band(width : Int32, height : Int32, order : Float64, frequency_cutoff_x : Float64, frequency_cutoff_y : Float64, radius : Float64, amplitude_cutoff : Float64, **kwargs)

Make a butterworth_band filter

# out_ = Vips::Image.mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

order : Float64 - Filter order

frequency_cutoff_x : Float64 - Frequency cutoff x

frequency_cutoff_y : Float64 - Frequency cutoff y

radius : Float64 - Radius of circle

amplitude_cutoff : Float64 - Amplitude cutoff

Optionals

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

Returns

Output image

Source
mask_butterworth_ring(width : Int32, height : Int32, order : Float64, frequency_cutoff : Float64, amplitude_cutoff : Float64, ringwidth : Float64, **kwargs)

Make a butterworth ring filter

# out_ = Vips::Image.mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

order : Float64 - Filter order

frequency_cutoff : Float64 - Frequency cutoff

amplitude_cutoff : Float64 - Amplitude cutoff

ringwidth : Float64 - Ringwidth

Optionals

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

Returns

Output image

Source
mask_fractal(width : Int32, height : Int32, fractal_dimension : Float64, **kwargs)

Make fractal filter

# out_ = Vips::Image.mask_fractal(width, height, fractal_dimension, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

fractal_dimension : Float64 - Fractal dimension

Optionals

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

Returns

Output image

Source
mask_gaussian(width : Int32, height : Int32, frequency_cutoff : Float64, amplitude_cutoff : Float64, **kwargs)

Make a gaussian filter

# out_ = Vips::Image.mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

frequency_cutoff : Float64 - Frequency cutoff

amplitude_cutoff : Float64 - Amplitude cutoff

Optionals

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

Returns

Output image

Source
mask_gaussian_band(width : Int32, height : Int32, frequency_cutoff_x : Float64, frequency_cutoff_y : Float64, radius : Float64, amplitude_cutoff : Float64, **kwargs)

Make a gaussian filter

# out_ = Vips::Image.mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

frequency_cutoff_x : Float64 - Frequency cutoff x

frequency_cutoff_y : Float64 - Frequency cutoff y

radius : Float64 - Radius of circle

amplitude_cutoff : Float64 - Amplitude cutoff

Optionals

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

Returns

Output image

Source
mask_gaussian_ring(width : Int32, height : Int32, frequency_cutoff : Float64, amplitude_cutoff : Float64, ringwidth : Float64, **kwargs)

Make a gaussian ring filter

# out_ = Vips::Image.mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

frequency_cutoff : Float64 - Frequency cutoff

amplitude_cutoff : Float64 - Amplitude cutoff

ringwidth : Float64 - Ringwidth

Optionals

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

Returns

Output image

Source
mask_ideal(width : Int32, height : Int32, frequency_cutoff : Float64, **kwargs)

Make an ideal filter

# out_ = Vips::Image.mask_ideal(width, height, frequency_cutoff, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

frequency_cutoff : Float64 - Frequency cutoff

Optionals

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

Returns

Output image

Source
mask_ideal_band(width : Int32, height : Int32, frequency_cutoff_x : Float64, frequency_cutoff_y : Float64, radius : Float64, **kwargs)

Make an ideal band filter

# out_ = Vips::Image.mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

frequency_cutoff_x : Float64 - Frequency cutoff x

frequency_cutoff_y : Float64 - Frequency cutoff y

radius : Float64 - Radius of circle

Optionals

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

Returns

Output image

Source
mask_ideal_ring(width : Int32, height : Int32, frequency_cutoff : Float64, ringwidth : Float64, **kwargs)

Make an ideal ring filter

# out_ = Vips::Image.mask_ideal_ring(width, height, frequency_cutoff, ringwidth, {uchar: Bool, nodc: Bool, reject: Bool, optical: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

frequency_cutoff : Float64 - Frequency cutoff

ringwidth : Float64 - Ringwidth

Optionals

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

Returns

Output image

Source
matload(filename : String, **kwargs)

Load mat from file

# out_, flags = Vips::Image.matload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
matrixload(filename : String, **kwargs)

Load matrix

# out_, flags = Vips::Image.matrixload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
matrixload_source(source : Source, **kwargs)

Load matrix

# out_, flags = Vips::Image.matrixload_source(source, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
matrixload_stream(stream : IO, **kwargs)

Load matrix

# out_, flags = Vips::Image.matrixload_stream(stream, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
openexrload(filename : String, **kwargs)

Load an openexr image

# out_, flags = Vips::Image.openexrload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
openslideload(filename : String, **kwargs)

Load file with openslide

# out_, flags = Vips::Image.openslideload(filename, {level: Int32, autocrop: Bool, associated: String, attach_associated: Bool, rgb: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

level : Int32 - Load this level from the file

autocrop : Bool - Crop to image bounds

associated : String - Load this associated image

attach_associated : Bool - Attach all associated images

rgb : Bool - Output RGB (not RGBA)

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
openslideload_source(source : Source, **kwargs)

Load source with openslide

# out_, flags = Vips::Image.openslideload_source(source, {level: Int32, autocrop: Bool, associated: String, attach_associated: Bool, rgb: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

level : Int32 - Load this level from the file

autocrop : Bool - Crop to image bounds

associated : String - Load this associated image

attach_associated : Bool - Attach all associated images

rgb : Bool - Output RGB (not RGBA)

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
openslideload_stream(stream : IO, **kwargs)

Load stream with openslide

# out_, flags = Vips::Image.openslideload_stream(stream, {level: Int32, autocrop: Bool, associated: String, attach_associated: Bool, rgb: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

level : Int32 - Load this level from the file

autocrop : Bool - Crop to image bounds

associated : String - Load this associated image

attach_associated : Bool - Attach all associated images

rgb : Bool - Output RGB (not RGBA)

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pdfload(filename : String, **kwargs)

Load pdf from file

# out_, flags = Vips::Image.pdfload(filename, {page: Int32, n: Int32, dpi: Float64, scale: Float64, background: Array(Float64), password: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

dpi : Float64 - DPI to render at

scale : Float64 - Factor to scale by

background : Array(Float64) - Background colour

password : String - Password to decrypt with

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pdfload_buffer(buffer : Bytes, **kwargs)

Load pdf from buffer

# out_, flags = Vips::Image.pdfload_buffer(buffer, {page: Int32, n: Int32, dpi: Float64, scale: Float64, background: Array(Float64), password: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

dpi : Float64 - DPI to render at

scale : Float64 - Factor to scale by

background : Array(Float64) - Background colour

password : String - Password to decrypt with

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pdfload_source(source : Source, **kwargs)

Load pdf from source

# out_, flags = Vips::Image.pdfload_source(source, {page: Int32, n: Int32, dpi: Float64, scale: Float64, background: Array(Float64), password: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

dpi : Float64 - DPI to render at

scale : Float64 - Factor to scale by

background : Array(Float64) - Background colour

password : String - Password to decrypt with

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pdfload_stream(stream : IO, **kwargs)

Load pdf from stream

# out_, flags = Vips::Image.pdfload_stream(stream, {page: Int32, n: Int32, dpi: Float64, scale: Float64, background: Array(Float64), password: String, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

dpi : Float64 - DPI to render at

scale : Float64 - Factor to scale by

background : Array(Float64) - Background colour

password : String - Password to decrypt with

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
perlin(width : Int32, height : Int32, **kwargs)

Make a perlin noise image

# out_ = Vips::Image.perlin(width, height, {cell_size: Int32, uchar: Bool, seed: Int32})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

cell_size : Int32 - Size of Perlin cells

uchar : Bool - Output an unsigned char image

seed : Int32 - Random number seed

Returns

Output image

Source
pngload(filename : String, **kwargs)

Load png from file

# out_, flags = Vips::Image.pngload(filename, {unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pngload_buffer(buffer : Bytes, **kwargs)

Load png from buffer

# out_, flags = Vips::Image.pngload_buffer(buffer, {unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pngload_source(source : Source, **kwargs)

Load png from source

# out_, flags = Vips::Image.pngload_source(source, {unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
pngload_stream(stream : IO, **kwargs)

Load png from stream

# out_, flags = Vips::Image.pngload_stream(stream, {unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

unlimited : Bool - Remove all denial of service limits

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
ppmload(filename : String, **kwargs)

Load ppm from file

# out_, flags = Vips::Image.ppmload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
ppmload_source(source : Source, **kwargs)

Load ppm base class

# out_, flags = Vips::Image.ppmload_source(source, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
ppmload_stream(stream : IO, **kwargs)

Load ppm base class

# out_, flags = Vips::Image.ppmload_stream(stream, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
profile_load(name : String)

Load named icc profile

# profile = Vips::Image.profile_load(name)

Input Parameters

Required

name : String - Profile name

Returns

Loaded profile

Source
radload(filename : String, **kwargs)

Load a radiance image from a file

# out_, flags = Vips::Image.radload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
radload_buffer(buffer : Bytes, **kwargs)

Load rad from buffer

# out_, flags = Vips::Image.radload_buffer(buffer, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
radload_source(source : Source, **kwargs)

Load rad from source

# out_, flags = Vips::Image.radload_source(source, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
radload_stream(stream : IO, **kwargs)

Load rad from stream

# out_, flags = Vips::Image.radload_stream(stream, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
rawload(filename : String, width : Int32, height : Int32, bands : Int32, **kwargs)

Load raw data from a file

# out_, flags = Vips::Image.rawload(filename, width, height, bands, {offset: UInt32, format: Enums::BandFormat, interpretation: Enums::Interpretation, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

bands : Int32 - Number of bands in image

Optionals

offset : UInt32 - Offset in bytes from start of file

format : Enums::BandFormat - Pixel format in image

interpretation : Enums::Interpretation - Pixel interpretation

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
run_cmplx(image : Image, &block : Image -> Image)

run a complex operation on a complex image, or an image with an even number of bands ... handy for things like running .polar on .index images

Source
sines(width : Int32, height : Int32, **kwargs)

Make a 2d sine wave

# out_ = Vips::Image.sines(width, height, {uchar: Bool, hfreq: Float64, vfreq: Float64})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

uchar : Bool - Output an unsigned char image

hfreq : Float64 - Horizontal spatial frequency

vfreq : Float64 - Vertical spatial frequency

Returns

Output image

Source
sum(*in_ : Image)

Sum an array of images

# out_ = Vips::Image.sum(in_)

Input Parameters

Required

in : Array(Image) - Array of input images

Returns

Output image

Source
svgload(filename : String, **kwargs)

Load svg with rsvg

# out_, flags = Vips::Image.svgload(filename, {dpi: Float64, scale: Float64, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

dpi : Float64 - Render at this DPI

scale : Float64 - Scale output by this factor

unlimited : Bool - Allow SVG of any size

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
svgload_buffer(buffer : Bytes, **kwargs)

Load svg with rsvg

# out_, flags = Vips::Image.svgload_buffer(buffer, {dpi: Float64, scale: Float64, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

dpi : Float64 - Render at this DPI

scale : Float64 - Scale output by this factor

unlimited : Bool - Allow SVG of any size

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
svgload_source(source : Source, **kwargs)

Load svg from source

# out_, flags = Vips::Image.svgload_source(source, {dpi: Float64, scale: Float64, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

dpi : Float64 - Render at this DPI

scale : Float64 - Scale output by this factor

unlimited : Bool - Allow SVG of any size

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
svgload_stream(stream : IO, **kwargs)

Load svg from stream

# out_, flags = Vips::Image.svgload_stream(stream, {dpi: Float64, scale: Float64, unlimited: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

dpi : Float64 - Render at this DPI

scale : Float64 - Scale output by this factor

unlimited : Bool - Allow SVG of any size

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
switch(*tests : Image)

Find the index of the first non-zero pixel in tests

# out_ = Vips::Image.switch(tests)

Input Parameters

Required

tests : Array(Image) - Table of images to test

Returns

Output image

Source
system(cmd_format : String, **kwargs)

Run an external command

, out_, log = Vips::Image.system(cmd_format, {in_: Array(Image), out_format: String, in_format: String})

Input Parameters

Required

cmd_format : String - Command to run

Optionals

in : Array(Image) - Array of input images

out_format : String - Format for output filename

in_format : String - Format for input filename

Returns

Optionals

out : Image? - Output image

log : String? - Command log

Source
thumbnail(filename : String, width : Int32, **kwargs)

Generate thumbnail from file

# out_ = Vips::Image.thumbnail(filename, width, {height: Int32, size: Enums::Size, no_rotate: Bool, crop: Enums::Interesting, linear: Bool, import_profile: String, export_profile: String, intent: Enums::Intent, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to read from

width : Int32 - Size to this width

Optionals

height : Int32 - Size to this height

size : Enums::Size - Only upsize, only downsize, or both

no_rotate : Bool - Don't use orientation tags to rotate image upright

crop : Enums::Interesting - Reduce to fill target rectangle, then crop

linear : Bool - Reduce in linear light

import_profile : String - Fallback import profile

export_profile : String - Fallback export profile

intent : Enums::Intent - Rendering intent

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Source
thumbnail_buffer(buffer : Bytes, width : Int32, **kwargs)

Generate thumbnail from buffer

# out_ = Vips::Image.thumbnail_buffer(buffer, width, {option_string: String, height: Int32, size: Enums::Size, no_rotate: Bool, crop: Enums::Interesting, linear: Bool, import_profile: String, export_profile: String, intent: Enums::Intent, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

width : Int32 - Size to this width

Optionals

option_string : String - Options that are passed on to the underlying loader

height : Int32 - Size to this height

size : Enums::Size - Only upsize, only downsize, or both

no_rotate : Bool - Don't use orientation tags to rotate image upright

crop : Enums::Interesting - Reduce to fill target rectangle, then crop

linear : Bool - Reduce in linear light

import_profile : String - Fallback import profile

export_profile : String - Fallback export profile

intent : Enums::Intent - Rendering intent

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Source
thumbnail_source(source : Source, width : Int32, **kwargs)

Generate thumbnail from source

# out_ = Vips::Image.thumbnail_source(source, width, {option_string: String, height: Int32, size: Enums::Size, no_rotate: Bool, crop: Enums::Interesting, linear: Bool, import_profile: String, export_profile: String, intent: Enums::Intent, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

width : Int32 - Size to this width

Optionals

option_string : String - Options that are passed on to the underlying loader

height : Int32 - Size to this height

size : Enums::Size - Only upsize, only downsize, or both

no_rotate : Bool - Don't use orientation tags to rotate image upright

crop : Enums::Interesting - Reduce to fill target rectangle, then crop

linear : Bool - Reduce in linear light

import_profile : String - Fallback import profile

export_profile : String - Fallback export profile

intent : Enums::Intent - Rendering intent

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Source
thumbnail_stream(stream : IO, width : Int32, **kwargs)

Generate thumbnail from stream

# out_ = Vips::Image.thumbnail_stream(stream, width, {option_string: String, height: Int32, size: Enums::Size, no_rotate: Bool, crop: Enums::Interesting, linear: Bool, import_profile: String, export_profile: String, intent: Enums::Intent, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from

width : Int32 - Size to this width Optionals

option_string : String - Options that are passed on to the underlying loader

height : Int32 - Size to this height

size : Enums::Size - Only upsize, only downsize, or both

no_rotate : Bool - Don't use orientation tags to rotate image upright

crop : Enums::Interesting - Reduce to fill target rectangle, then crop

linear : Bool - Reduce in linear light

import_profile : String - Fallback import profile

export_profile : String - Fallback export profile

intent : Enums::Intent - Rendering intent

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

Source
tiffload(filename : String, **kwargs)

Load tiff from file

# out_, flags = Vips::Image.tiffload(filename, {page: Int32, subifd: Int32, n: Int32, autorotate: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

page : Int32 - First page to load

subifd : Int32 - Subifd index

n : Int32 - Number of pages to load, -1 for all

autorotate : Bool - Rotate image using orientation tag

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
tiffload_buffer(buffer : Bytes, **kwargs)

Load tiff from buffer

# out_, flags = Vips::Image.tiffload_buffer(buffer, {page: Int32, subifd: Int32, n: Int32, autorotate: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

page : Int32 - First page to load

subifd : Int32 - Subifd index

n : Int32 - Number of pages to load, -1 for all

autorotate : Bool - Rotate image using orientation tag

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
tiffload_source(source : Source, **kwargs)

Load tiff from source

# out_, flags = Vips::Image.tiffload_source(source, {page: Int32, subifd: Int32, n: Int32, autorotate: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

page : Int32 - First page to load

subifd : Int32 - Subifd index

n : Int32 - Number of pages to load, -1 for all

autorotate : Bool - Rotate image using orientation tag

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
tiffload_stream(stream : IO, **kwargs)

Load tiff from stream

# out_, flags = Vips::Image.tiffload_stream(stream, {page: Int32, subifd: Int32, n: Int32, autorotate: Bool, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

page : Int32 - First page to load

subifd : Int32 - Subifd index

n : Int32 - Number of pages to load, -1 for all

autorotate : Bool - Rotate image using orientation tag

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
tonelut

Build a look-up table

# out_ = Vips::Image.tonelut({in_max: Int32, out_max: Int32, lb: Float64, lw: Float64, ps: Float64, pm: Float64, ph: Float64, s: Float64, m: Float64, h: Float64})

Input Parameters

Optionals

in_max : Int32 - Size of LUT to build

out_max : Int32 - Maximum value in output LUT

lb : Float64 - Lowest value in output

lw : Float64 - Highest value in output

ps : Float64 - Position of shadow

pm : Float64 - Position of mid-tones

ph : Float64 - Position of highlights

s : Float64 - Adjust shadows by this much

m : Float64 - Adjust mid-tones by this much

h : Float64 - Adjust highlights by this much

Returns

Output image

Source
vipsload(filename : String, **kwargs)

Load vips from file

# out_, flags = Vips::Image.vipsload(filename, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
vipsload_source(source : Source, **kwargs)

Load vips from source

# out_, flags = Vips::Image.vipsload_source(source, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
vipsload_stream(stream : IO, **kwargs)

Load vips from stream

# out_, flags = Vips::Image.vipsload_stream(stream, {memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
webpload(filename : String, **kwargs)

Load webp from file

# out_, flags = Vips::Image.webpload(filename, {page: Int32, n: Int32, scale: Float64, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

filename : String - Filename to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

scale : Float64 - Factor to scale by

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
webpload_buffer(buffer : Bytes, **kwargs)

Load webp from buffer

# out_, flags = Vips::Image.webpload_buffer(buffer, {page: Int32, n: Int32, scale: Float64, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

buffer : Bytes - Buffer to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

scale : Float64 - Factor to scale by

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
webpload_source(source : Source, **kwargs)

Load webp from source

# out_, flags = Vips::Image.webpload_source(source, {page: Int32, n: Int32, scale: Float64, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

source : Source - Source to load from

Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

scale : Float64 - Factor to scale by

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
webpload_stream(stream : IO, **kwargs)

Load webp from stream

# out_, flags = Vips::Image.webpload_stream(stream, {page: Int32, n: Int32, scale: Float64, memory: Bool, access: Enums::Access, fail_on: Enums::FailOn})

Input Parameters

Required

stream : IO - Stream to load from Optionals

page : Int32 - First page to load

n : Int32 - Number of pages to load, -1 for all

scale : Float64 - Factor to scale by

memory : Bool - Force open via memory

access : Enums::Access - Required access pattern for this file

fail_on : Enums::FailOn - Error level to fail on

Returns

out : Image - Output image Optionals

flags : Enums::ForeignFlags? - Flags for this file

Source
worley(width : Int32, height : Int32, **kwargs)

Make a worley noise image

# out_ = Vips::Image.worley(width, height, {cell_size: Int32, seed: Int32})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

cell_size : Int32 - Size of Worley cells

seed : Int32 - Random number seed

Returns

Output image

Source
xyz(width : Int32, height : Int32, **kwargs)

Make an image where pixel values are coordinates

# out_ = Vips::Image.xyz(width, height, {csize: Int32, dsize: Int32, esize: Int32})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

csize : Int32 - Size of third dimension

dsize : Int32 - Size of fourth dimension

esize : Int32 - Size of fifth dimension

Returns

Output image

Source
zone(width : Int32, height : Int32, **kwargs)

Make a zone plate

# out_ = Vips::Image.zone(width, height, {uchar: Bool})

Input Parameters

Required

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

uchar : Bool - Output an unsigned char image

Returns

Output image

Source

Instance methods

!=(other)

Returns true if this object is not equal to other.

By default this method is implemented as !(self == other) so there's no need to override this unless there's a more efficient way to do it.

Source
%(other)
Source
&(other)
Source
*(other)
Source
**(exp : Image)

Raise to the power of an image

Source
**(exp : Array(Number))

Raise to the power of a constant or an array of constants

Source
**(*exp : Number)

Arc tangent of a constant or an array of constants in degrees

Source
+(other)
Source
-(other)
Source
/(other)
Source
<(other)
Source
<<(other)
Source
<=(other)
Source
==(other)

Returns false (other can only be a Value here).

Source
>(other)
Source
>=(other)
Source
>>(other)
Source
[](x : Int32, y : Int32)

A synonym for getpoint

Source
[](i : Int32)

pull out band elements from an image

Source
[](index : Range)

Fetch bands using a range

Source
^(other)
Source
|(other)
Source
a_cosh

Return the inverse hyperbolic cosine of an image in degrees.

Source
a_sinh

Return the inverse hyperbolic sine of an image in degrees.

Source
a_tan2(x : Image)

Arc tangent of an image in degrees.

Source
a_tanh

Return the inverse hyperbolic tangent of an image in degrees.

Source
abs

Absolute value of an image

# out_ = in.abs()

Returns

Output image

Source
acos

Return the inverse cosine of an image in degrees.

Source
add(right : Image)

Add two images

# out_ = left.add(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image

Source
add_alpha

Append an alpha channel to an image.

Source
affine(matrix : Array(Float64), **kwargs)

Affine transform of an image

# out_ = in.affine(matrix, {interpolate: Interpolate, oarea: Array(Int32), odx: Float64, ody: Float64, idx: Float64, idy: Float64, background: Array(Float64), premultiplied: Bool, extend: Enums::Extend})

Input Parameters

Required

matrix : Array(Float64) - Transformation matrix

Optionals

interpolate : Interpolate - Interpolate pixels with this

oarea : Array(Int32) - Area of output to generate

odx : Float64 - Horizontal output displacement

ody : Float64 - Vertical output displacement

idx : Float64 - Horizontal input displacement

idy : Float64 - Vertical input displacement

background : Array(Float64) - Background value

premultiplied : Bool - Images have premultiplied alpha

extend : Enums::Extend - How to generate the extra pixels

Returns

Output image

Source
asin

Return the inverse sine of an image in degrees.

Source
atan

Return the inverse tangent of an image in degrees.

Source
autorot

Autorotate image by exif tag

# out_, angle, flip = in.autorot()

Returns

Output image

Optionals

angle : Enums::Angle? - Angle image was rotated by

flip : Bool? - Whether the image was flipped or not

Source
avg

Find image average

# out_ = in.avg()

Returns

Output value

Source
band_exists?(i : Int32)

Does band exist in image.

Source
bandand

AND the bands of an image together

Source
bandbool(boolean : Enums::OperationBoolean)

Boolean operation across image bands

# out_ = in.bandbool(boolean)

Input Parameters

Required

boolean : Enums::OperationBoolean - Boolean to perform

Returns

Output image

Source
bandeor

EOR the bands of an image together

Source
bandfold

Fold up x axis into bands

# out_ = in.bandfold({factor: Int32})

Input Parameters

Optionals

factor : Int32 - Fold by this factor

Returns

Output image

Source
bandjoin(arr : Array(Int32)) : Image
Source
bandjoin(arr : Array(Float64)) : Image
Source
bandjoin(arr : Array(Image)) : Image
Source
bandjoin(*arr : Float64) : Image

Append a set of constants bandwise

Source
bandjoin(*arr : Int32) : Image

Append a set of constants bandwise

Source
bandjoin(*arr : Image) : Image

Append a set of images bandwise

Source
bandjoin(*arr : Image | Number) : Image

Append a set of mixed images and constants bandwise

Source
bandjoin_const(c : Array(Float64))

Append a constant band to an image

# out_ = in.bandjoin_const(c)

Input Parameters

Required

c : Array(Float64) - Array of constants to add

Returns

Output image

Source
bandmean

Band-wise average

# out_ = in.bandmean()

Returns

Output image

Source
bandor

OR the bands of an image together

Source
bandrank(*vals : Float64, **kwargs)

Band-wise rank a set of constants.

Optionals

index : Int32 - Select this band element from sorted list

Source
bandrank(*vals : Int32, **kwargs)

Band-wise rank a set of constants.

Optionals

index : Int32 - Select this band element from sorted list

Source
bandrank(*vals : Image, **kwargs)

Band-wise rank a set of images.

Optionals

index : Int32 - Select this band element from sorted list

Source
bandrank(*vals, **kwargs)

Band-wise rank a set of mixed images and constants.

Optionals

index : Int32 - Select this band element from sorted list

Source
bands

Number of bands in image

Source
bandsplit

Split an n-band image into n separate images.

Source
bandunfold

Unfold image bands into x axis

# out_ = in.bandunfold({factor: Int32})

Input Parameters

Optionals

factor : Int32 - Unfold by this factor

Returns

Output image

Source
boolean(right : Image, boolean : Enums::OperationBoolean)

Boolean operation on two images

# out_ = left.boolean(right, boolean)

Input Parameters

Required

right : Image - Right-hand image argument

boolean : Enums::OperationBoolean - Boolean to perform

Returns

Output image

Source
boolean_const(boolean : Enums::OperationBoolean, c : Array(Float64))

Boolean operations against a constant

# out_ = in.boolean_const(boolean, c)

Input Parameters

Required

boolean : Enums::OperationBoolean - Boolean to perform

c : Array(Float64) - Array of constants

Returns

Output image

Source
buildlut

Build a look-up table

# out_ = in.buildlut()

Returns

Output image

Source
byteswap

Byteswap an image

# out_ = in.byteswap()

Returns

Output image

Source
cache

Cache an image

# out_ = in.cache({max_tiles: Int32, tile_height: Int32, tile_width: Int32})

Input Parameters

Optionals

max_tiles : Int32 - Maximum number of tiles to cache

tile_height : Int32 - Tile height in pixels

tile_width : Int32 - Tile width in pixels

Returns

Output image

Source
canny

Canny edge detector

# out_ = in.canny({sigma: Float64, precision: Enums::Precision})

Input Parameters

Optionals

sigma : Float64 - Sigma of Gaussian

precision : Enums::Precision - Convolve with this precision

Returns

Output image

Source
case(*args : Float64) : Image

Use pixel values to pick cases from an array of constants

Source
case(*args : Int32) : Image

Use pixel values to pick cases from an array of constants

Source
case(*images : Image) : Image

Use pixel values to pick cases from an array of images.

Source
case(*args) : Image

Use pixel values to pick cases from an a set of mixed images and constants.

Source
cast(format : Enums::BandFormat, **kwargs)

Cast an image

# out_ = in.cast(format, {shift: Bool})

Input Parameters

Required

format : Enums::BandFormat - Format to cast to

Optionals

shift : Bool - Shift integer values up and down

Returns

Output image

Source
ceil

Return the smallest integral value not less than the argument.

Source
cmc2lch

Transform lch to cmc

# out_ = in.cmc2lch()

Returns

Output image

Source
cmyk2xyz

Transform cmyk to xyz

# out_ = in.cmyk2xyz()

Returns

Output image

Source
coding

Pixel coding

Source
colourspace(space : Enums::Interpretation, **kwargs)

Convert to a new colorspace

# out_ = in.colourspace(space, {source_space: Enums::Interpretation})

Input Parameters

Required

space : Enums::Interpretation - Destination color space

Optionals

source_space : Enums::Interpretation - Source color space

Returns

Output image

Source
compass(mask : Image, **kwargs)

Convolve with rotating mask

# out_ = in.compass(mask, {times: Int32, angle: Enums::Angle45, combine: Enums::Combine, precision: Enums::Precision, layers: Int32, cluster: Int32})

Input Parameters

Required

mask : Image - Input matrix image

Optionals

times : Int32 - Rotate and convolve this many times

angle : Enums::Angle45 - Rotate mask by this much between convolutions

combine : Enums::Combine - Combine convolution results like this

precision : Enums::Precision - Convolve with this precision

layers : Int32 - Use this many layers in approximation

cluster : Int32 - Cluster lines closer than this in approximation

Returns

Output image

Source
complex(cmplx : Enums::OperationComplex)

Perform a complex operation on an image

# out_ = in.complex(cmplx)

Input Parameters

Required

cmplx : Enums::OperationComplex - Complex to perform

Returns

Output image

Source
complex2(right : Image, cmplx : Enums::OperationComplex2)

Complex binary operations on two images

# out_ = left.complex2(right, cmplx)

Input Parameters

Required

right : Image - Right-hand image argument

cmplx : Enums::OperationComplex2 - Binary complex operation to perform

Returns

Output image

Source
complexform(right : Image)

Form a complex image from two real images

# out_ = left.complexform(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image

Source
complexget(get : Enums::OperationComplexget)

Get a component from a complex image

# out_ = in.complexget(get)

Input Parameters

Required

get : Enums::OperationComplexget - Complex to perform

Returns

Output image

Source
composite(images : Array(Image), modes : Array(Enums::BlendMode), **kwargs)

Blend an array of images with an array of blend modes

# out_ = Vips::Image.composite(images, modes, {x: Array(Int32), y: Array(Int32), compositing_space: Enums::Interpretation, premultiplied: Bool})

Input Parameters

Required

images : Array(Image) - Array of input images

modes : Array(Enums::BlendMode) - Array of Enums::BlendMode to join with

Optionals

x : Array(Int32) - Array of x coordinates to join at

y : Array(Int32) - Array of y coordinates to join at

compositing_space : Enums::Interpretation - Composite images in this colour space

premultiplied : Bool - Images have premultiplied alpha

Returns

Output Image

Source
composite(image : Image, mode : Enums::BlendMode, **kwargs)

A synonym for composite2

# out_ = Vips::Image.composite(overlay, mode, {x: Array(Int32), y: Array(Int32), compositing_space: Enums::Interpretation, premultiplied: Bool})

Input Parameters

Required

overlay : Image - Overlay image

*modes : Enums::BlendMode - VipsBlendMode to join with

Optionals

x : Int32 - x position of overlay

y : Int32 - y position of overlay

compositing_space : Enums::Interpretation - Composite images in this colour space

premultiplied : Bool - Images have premultiplied alpha

Returns

Output image

Source
composite2(overlay : Image, mode : Enums::BlendMode, **kwargs)

Blend a pair of images with a blend mode

# out_ = base.composite2(overlay, mode, {x: Int32, y: Int32, compositing_space: Enums::Interpretation, premultiplied: Bool})

Input Parameters

Required

overlay : Image - Overlay image

mode : Enums::BlendMode - VipsBlendMode to join with

Optionals

x : Int32 - x position of overlay

y : Int32 - y position of overlay

compositing_space : Enums::Interpretation - Composite images in this colour space

premultiplied : Bool - Images have premultiplied alpha

Returns

Output image

Source
conj

Return the complex conjugate of an image.

Source
contains(name : String)

Check if the underlying image contains an property of metadata.

Source
conv(mask : Image, **kwargs)

Convolution operation

# out_ = in.conv(mask, {precision: Enums::Precision, layers: Int32, cluster: Int32})

Input Parameters

Required

mask : Image - Input matrix image

Optionals

precision : Enums::Precision - Convolve with this precision

layers : Int32 - Use this many layers in approximation

cluster : Int32 - Cluster lines closer than this in approximation

Returns

Output image

Source
conva(mask : Image, **kwargs)

Approximate integer convolution

# out_ = in.conva(mask, {layers: Int32, cluster: Int32})

Input Parameters

Required

mask : Image - Input matrix image

Optionals

layers : Int32 - Use this many layers in approximation

cluster : Int32 - Cluster lines closer than this in approximation

Returns

Output image

Source
convasep(mask : Image, **kwargs)

Approximate separable integer convolution

# out_ = in.convasep(mask, {layers: Int32})

Input Parameters

Required

mask : Image - Input matrix image

Optionals

layers : Int32 - Use this many layers in approximation

Returns

Output image

Source
convf(mask : Image)

Float convolution operation

# out_ = in.convf(mask)

Input Parameters

Required

mask : Image - Input matrix image

Returns

Output image

Source
convi(mask : Image)

Int convolution operation

# out_ = in.convi(mask)

Input Parameters

Required

mask : Image - Input matrix image

Returns

Output image

Source
convsep(mask : Image, **kwargs)

Seperable convolution operation

# out_ = in.convsep(mask, {precision: Enums::Precision, layers: Int32, cluster: Int32})

Input Parameters

Required

mask : Image - Input matrix image

Optionals

precision : Enums::Precision - Convolve with this precision

layers : Int32 - Use this many layers in approximation

cluster : Int32 - Cluster lines closer than this in approximation

Returns

Output image

Source
copy

Copy an image

# out_ = in.copy({width: Int32, height: Int32, bands: Int32, format: Enums::BandFormat, coding: Enums::Coding, interpretation: Enums::Interpretation, xres: Float64, yres: Float64, xoffset: Int32, yoffset: Int32})

Input Parameters

Optionals

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

bands : Int32 - Number of bands in image

format : Enums::BandFormat - Pixel format in image

coding : Enums::Coding - Pixel coding

interpretation : Enums::Interpretation - Pixel interpretation

xres : Float64 - Horizontal resolution in pixels/mm

yres : Float64 - Vertical resolution in pixels/mm

xoffset : Int32 - Horizontal offset of origin

yoffset : Int32 - Vertical offset of origin

Returns

Output image

Source
copy_memory

Copy an image to a memory area.

This can be useful for reusing results, but can obviously use a lot of memory for large images. See {Image#tilecache} for a way of caching parts of an image.

Returns new memory Image

Source
cos

Return the cosine of an image in degrees.

Source
cosh

Return the hyperbolic cosine of an image in degrees.

Source
countlines(direction : Enums::Direction)

Count lines in an image

# nolines = in.countlines(direction)

Input Parameters

Required

direction : Enums::Direction - Countlines left-right or up-down

Returns

Number of lines

Source
crop(left : Int32, top : Int32, width : Int32, height : Int32)

A synonym for extract_area

Source
csvsave(filename : String, **kwargs)

Save image to csv

in.csvsave(filename, {separator: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

separator : String - Separator characters

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
csvsave_stream(stream : IO, **kwargs)

Save image to csv

in.csvsave_stream(stream, {separator: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

separator : String - Separator characters

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
csvsave_target(target : Target, **kwargs)

Save image to csv

in.csvsave_target(target, {separator: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

separator : String - Separator characters

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
de00(right : Image)

Calculate de00

# out_ = left.de00(right)

Input Parameters

Required

right : Image - Right-hand input image

Returns

Output image

Source
de76(right : Image)

Calculate de76

# out_ = left.de76(right)

Input Parameters

Required

right : Image - Right-hand input image

Returns

Output image

Source
decmc(right : Image)

Calculate decmc

# out_ = left.decmc(right)

Input Parameters

Required

right : Image - Right-hand input image

Returns

Output image

Source
deviate

Find image standard deviation

# out_ = in.deviate()

Returns

Output value

Source
dilate(mask : Image)

Dilate with a structuring element.

Source
divide(right : Image)

Divide two images

# out_ = left.divide(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image

Source
dzsave(filename : String, **kwargs)

Save image to deepzoom file

in.dzsave(filename, {basename: String, layout: Enums::ForeignDzLayout, suffix: String, overlap: Int32, tile_size: Int32, centre: Bool, depth: Enums::ForeignDzDepth, angle: Enums::Angle, container: Enums::ForeignDzContainer, compression: Int32, region_shrink: Enums::RegionShrink, skip_blanks: Int32, no_strip: Bool, id: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

basename : String - Base name to save to

layout : Enums::ForeignDzLayout - Directory layout

suffix : String - Filename suffix for tiles

overlap : Int32 - Tile overlap in pixels

tile_size : Int32 - Tile size in pixels

centre : Bool - Center image in tile

depth : Enums::ForeignDzDepth - Pyramid depth

angle : Enums::Angle - Rotate image during save

container : Enums::ForeignDzContainer - Pyramid container type

compression : Int32 - ZIP deflate compression level

region_shrink : Enums::RegionShrink - Method to shrink regions

skip_blanks : Int32 - Skip tiles which are nearly equal to the background

no_strip : Bool - Don't strip tile metadata

id : String - Resource ID

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
dzsave_buffer

Save image to dz buffer

# buffer = in.dzsave_buffer({basename: String, layout: Enums::ForeignDzLayout, suffix: String, overlap: Int32, tile_size: Int32, centre: Bool, depth: Enums::ForeignDzDepth, angle: Enums::Angle, container: Enums::ForeignDzContainer, compression: Int32, region_shrink: Enums::RegionShrink, skip_blanks: Int32, no_strip: Bool, id: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

basename : String - Base name to save to

layout : Enums::ForeignDzLayout - Directory layout

suffix : String - Filename suffix for tiles

overlap : Int32 - Tile overlap in pixels

tile_size : Int32 - Tile size in pixels

centre : Bool - Center image in tile

depth : Enums::ForeignDzDepth - Pyramid depth

angle : Enums::Angle - Rotate image during save

container : Enums::ForeignDzContainer - Pyramid container type

compression : Int32 - ZIP deflate compression level

region_shrink : Enums::RegionShrink - Method to shrink regions

skip_blanks : Int32 - Skip tiles which are nearly equal to the background

no_strip : Bool - Don't strip tile metadata

id : String - Resource ID

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
dzsave_stream(stream : IO, **kwargs)

Save image to deepzoom stream

in.dzsave_stream(stream, {basename: String, layout: Enums::ForeignDzLayout, suffix: String, overlap: Int32, tile_size: Int32, centre: Bool, depth: Enums::ForeignDzDepth, angle: Enums::Angle, container: Enums::ForeignDzContainer, compression: Int32, region_shrink: Enums::RegionShrink, skip_blanks: Int32, no_strip: Bool, id: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

basename : String - Base name to save to

layout : Enums::ForeignDzLayout - Directory layout

suffix : String - Filename suffix for tiles

overlap : Int32 - Tile overlap in pixels

tile_size : Int32 - Tile size in pixels

centre : Bool - Center image in tile

depth : Enums::ForeignDzDepth - Pyramid depth

angle : Enums::Angle - Rotate image during save

container : Enums::ForeignDzContainer - Pyramid container type

compression : Int32 - ZIP deflate compression level

region_shrink : Enums::RegionShrink - Method to shrink regions

skip_blanks : Int32 - Skip tiles which are nearly equal to the background

no_strip : Bool - Don't strip tile metadata

id : String - Resource ID

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
dzsave_target(target : Target, **kwargs)

Save image to deepzoom target

in.dzsave_target(target, {basename: String, layout: Enums::ForeignDzLayout, suffix: String, overlap: Int32, tile_size: Int32, centre: Bool, depth: Enums::ForeignDzDepth, angle: Enums::Angle, container: Enums::ForeignDzContainer, compression: Int32, region_shrink: Enums::RegionShrink, skip_blanks: Int32, no_strip: Bool, id: String, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

basename : String - Base name to save to

layout : Enums::ForeignDzLayout - Directory layout

suffix : String - Filename suffix for tiles

overlap : Int32 - Tile overlap in pixels

tile_size : Int32 - Tile size in pixels

centre : Bool - Center image in tile

depth : Enums::ForeignDzDepth - Pyramid depth

angle : Enums::Angle - Rotate image during save

container : Enums::ForeignDzContainer - Pyramid container type

compression : Int32 - ZIP deflate compression level

region_shrink : Enums::RegionShrink - Method to shrink regions

skip_blanks : Int32 - Skip tiles which are nearly equal to the background

no_strip : Bool - Don't strip tile metadata

id : String - Resource ID

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
embed(x : Int32, y : Int32, width : Int32, height : Int32, **kwargs)

Embed an image in a larger image

# out_ = in.embed(x, y, width, height, {extend: Enums::Extend, background: Array(Float64)})

Input Parameters

Required

x : Int32 - Left edge of input in output

y : Int32 - Top edge of input in output

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

extend : Enums::Extend - How to generate the extra pixels

background : Array(Float64) - Color for background pixels

Returns

Output image

Source
erode(mask : Image)

Erode with a structuring element.

Source
exp

Returns e ** pixel

Source
exp10

Returns 10 ** pixel

Source
extract_area(left : Int32, top : Int32, width : Int32, height : Int32)

Extract an area from an image

# out_ = input.extract_area(left, top, width, height)

Input Parameters

Required

left : Int32 - Left edge of extract area

top : Int32 - Top edge of extract area

width : Int32 - Width of extract area

height : Int32 - Height of extract area

Returns

Output image

Source
extract_band(band : Int32, **kwargs)

Extract band from an image

# out_ = in.extract_band(band, {n: Int32})

Input Parameters

Required

band : Int32 - Band to extract

Optionals

n : Int32 - Number of bands to extract

Returns

Output image

Source
falsecolour

False-color an image

# out_ = in.falsecolour()

Returns

Output image

Source
fastcor(ref : Image)

Fast correlation

# out_ = in.fastcor(ref)

Input Parameters

Required

ref : Image - Input reference image

Returns

Output image

Source
filename

Image filename

Source
fill_nearest

Fill image zeros with nearest non-zero pixel

# out_, distance = in.fill_nearest()

Returns

Value of nearest non-zero pixel

Optionals

distance : Image? - Distance to nearest non-zero pixel

Source
find_trim

Search an image for non-edge areas

# output   = in.find_trim({threshold: Float64, background: Array(Float64)})

Input Parameters

Optionals

threshold : Float64 - Object threshold

background : Array(Float64) - Color for background pixels

Returns

Left edge of image

Top edge of extract area

Width of extract area

Height of extract area

Source
fitssave(filename : String, **kwargs)

Save image to fits file

in.fitssave(filename, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
flatten

Flatten alpha out of an image

# out_ = in.flatten({background: Array(Float64), max_alpha: Float64})

Input Parameters

Optionals

background : Array(Float64) - Background value

max_alpha : Float64 - Maximum value of alpha channel

Returns

Output image

Source
flip(direction : Enums::Direction)

Flip an image

# out_ = in.flip(direction)

Input Parameters

Required

direction : Enums::Direction - Direction to flip image

Returns

Output image

Source
fliphor

Flip horizontally

Source
flipver

Flip vertically

Source
float2rad

Transform float rgb to radiance coding

# out_ = in.float2rad()

Returns

Output image

Source
floor

Return the largest integral value not greater than the argument.

Source
format

Pixel format in image

Source
freqmult(mask : Image)

Frequency-domain filtering

# out_ = in.freqmult(mask)

Input Parameters

Required

mask : Image - Input mask image

Returns

Output image

Source
fwfft

Forward fft

# out_ = in.fwfft()

Returns

Output image

Source
gamma

Gamma an image

# out_ = in.gamma({exponent: Float64})

Input Parameters

Optionals

exponent : Float64 - Gamma factor

Returns

Output image

Source
gaussblur(sigma : Float64, **kwargs)

Gaussian blur

# out_ = in.gaussblur(sigma, {min_ampl: Float64, precision: Enums::Precision})

Input Parameters

Required

sigma : Float64 - Sigma of Gaussian

Optionals

min_ampl : Float64 - Minimum amplitude of Gaussian

precision : Enums::Precision - Convolve with this precision

Returns

Output image

Source
get(name : String)

Get a metadata item from an image. Crystal types are constructed automatically from the GValue, if possible.

For example, you can read the ICC profile from an image like this:

profile = image.get "icc-profile-data"

and profile will be an array containing the profile.

Source
get_fields

Get the names of all fields on an image. Use this to loop over all image metadata.

Source
get_typeof(nam : String)

Get the GType of a GObject property

Source
getpoint(x : Int32, y : Int32)

Read a point from an image

# out_array = in.getpoint(x, y)

Input Parameters

Required

x : Int32 - Point to read

y : Int32 - Point to read

Returns

Array of output values

Source
gifsave(filename : String, **kwargs)

Save as gif

in.gifsave(filename, {dither: Float64, effort: Int32, bitdepth: Int32, interframe_maxerror: Float64, reuse: Bool, interpalette_maxerror: Float64, interlace: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

dither : Float64 - Amount of dithering

effort : Int32 - Quantisation effort

bitdepth : Int32 - Number of bits per pixel

interframe_maxerror : Float64 - Maximum inter-frame error for transparency

reuse : Bool - Reuse palette from input

interpalette_maxerror : Float64 - Maximum inter-palette error for palette reusage

interlace : Bool - Generate an interlaced (progressive) GIF

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
gifsave_buffer

Save as gif

# buffer = in.gifsave_buffer({dither: Float64, effort: Int32, bitdepth: Int32, interframe_maxerror: Float64, reuse: Bool, interpalette_maxerror: Float64, interlace: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

dither : Float64 - Amount of dithering

effort : Int32 - Quantisation effort

bitdepth : Int32 - Number of bits per pixel

interframe_maxerror : Float64 - Maximum inter-frame error for transparency

reuse : Bool - Reuse palette from input

interpalette_maxerror : Float64 - Maximum inter-palette error for palette reusage

interlace : Bool - Generate an interlaced (progressive) GIF

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
gifsave_stream(stream : IO, **kwargs)

Save as gif

in.gifsave_stream(stream, {dither: Float64, effort: Int32, bitdepth: Int32, interframe_maxerror: Float64, reuse: Bool, interpalette_maxerror: Float64, interlace: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

dither : Float64 - Amount of dithering

effort : Int32 - Quantisation effort

bitdepth : Int32 - Number of bits per pixel

interframe_maxerror : Float64 - Maximum inter-frame error for transparency

reuse : Bool - Reuse palette from input

interpalette_maxerror : Float64 - Maximum inter-palette error for palette reusage

interlace : Bool - Generate an interlaced (progressive) GIF

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
gifsave_target(target : Target, **kwargs)

Save as gif

in.gifsave_target(target, {dither: Float64, effort: Int32, bitdepth: Int32, interframe_maxerror: Float64, reuse: Bool, interpalette_maxerror: Float64, interlace: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

dither : Float64 - Amount of dithering

effort : Int32 - Quantisation effort

bitdepth : Int32 - Number of bits per pixel

interframe_maxerror : Float64 - Maximum inter-frame error for transparency

reuse : Bool - Reuse palette from input

interpalette_maxerror : Float64 - Maximum inter-palette error for palette reusage

interlace : Bool - Generate an interlaced (progressive) GIF

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
globalbalance

Global balance an image mosaic

# out_ = in.globalbalance({gamma: Float64, int_output: Bool})

Input Parameters

Optionals

gamma : Float64 - Image gamma

int_output : Bool - Integer output

Returns

Output image

Source
gravity(direction : Enums::CompassDirection, width : Int32, height : Int32, **kwargs)

Place an image within a larger image with a certain gravity

# out_ = in.gravity(direction, width, height, {extend: Enums::Extend, background: Array(Float64)})

Input Parameters

Required

direction : Enums::CompassDirection - Direction to place image within width/height

width : Int32 - Image width in pixels

height : Int32 - Image height in pixels

Optionals

extend : Enums::Extend - How to generate the extra pixels

background : Array(Float64) - Color for background pixels

Returns

Output image

Source
grid(tile_height : Int32, across : Int32, down : Int32)

Grid an image

# out_ = in.grid(tile_height, across, down)

Input Parameters

Required

tile_height : Int32 - Chop into tiles this high

across : Int32 - Number of tiles across

down : Int32 - Number of tiles down

Returns

Output image

Source
has_alpha?

Does this image have an alpha channel?

Source
height

Image height in pixels

Source
hist_cum

Form cumulative histogram

# out_ = in.hist_cum()

Returns

Output image

Source
hist_entropy

Estimate image entropy

# out_ = in.hist_entropy()

Returns

Output value

Source
hist_equal

Histogram equalisation

# out_ = in.hist_equal({band: Int32})

Input Parameters

Optionals

band : Int32 - Equalise with this band

Returns

Output image

Source
hist_find

Find image histogram

# out_ = in.hist_find({band: Int32})

Input Parameters

Optionals

band : Int32 - Find histogram of band

Returns

Output histogram

Source
hist_find_indexed(index : Image, **kwargs)

Find indexed image histogram

# out_ = in.hist_find_indexed(index, {combine: Enums::Combine})

Input Parameters

Required

index : Image - Index image

Optionals

combine : Enums::Combine - Combine bins like this

Returns

Output histogram

Source
hist_find_ndim

Find n-dimensional image histogram

# out_ = in.hist_find_ndim({bins: Int32})

Input Parameters

Optionals

bins : Int32 - Number of bins in each dimension

Returns

Output histogram

Source
hist_ismonotonic

Test for monotonicity

# monotonic = in.hist_ismonotonic()

Returns

true if in is monotonic

Source
hist_local(width : Int32, height : Int32, **kwargs)

Local histogram equalisation

# out_ = in.hist_local(width, height, {max_slope: Int32})

Input Parameters

Required

width : Int32 - Window width in pixels

height : Int32 - Window height in pixels

Optionals

max_slope : Int32 - Maximum slope (CLAHE)

Returns

Output image

Source
hist_match(ref : Image)

Match two histograms

# out_ = in.hist_match(ref)

Input Parameters

Required

ref : Image - Reference histogram

Returns

Output image

Source
hist_norm

Normalise histogram

# out_ = in.hist_norm()

Returns

Output image

Source
hist_plot

Plot histogram

# out_ = in.hist_plot()

Returns

Output image

Source
hough_circle

Find hough circle transform

# out_ = in.hough_circle({scale: Int32, min_radius: Int32, max_radius: Int32})

Input Parameters

Optionals

scale : Int32 - Scale down dimensions by this factor

min_radius : Int32 - Smallest radius to search for

max_radius : Int32 - Largest radius to search for

Returns

Output image

Source
hough_line

Find hough line transform

# out_ = in.hough_line({width: Int32, height: Int32})

Input Parameters

Optionals

width : Int32 - Horizontal size of parameter space

height : Int32 - Vertical size of parameter space

Returns

Output image

Source
hsv2srgb

Transform hsv to srgb

# out_ = in.hsv2srgb()

Returns

Output image

Source
icc_export

Output to device with icc profile

# out_ = in.icc_export({pcs: Enums::PCS, intent: Enums::Intent, black_point_compensation: Bool, output_profile: String, depth: Int32})

Input Parameters

Optionals

pcs : Enums::PCS - Set Profile Connection Space

intent : Enums::Intent - Rendering intent

black_point_compensation : Bool - Enable black point compensation

output_profile : String - Filename to load output profile from

depth : Int32 - Output device space depth in bits

Returns

Output image

Source
icc_import

Import from device with icc profile

# out_ = in.icc_import({pcs: Enums::PCS, intent: Enums::Intent, black_point_compensation: Bool, embedded: Bool, input_profile: String})

Input Parameters

Optionals

pcs : Enums::PCS - Set Profile Connection Space

intent : Enums::Intent - Rendering intent

black_point_compensation : Bool - Enable black point compensation

embedded : Bool - Use embedded input profile, if available

input_profile : String - Filename to load input profile from

Returns

Output image

Source
icc_transform(output_profile : String, **kwargs)

Transform between devices with icc profiles

# out_ = in.icc_transform(output_profile, {pcs: Enums::PCS, intent: Enums::Intent, black_point_compensation: Bool, embedded: Bool, input_profile: String, depth: Int32})

Input Parameters

Required

output_profile : String - Filename to load output profile from

Optionals

pcs : Enums::PCS - Set Profile Connection Space

intent : Enums::Intent - Rendering intent

black_point_compensation : Bool - Enable black point compensation

embedded : Bool - Use embedded input profile, if available

input_profile : String - Filename to load input profile from

depth : Int32 - Output device space depth in bits

Returns

Output image

Source
ifthenelse(in1, in2, blend = false)

ifthenelse an image Select pixels from th if self is non-zero and from el if self is zero. Use the :blend option to fade smoothly between th and el.

in1 : Image | Float64 | Array(Float64) true values

in2 : Image | Float64 | Array(Float64) false values

blend : Bool (false) Blend smoothly between in1 and in2

Returns merged Image

Source
imag

Return the imaginary part of a complex image.

Source
insert(sub : Image, x : Int32, y : Int32, **kwargs)

Insert image @sub into @main at @x, @y

# out_ = main.insert(sub, x, y, {expand: Bool, background: Array(Float64)})

Input Parameters

Required

sub : Image - Sub-image to insert into main image

x : Int32 - Left edge of sub in main

y : Int32 - Top edge of sub in main

Optionals

expand : Bool - Expand output to hold all of both inputs

background : Array(Float64) - Color for new pixels

Returns

Output image

Source
interpretation

Pixel interpretation

Source
invert

Invert an image

# out_ = in.invert()

Returns

Output image

Source
invertlut

Build an inverted look-up table

# out_ = in.invertlut({size: Int32})

Input Parameters

Optionals

size : Int32 - LUT size to generate

Returns

Output image

Source
invfft

Inverse fft

# out_ = in.invfft({real: Bool})

Input Parameters

Optionals

real : Bool - Output only the real part of the transform

Returns

Output image

Source
join(in2 : Image, direction : Enums::Direction, **kwargs)

Join a pair of images

# out_ = in1.join(in2, direction, {expand: Bool, shim: Int32, background: Array(Float64), align: Enums::Align})

Input Parameters

Required

in2 : Image - Second input image

direction : Enums::Direction - Join left-right or up-down

Optionals

expand : Bool - Expand output to hold all of both inputs

shim : Int32 - Pixels between images

background : Array(Float64) - Colour for new pixels

align : Enums::Align - Align on the low, centre or high coordinate edge

Returns

Output image

Source
jp2ksave(filename : String, **kwargs)

Save image in jpeg2000 format

in.jp2ksave(filename, {tile_width: Int32, tile_height: Int32, lossless: Bool, q: Int32, subsample_mode: Enums::ForeignSubsample, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to load from

Optionals

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

lossless : Bool - Enable lossless compression

q : Int32 - Q factor

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jp2ksave_buffer

Save image in jpeg2000 format

# buffer = in.jp2ksave_buffer({tile_width: Int32, tile_height: Int32, lossless: Bool, q: Int32, subsample_mode: Enums::ForeignSubsample, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

lossless : Bool - Enable lossless compression

q : Int32 - Q factor

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
jp2ksave_stream(stream : IO, **kwargs)

Save image in jpeg2000 format

in.jp2ksave_stream(stream, {tile_width: Int32, tile_height: Int32, lossless: Bool, q: Int32, subsample_mode: Enums::ForeignSubsample, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

lossless : Bool - Enable lossless compression

q : Int32 - Q factor

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jp2ksave_target(target : Target, **kwargs)

Save image in jpeg2000 format

in.jp2ksave_target(target, {tile_width: Int32, tile_height: Int32, lossless: Bool, q: Int32, subsample_mode: Enums::ForeignSubsample, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

lossless : Bool - Enable lossless compression

q : Int32 - Q factor

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jpegsave(filename : String, **kwargs)

Save image to jpeg file

in.jpegsave(filename, {q: Int32, profile: String, optimize_coding: Bool, interlace: Bool, trellis_quant: Bool, overshoot_deringing: Bool, optimize_scans: Bool, quant_table: Int32, subsample_mode: Enums::ForeignSubsample, restart_interval: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

q : Int32 - Q factor

profile : String - 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 : Int32 - Use predefined quantization table with given index

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

restart_interval : Int32 - Add restart markers every specified number of mcu

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jpegsave_buffer

Save image to jpeg buffer

# buffer = in.jpegsave_buffer({q: Int32, profile: String, optimize_coding: Bool, interlace: Bool, trellis_quant: Bool, overshoot_deringing: Bool, optimize_scans: Bool, quant_table: Int32, subsample_mode: Enums::ForeignSubsample, restart_interval: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

q : Int32 - Q factor

profile : String - 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 : Int32 - Use predefined quantization table with given index

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

restart_interval : Int32 - Add restart markers every specified number of mcu

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
jpegsave_mime

Save image to jpeg mime

in.jpegsave_mime({q: Int32, profile: String, optimize_coding: Bool, interlace: Bool, trellis_quant: Bool, overshoot_deringing: Bool, optimize_scans: Bool, quant_table: Int32, subsample_mode: Enums::ForeignSubsample, restart_interval: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

q : Int32 - Q factor

profile : String - 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 : Int32 - Use predefined quantization table with given index

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

restart_interval : Int32 - Add restart markers every specified number of mcu

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jpegsave_stream(stream : IO, **kwargs)

Save image to jpeg stream

in.jpegsave_stream(stream, {q: Int32, profile: String, optimize_coding: Bool, interlace: Bool, trellis_quant: Bool, overshoot_deringing: Bool, optimize_scans: Bool, quant_table: Int32, subsample_mode: Enums::ForeignSubsample, restart_interval: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

q : Int32 - Q factor

profile : String - 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 : Int32 - Use predefined quantization table with given index

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

restart_interval : Int32 - Add restart markers every specified number of mcu

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jpegsave_target(target : Target, **kwargs)

Save image to jpeg target

in.jpegsave_target(target, {q: Int32, profile: String, optimize_coding: Bool, interlace: Bool, trellis_quant: Bool, overshoot_deringing: Bool, optimize_scans: Bool, quant_table: Int32, subsample_mode: Enums::ForeignSubsample, restart_interval: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

q : Int32 - Q factor

profile : String - 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 : Int32 - Use predefined quantization table with given index

subsample_mode : Enums::ForeignSubsample - Select chroma subsample operation mode

restart_interval : Int32 - Add restart markers every specified number of mcu

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jxlsave(filename : String, **kwargs)

Save image in jpeg-xl format

in.jxlsave(filename, {tier: Int32, distance: Float64, effort: Int32, lossless: Bool, q: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to load from

Optionals

tier : Int32 - Decode speed tier

distance : Float64 - Target butteraugli distance

effort : Int32 - Encoding effort

lossless : Bool - Enable lossless compression

q : Int32 - Quality factor

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jxlsave_buffer

Save image in jpeg-xl format

# buffer = in.jxlsave_buffer({tier: Int32, distance: Float64, effort: Int32, lossless: Bool, q: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

tier : Int32 - Decode speed tier

distance : Float64 - Target butteraugli distance

effort : Int32 - Encoding effort

lossless : Bool - Enable lossless compression

q : Int32 - Quality factor

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
jxlsave_stream(stream : IO, **kwargs)

Save image in jpeg-xl format

in.jxlsave_stream(stream, {tier: Int32, distance: Float64, effort: Int32, lossless: Bool, q: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

tier : Int32 - Decode speed tier

distance : Float64 - Target butteraugli distance

effort : Int32 - Encoding effort

lossless : Bool - Enable lossless compression

q : Int32 - Quality factor

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
jxlsave_target(target : Target, **kwargs)

Save image in jpeg-xl format

in.jxlsave_target(target, {tier: Int32, distance: Float64, effort: Int32, lossless: Bool, q: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

tier : Int32 - Decode speed tier

distance : Float64 - Target butteraugli distance

effort : Int32 - Encoding effort

lossless : Bool - Enable lossless compression

q : Int32 - Quality factor

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
killed?

If image has been killed see set_kill, set an error message, clear the kill flag and return true. Otherwise return false

Handy for loops which need to run sets of threads which can fail. At least libvips 8.8 is needed. If this version requirement is not met, it will always return false.

Source
lab2labq

Transform float lab to labq coding

# out_ = in.lab2labq()

Returns

Output image

Source
lab2labs

Transform float lab to signed short

# out_ = in.lab2labs()

Returns

Output image

Source
lab2lch

Transform lab to lch

# out_ = in.lab2lch()

Returns

Output image

Source
lab2xyz

Transform cielab to xyz

# out_ = in.lab2xyz({temp: Array(Float64)})

Input Parameters

Optionals

temp : Array(Float64) - Color temperature

Returns

Output image

Source
labelregions

Label regions in an image

# mask, segments = in.labelregions()

Returns

Mask of region labels

Optionals

segments : Int32? - Number of discrete contiguous regions

Source
labq2lab

Unpack a labq image to float lab

# out_ = in.labq2lab()

Returns

Output image

Source
labq2labs

Unpack a labq image to short lab

# out_ = in.labq2labs()

Returns

Output image

Source
labq2srgb

Convert a labq image to srgb

# out_ = in.labq2srgb()

Returns

Output image

Source
labs2lab

Transform signed short lab to float

# out_ = in.labs2lab()

Returns

Output image

Source
labs2labq

Transform short lab to labq coding

# out_ = in.labs2labq()

Returns

Output image

Source
lch2cmc

Transform lch to cmc

# out_ = in.lch2cmc()

Returns

Output image

Source
lch2lab

Transform lch to lab

# out_ = in.lch2lab()

Returns

Output image

Source
linear(a : Array(Float64), b : Array(Float64), **kwargs)

Calculate (a * in + b)

# out_ = in.linear(a, b, {uchar: Bool})

Input Parameters

Required

a : Array(Float64) - Multiply by this

b : Array(Float64) - Add this

Optionals

uchar : Bool - Output should be uchar

Returns

Output image

Source
linecache

Cache an image as a set of lines

# out_ = in.linecache({tile_height: Int32, access: Enums::Access, threaded: Bool, persistent: Bool})

Input Parameters

Optionals

tile_height : Int32 - Tile height in pixels

access : Enums::Access - Expected access pattern

threaded : Bool - Allow threaded access

persistent : Bool - Keep cache between evaluations

Returns

Output image

Source
log

Return the natural log of an image

Source
log10

Return the log base 10 of an image

Source
magicksave(filename : String, **kwargs)

Save file with imagemagick

in.magicksave(filename, {format: String, quality: Int32, optimize_gif_frames: Bool, optimize_gif_transparency: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

format : String - Format to save in

quality : Int32 - Quality to use

optimize_gif_frames : Bool - Apply GIF frames optimization

optimize_gif_transparency : Bool - Apply GIF transparency optimization

bitdepth : Int32 - Number of bits per pixel

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
magicksave_bmp(filename : String, **kwargs)

Save bmp image with imagemagick

in.magicksave_bmp(filename, {format: String, quality: Int32, optimize_gif_frames: Bool, optimize_gif_transparency: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

format : String - Format to save in

quality : Int32 - Quality to use

optimize_gif_frames : Bool - Apply GIF frames optimization

optimize_gif_transparency : Bool - Apply GIF transparency optimization

bitdepth : Int32 - Number of bits per pixel

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
magicksave_bmp_buffer

Save bmp image to magick buffer

# buffer = in.magicksave_bmp_buffer({format: String, quality: Int32, optimize_gif_frames: Bool, optimize_gif_transparency: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

format : String - Format to save in

quality : Int32 - Quality to use

optimize_gif_frames : Bool - Apply GIF frames optimization

optimize_gif_transparency : Bool - Apply GIF transparency optimization

bitdepth : Int32 - Number of bits per pixel

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
magicksave_buffer

Save image to magick buffer

# buffer = in.magicksave_buffer({format: String, quality: Int32, optimize_gif_frames: Bool, optimize_gif_transparency: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

format : String - Format to save in

quality : Int32 - Quality to use

optimize_gif_frames : Bool - Apply GIF frames optimization

optimize_gif_transparency : Bool - Apply GIF transparency optimization

bitdepth : Int32 - Number of bits per pixel

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
mapim(index : Image, **kwargs)

Resample with a map image

# out_ = in.mapim(index, {interpolate: Interpolate, background: Array(Float64), premultiplied: Bool, extend: Enums::Extend})

Input Parameters

Required

index : Image - Index pixels with this

Optionals

interpolate : Interpolate - Interpolate pixels with this

background : Array(Float64) - Background value

premultiplied : Bool - Images have premultiplied alpha

extend : Enums::Extend - How to generate the extra pixels

Returns

Output image

Source
maplut(lut : Image, **kwargs)

Map an image though a lut

# out_ = in.maplut(lut, {band: Int32})

Input Parameters

Required

lut : Image - Look-up table image

Optionals

band : Int32 - Apply one-band lut to this band of in

Returns

Output image

Source
match(sec : Image, xr1 : Int32, yr1 : Int32, xs1 : Int32, ys1 : Int32, xr2 : Int32, yr2 : Int32, xs2 : Int32, ys2 : Int32, **kwargs)

First-order match of two images

# out_ = ref.match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, {hwindow: Int32, harea: Int32, search: Bool, interpolate: Interpolate})

Input Parameters

Required

sec : Image - Secondary image

xr1 : Int32 - Position of first reference tie-point

yr1 : Int32 - Position of first reference tie-point

xs1 : Int32 - Position of first secondary tie-point

ys1 : Int32 - Position of first secondary tie-point

xr2 : Int32 - Position of second reference tie-point

yr2 : Int32 - Position of second reference tie-point

xs2 : Int32 - Position of second secondary tie-point

ys2 : Int32 - Position of second secondary tie-point

Optionals

hwindow : Int32 - Half window size

harea : Int32 - Half area size

search : Bool - Search to improve tie-points

interpolate : Interpolate - Interpolate pixels with this

Returns

Output image

Source
math(math : Enums::OperationMath)

Apply a math operation to an image

# out_ = in.math(math)

Input Parameters

Required

math : Enums::OperationMath - Math to perform

Returns

Output image

Source
math2(right : Image, math2 : Enums::OperationMath2)

Binary math operations

# out_ = left.math2(right, math2)

Input Parameters

Required

right : Image - Right-hand image argument

math2 : Enums::OperationMath2 - Math to perform

Returns

Output image

Source
math2_const(math2 : Enums::OperationMath2, c : Array(Float64))

Binary math operations with a constant

# out_ = in.math2_const(math2, c)

Input Parameters

Required

math2 : Enums::OperationMath2 - Math to perform

c : Array(Float64) - Array of constants

Returns

Output image

Source
matrixinvert

Invert an matrix

# out_ = in.matrixinvert()

Returns

Output matrix

Source
matrixprint

Print matrix

in.matrixprint({strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
matrixsave(filename : String, **kwargs)

Save image to matrix

in.matrixsave(filename, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
matrixsave_stream(stream : IO, **kwargs)

Save image to matrix

in.matrixsave_stream(stream, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
matrixsave_target(target : Target, **kwargs)

Save image to matrix

in.matrixsave_target(target, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
max

Find image maximum

# out_, x, y, out_array, x_array, y_array = in.max({size: Int32})

Input Parameters

Optionals

size : Int32 - Number of maximum values to find

Returns

Output value

Optionals

x : Int32? - Horizontal position of maximum

y : Int32? - Vertical position of maximum

out_array : Array(Float64)? - Array of output values

x_array : Array(Int32)? - Array of horizontal positions

y_array : Array(Int32)? - Array of vertical positions

Source
maxpos

Return the coordinates of the image maximum.

Source
measure(h : Int32, v : Int32, **kwargs)

Measure a set of patches on a color chart

# out_ = in.measure(h, v, {left: Int32, top: Int32, width: Int32, height: Int32})

Input Parameters

Required

h : Int32 - Number of patches across chart

v : Int32 - Number of patches down chart

Optionals

left : Int32 - Left edge of extract area

top : Int32 - Top edge of extract area

width : Int32 - Width of extract area

height : Int32 - Height of extract area

Returns

Output array of statistics

Source
median(size = 3)

size x size median filter.

Source
merge(sec : Image, direction : Enums::Direction, dx : Int32, dy : Int32, **kwargs)

Merge two images

# out_ = ref.merge(sec, direction, dx, dy, {mblend: Int32})

Input Parameters

Required

sec : Image - Secondary image

direction : Enums::Direction - Horizontal or vertical merge

dx : Int32 - Horizontal displacement from sec to ref

dy : Int32 - Vertical displacement from sec to ref

Optionals

mblend : Int32 - Maximum blend size

Returns

Output image

Source
min

Find image minimum

# out_, x, y, out_array, x_array, y_array = in.min({size: Int32})

Input Parameters

Optionals

size : Int32 - Number of minimum values to find

Returns

Output value

Optionals

x : Int32? - Horizontal position of minimum

y : Int32? - Vertical position of minimum

out_array : Array(Float64)? - Array of output values

x_array : Array(Int32)? - Array of horizontal positions

y_array : Array(Int32)? - Array of vertical positions

Source
minpos

Return the coordinates of the image minimum.

Source
morph(mask : Image, morph : Enums::OperationMorphology)

Morphology operation

# out_ = in.morph(mask, morph)

Input Parameters

Required

mask : Image - Input matrix image

morph : Enums::OperationMorphology - Morphological operation to perform

Returns

Output image

Source
mosaic(sec : Image, direction : Enums::Direction, xref : Int32, yref : Int32, xsec : Int32, ysec : Int32, **kwargs)

Mosaic two images

# out_, dx0, dy0, scale1, angle1, dy1, dx1 = ref.mosaic(sec, direction, xref, yref, xsec, ysec, {hwindow: Int32, harea: Int32, mblend: Int32, bandno: Int32})

Input Parameters

Required

sec : Image - Secondary image

direction : Enums::Direction - Horizontal or vertical mosaic

xref : Int32 - Position of reference tie-point

yref : Int32 - Position of reference tie-point

xsec : Int32 - Position of secondary tie-point

ysec : Int32 - Position of secondary tie-point

Optionals

hwindow : Int32 - Half window size

harea : Int32 - Half area size

mblend : Int32 - Maximum blend size

bandno : Int32 - Band to search for features on

Returns

Output image

Optionals

dx0 : Int32? - Detected integer offset

dy0 : Int32? - Detected integer offset

scale1 : Float64? - Detected scale

angle1 : Float64? - Detected rotation

dy1 : Float64? - Detected first-order displacement

dx1 : Float64? - Detected first-order displacement

Source
mosaic1(sec : Image, direction : Enums::Direction, xr1 : Int32, yr1 : Int32, xs1 : Int32, ys1 : Int32, xr2 : Int32, yr2 : Int32, xs2 : Int32, ys2 : Int32, **kwargs)

First-order mosaic of two images

# out_ = ref.mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, {hwindow: Int32, harea: Int32, search: Bool, interpolate: Interpolate, mblend: Int32})

Input Parameters

Required

sec : Image - Secondary image

direction : Enums::Direction - Horizontal or vertical mosaic

xr1 : Int32 - Position of first reference tie-point

yr1 : Int32 - Position of first reference tie-point

xs1 : Int32 - Position of first secondary tie-point

ys1 : Int32 - Position of first secondary tie-point

xr2 : Int32 - Position of second reference tie-point

yr2 : Int32 - Position of second reference tie-point

xs2 : Int32 - Position of second secondary tie-point

ys2 : Int32 - Position of second secondary tie-point

Optionals

hwindow : Int32 - Half window size

harea : Int32 - Half area size

search : Bool - Search to improve tie-points

interpolate : Interpolate - Interpolate pixels with this

mblend : Int32 - Maximum blend size

Returns

Output image

Source
msb

Pick most-significant byte from an image

# out_ = in.msb({band: Int32})

Input Parameters

Optionals

band : Int32 - Band to msb

Returns

Output image

Source
multiply(right : Image)

Multiply two images

# out_ = left.multiply(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image

Source
mutate

Mutate an image with a block. Inside the block, you can call methods which modify the image, such as setting or removing metadata, or modifying pixels.

For example:

image = image.mutate do |x|
  (0..1).step 0.01 do |i|
    x.draw_line([255.0], (x.width * i).to_i, 0, 0, (x.height * (1 - i)).to_i)
  end
end

See MutableImage.

Source
new_from_image(value)

A new image is created with the same width, height, format, interpretation, resolution and offset as self, but with every pixel set to the specified value.

You can pass an array to make a many-band image, or a single value to make a one-band image.

Source
new_from_image(*value : Int32 | Float64)

A new image is created with the same width, height, format, interpretation, resolution and offset as self, but with every pixel set to the specified value.

You can pass an array to make a many-band image, or a single value to make a one-band image.

Source
offset
Source
page_height

Multi-page images can have a page height. If page-height is not set, it defaults to the image height. Note: At least libvips 8.8 is needed.

Source
pbmsave_stream(stream : IO, **kwargs)

Save image in pbm format

in.pbmsave_stream(stream, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pbmsave_target(target : Target, **kwargs)

Save image in pbm format

in.pbmsave_target(target, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
percent(percent : Float64)

Find threshold for percent of pixels

# threshold = in.percent(percent)

Input Parameters

Required

percent : Float64 - Percent of pixels

Returns

Threshold above which lie percent of pixels

Source
pfmsave_stream(stream : IO, **kwargs)

Save image in pfm format

in.pfmsave_stream(stream, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pfmsave_target(target : Target, **kwargs)

Save image in pfm format

in.pfmsave_target(target, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pgmsave_stream(stream : IO, **kwargs)

Save image in pgm format

in.pgmsave_stream(stream, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pgmsave_target(target : Target, **kwargs)

Save image in pgm format

in.pgmsave_target(target, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
phasecor(in2 : Image)

Calculate phase correlation

# out_ = in.phasecor(in2)

Input Parameters

Required

in2 : Image - Second input image

Returns

Output image

Source
pngsave(filename : String, **kwargs)

Save image to file as png

in.pngsave(filename, {compression: Int32, interlace: Bool, profile: String, filter: Enums::ForeignPngFilter, palette: Bool, q: Int32, dither: Float64, bitdepth: Int32, effort: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

compression : Int32 - Compression factor

interlace : Bool - Interlace image

profile : String - ICC profile to embed

filter : Enums::ForeignPngFilter - libspng row filter flag(s)

palette : Bool - Quantise to 8bpp palette

q : Int32 - Quantisation quality

dither : Float64 - Amount of dithering

bitdepth : Int32 - Write as a 1, 2, 4, 8 or 16 bit image

effort : Int32 - Quantisation CPU effort

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pngsave_buffer

Save image to buffer as png

# buffer = in.pngsave_buffer({compression: Int32, interlace: Bool, profile: String, filter: Enums::ForeignPngFilter, palette: Bool, q: Int32, dither: Float64, bitdepth: Int32, effort: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

compression : Int32 - Compression factor

interlace : Bool - Interlace image

profile : String - ICC profile to embed

filter : Enums::ForeignPngFilter - libspng row filter flag(s)

palette : Bool - Quantise to 8bpp palette

q : Int32 - Quantisation quality

dither : Float64 - Amount of dithering

bitdepth : Int32 - Write as a 1, 2, 4, 8 or 16 bit image

effort : Int32 - Quantisation CPU effort

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
pngsave_stream(stream : IO, **kwargs)

Save image to stream as png

in.pngsave_stream(stream, {compression: Int32, interlace: Bool, profile: String, filter: Enums::ForeignPngFilter, palette: Bool, q: Int32, dither: Float64, bitdepth: Int32, effort: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

compression : Int32 - Compression factor

interlace : Bool - Interlace image

profile : String - ICC profile to embed

filter : Enums::ForeignPngFilter - libspng row filter flag(s)

palette : Bool - Quantise to 8bpp palette

q : Int32 - Quantisation quality

dither : Float64 - Amount of dithering

bitdepth : Int32 - Write as a 1, 2, 4, 8 or 16 bit image

effort : Int32 - Quantisation CPU effort

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pngsave_target(target : Target, **kwargs)

Save image to target as png

in.pngsave_target(target, {compression: Int32, interlace: Bool, profile: String, filter: Enums::ForeignPngFilter, palette: Bool, q: Int32, dither: Float64, bitdepth: Int32, effort: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

compression : Int32 - Compression factor

interlace : Bool - Interlace image

profile : String - ICC profile to embed

filter : Enums::ForeignPngFilter - libspng row filter flag(s)

palette : Bool - Quantise to 8bpp palette

q : Int32 - Quantisation quality

dither : Float64 - Amount of dithering

bitdepth : Int32 - Write as a 1, 2, 4, 8 or 16 bit image

effort : Int32 - Quantisation CPU effort

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pnmsave_stream(stream : IO, **kwargs)

Save image in pnm format

in.pnmsave_stream(stream, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
pnmsave_target(target : Target, **kwargs)

Save image in pnm format

in.pnmsave_target(target, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
polar

Return an image converted to polar coordinates.

Source
ppmsave(filename : String, **kwargs)

Save image to ppm file

in.ppmsave(filename, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
ppmsave_stream(stream : IO, **kwargs)

Save to ppm

in.ppmsave_stream(stream, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
ppmsave_target(target : Target, **kwargs)

Save to ppm

in.ppmsave_target(target, {format: Enums::ForeignPpmFormat, ascii: Bool, bitdepth: Int32, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

format : Enums::ForeignPpmFormat - Format to save in

ascii : Bool - Save as ascii

bitdepth : Int32 - Set to 1 to write as a 1 bit image

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
premultiply

Premultiply image alpha

# out_ = in.premultiply({max_alpha: Float64})

Input Parameters

Optionals

max_alpha : Float64 - Maximum value of alpha channel

Returns

Output image

Source
profile

Find image profiles

# output   = in.profile()

Returns

First non-zero pixel in column

First non-zero pixel in row

Source
project

Find image projections

# output   = in.project()

Returns

Sums of columns

Sums of rows

Source
quadratic(coeff : Image, **kwargs)

Resample an image with a quadratic transform

# out_ = in.quadratic(coeff, {interpolate: Interpolate})

Input Parameters

Required

coeff : Image - Coefficient matrix

Optionals

interpolate : Interpolate - Interpolate values with this

Returns

Output image

Source
rad2float

Unpack radiance coding to float rgb

# out_ = in.rad2float()

Returns

Output image

Source
radsave(filename : String, **kwargs)

Save image to radiance file

in.radsave(filename, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
radsave_buffer

Save image to radiance buffer

# buffer = in.radsave_buffer({strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
radsave_stream(stream : IO, **kwargs)

Save image to radiance stream

in.radsave_stream(stream, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
radsave_target(target : Target, **kwargs)

Save image to radiance target

in.radsave_target(target, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
rank(width : Int32, height : Int32, index : Int32)

Rank filter

# out_ = in.rank(width, height, index)

Input Parameters

Required

width : Int32 - Window width in pixels

height : Int32 - Window height in pixels

index : Int32 - Select pixel at index

Returns

Output image

Source
rawsave(filename : String, **kwargs)

Save image to raw file

in.rawsave(filename, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
rawsave_fd(fd : Int32, **kwargs)

Write raw image to file descriptor

in.rawsave_fd(fd, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

fd : Int32 - File descriptor to write to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
real

Return the real part of a complex image.

Source
recomb(m : Image)

Linear recombination with matrix

# out_ = in.recomb(m)

Input Parameters

Required

m : Image - Matrix of coefficients

Returns

Output image

Source
rect

Return an image converted to rectangular coordinates.

Source
reduce(hshrink : Float64, vshrink : Float64, **kwargs)

Reduce an image

# out_ = in.reduce(hshrink, vshrink, {kernel: Enums::Kernel, gap: Float64})

Input Parameters

Required

hshrink : Float64 - Horizontal shrink factor

vshrink : Float64 - Vertical shrink factor

Optionals

kernel : Enums::Kernel - Resampling kernel

gap : Float64 - Reducing gap

Returns

Output image

Source
reduceh(hshrink : Float64, **kwargs)

Shrink an image horizontally

# out_ = in.reduceh(hshrink, {kernel: Enums::Kernel, gap: Float64})

Input Parameters

Required

hshrink : Float64 - Horizontal shrink factor

Optionals

kernel : Enums::Kernel - Resampling kernel

gap : Float64 - Reducing gap

Returns

Output image

Source
reducev(vshrink : Float64, **kwargs)

Shrink an image vertically

# out_ = in.reducev(vshrink, {kernel: Enums::Kernel, gap: Float64})

Input Parameters

Required

vshrink : Float64 - Vertical shrink factor

Optionals

kernel : Enums::Kernel - Resampling kernel

gap : Float64 - Reducing gap

Returns

Output image

Source
relational(right : Image, relational : Enums::OperationRelational)

Relational operation on two images

# out_ = left.relational(right, relational)

Input Parameters

Required

right : Image - Right-hand image argument

relational : Enums::OperationRelational - Relational to perform

Returns

Output image

Source
relational_const(relational : Enums::OperationRelational, c : Array(Float64))

Relational operations against a constant

# out_ = in.relational_const(relational, c)

Input Parameters

Required

relational : Enums::OperationRelational - Relational to perform

c : Array(Float64) - Array of constants

Returns

Output image

Source
remainder(right : Image)

Remainder after integer division of two images

# out_ = left.remainder(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image

Source
remainder_const(c : Array(Float64))

Remainder after integer division of an image and a constant

# out_ = in.remainder_const(c)

Input Parameters

Required

c : Array(Float64) - Array of constants

Returns

Output image

Source
replicate(across : Int32, down : Int32)

Replicate an image

# out_ = in.replicate(across, down)

Input Parameters

Required

across : Int32 - Repeat this many times horizontally

down : Int32 - Repeat this many times vertically

Returns

Output image

Source
resize(scale : Float64, **kwargs)

Resize an image

# out_ = in.resize(scale, {kernel: Enums::Kernel, gap: Float64, vscale: Float64})

Input Parameters

Required

scale : Float64 - Scale image by this factor

Optionals

kernel : Enums::Kernel - Resampling kernel

gap : Float64 - Reducing gap

vscale : Float64 - Vertical scale image by this factor

Returns

Output image

Source
rint

Return the nearest integral value.

Source
rot(angle : Enums::Angle)

Rotate an image

# out_ = in.rot(angle)

Input Parameters

Required

angle : Enums::Angle - Angle to rotate image

Returns

Output image

Source
rot180

Rotate 180 degrees clockwise.

Source
rot270

Rotate 270 degrees clockwise.

Source
rot45

Rotate an image

# out_ = in.rot45({angle: Enums::Angle45})

Input Parameters

Optionals

angle : Enums::Angle45 - Angle to rotate image

Returns

Output image

Source
rot90

Rotate 90 degrees clockwise.

Source
rotate(angle : Float64, **kwargs)

Rotate an image by a number of degrees

# out_ = in.rotate(angle, {interpolate: Interpolate, background: Array(Float64), odx: Float64, ody: Float64, idx: Float64, idy: Float64})

Input Parameters

Required

angle : Float64 - Rotate anticlockwise by this many degrees

Optionals

interpolate : Interpolate - Interpolate pixels with this

background : Array(Float64) - Background value

odx : Float64 - Horizontal output displacement

ody : Float64 - Vertical output displacement

idx : Float64 - Horizontal input displacement

idy : Float64 - Vertical input displacement

Returns

Output image

Source
round(round : Enums::OperationRound)

Perform a round function on an image

# out_ = in.round(round)

Input Parameters

Required

round : Enums::OperationRound - Rounding operation to perform

Returns

Output image

Source
scale
Source
scaleimage

Scale an image to 0 - 255. This is the libvips scale operation, but renamed to avoid a clash with the scale for convolution masks.

Source
scrgb2bw

Convert scrgb to bw

# out_ = in.scrgb2bw({depth: Int32})

Input Parameters

Optionals

depth : Int32 - Output device space depth in bits

Returns

Output image

Source
scrgb2srgb

Convert an scrgb image to srgb

# out_ = in.scrgb2srgb({depth: Int32})

Input Parameters

Optionals

depth : Int32 - Output device space depth in bits

Returns

Output image

Source
scrgb2xyz

Transform scrgb to xyz

# out_ = in.scrgb2xyz()

Returns

Output image

Source
sequential

Check sequential access

# out_ = in.sequential({tile_height: Int32})

Input Parameters

Optionals

tile_height : Int32 - Tile height in pixels

Returns

Output image

Source
set_kill(kill : Bool)

Set the kill flag on an image. Handy for stopping sets of threads. At least libvips 8.8 is needed.

Source
set_progress(enable : Bool)

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 Enums::Signal::PreEval, Enums::Signal::Eval and Enums::Signal::PostEval signals.

Source
set_progress

Enable progress reporting on an image and provide a block which will be executed on feedback. You can use this function to update user-interfaces with progress feedback, for example

image = Vips::Image.new_from_file("huge.jpg", access: Enums::Access.Sequential)
image.set_progress { |percent| puts "#{percent} complete" }
image.dzsave("image-pyramid")
Source
sharpen

Unsharp masking for print

# out_ = in.sharpen({sigma: Float64, x1: Float64, y2: Float64, y3: Float64, m1: Float64, m2: Float64})

Input Parameters

Optionals

sigma : Float64 - Sigma of Gaussian

x1 : Float64 - Flat/jaggy threshold

y2 : Float64 - Maximum brightening

y3 : Float64 - Maximum darkening

m1 : Float64 - Slope for flat areas

m2 : Float64 - Slope for jaggy areas

Returns

Output image

Source
shrink(hshrink : Float64, vshrink : Float64, **kwargs)

Shrink an image

# out_ = in.shrink(hshrink, vshrink, {ceil: Bool})

Input Parameters

Required

hshrink : Float64 - Horizontal shrink factor

vshrink : Float64 - Vertical shrink factor

Optionals

ceil : Bool - Round-up output dimensions

Returns

Output image

Source
shrinkh(hshrink : Int32, **kwargs)

Shrink an image horizontally

# out_ = in.shrinkh(hshrink, {ceil: Bool})

Input Parameters

Required

hshrink : Int32 - Horizontal shrink factor

Optionals

ceil : Bool - Round-up output dimensions

Returns

Output image

Source
shrinkv(vshrink : Int32, **kwargs)

Shrink an image vertically

# out_ = in.shrinkv(vshrink, {ceil: Bool})

Input Parameters

Required

vshrink : Int32 - Vertical shrink factor

Optionals

ceil : Bool - Round-up output dimensions

Returns

Output image

Source
sign

Unit vector of pixel

# out_ = in.sign()

Returns

Output image

Source
signal_connect(signal : Enums::Signal, data : Pointer(Void) = Pointer(Void).null, &callback : EvalProc)

Connects a EvalProc callback to a signal on this image. The callback will be triggered every time this signal is issued on this image.

Source
similarity

Similarity transform of an image

# out_ = in.similarity({scale: Float64, angle: Float64, interpolate: Interpolate, background: Array(Float64), odx: Float64, ody: Float64, idx: Float64, idy: Float64})

Input Parameters

Optionals

scale : Float64 - Scale by this factor

angle : Float64 - Rotate anticlockwise by this many degrees

interpolate : Interpolate - Interpolate pixels with this

background : Array(Float64) - Background value

odx : Float64 - Horizontal output displacement

ody : Float64 - Vertical output displacement

idx : Float64 - Horizontal input displacement

idy : Float64 - Vertical input displacement

Returns

Output image

Source
sin

Return the sine of an image in degrees.

Source
sinh

Return the hyperbolic sine of an image in degrees.

Source
size

Get the image size

Source
smartcrop(width : Int32, height : Int32, **kwargs)

Extract an area from an image

# out_, attention_x, attention_y = input.smartcrop(width, height, {interesting: Enums::Interesting})

Input Parameters

Required

width : Int32 - Width of extract area

height : Int32 - Height of extract area

Optionals

interesting : Enums::Interesting - How to measure interestingness

Returns

Output image

Optionals

attention_x : Int32? - Horizontal position of attention centre

attention_y : Int32? - Vertical position of attention centre

Source
sobel

Sobel edge detector

# out_ = in.sobel()

Returns

Output image

Source
spcor(ref : Image)

Spatial correlation

# out_ = in.spcor(ref)

Input Parameters

Required

ref : Image - Input reference image

Returns

Output image

Source
spectrum

Make displayable power spectrum

# out_ = in.spectrum()

Returns

Output image

Source
srgb2hsv

Transform srgb to hsv

# out_ = in.srgb2hsv()

Returns

Output image

Source
srgb2scrgb

Convert an srgb image to scrgb

# out_ = in.srgb2scrgb()

Returns

Output image

Source
stats

Find many image stats

# out_ = in.stats()

Returns

Output array of statistics

Source
stdif(width : Int32, height : Int32, **kwargs)

Statistical difference

# out_ = in.stdif(width, height, {s0: Float64, b: Float64, m0: Float64, a: Float64})

Input Parameters

Required

width : Int32 - Window width in pixels

height : Int32 - Window height in pixels

Optionals

s0 : Float64 - New deviation

b : Float64 - Weight of new deviation

m0 : Float64 - New mean

a : Float64 - Weight of new mean

Returns

Output image

Source
subsample(xfac : Int32, yfac : Int32, **kwargs)

Subsample an image

# out_ = input.subsample(xfac, yfac, {point: Bool})

Input Parameters

Required

xfac : Int32 - Horizontal subsample factor

yfac : Int32 - Vertical subsample factor

Optionals

point : Bool - Point sample

Returns

Output image

Source
subtract(right : Image)

Subtract two images

# out_ = left.subtract(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image

Source
tan

Return the tangent of an image in degrees.

Source
tanh

Return the hyperbolic tangent of an image in degrees.

Source
thumbnail_image(width : Int32, **kwargs)

Generate thumbnail from image

# out_ = in.thumbnail_image(width, {height: Int32, size: Enums::Size, no_rotate: Bool, crop: Enums::Interesting, linear: Bool, import_profile: String, export_profile: String, intent: Enums::Intent, fail_on: Enums::FailOn})

Input Parameters

Required

width : Int32 - Size to this width

Optionals

height : Int32 - Size to this height

size : Enums::Size - Only upsize, only downsize, or both

no_rotate : Bool - Don't use orientation tags to rotate image upright

crop : Enums::Interesting - Reduce to fill target rectangle, then crop

linear : Bool - Reduce in linear light

import_profile : String - Fallback import profile

export_profile : String - Fallback export profile

intent : Enums::Intent - Rendering intent

fail_on : Enums::FailOn - Error level to fail on

Returns

Output image

Source
tiffsave(filename : String, **kwargs)

Save image to tiff file

in.tiffsave(filename, {compression: Enums::ForeignTiffCompression, q: Int32, predictor: Enums::ForeignTiffPredictor, profile: String, tile: Bool, tile_width: Int32, tile_height: Int32, pyramid: Bool, miniswhite: Bool, bitdepth: Int32, resunit: Enums::ForeignTiffResunit, xres: Float64, yres: Float64, bigtiff: Bool, properties: Bool, region_shrink: Enums::RegionShrink, level: Int32, lossless: Bool, depth: Enums::ForeignDzDepth, subifd: Bool, premultiply: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

compression : Enums::ForeignTiffCompression - Compression for this file

q : Int32 - Q factor

predictor : Enums::ForeignTiffPredictor - Compression prediction

profile : String - ICC profile to embed

tile : Bool - Write a tiled tiff

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

pyramid : Bool - Write a pyramidal tiff

miniswhite : Bool - Use 0 for white in 1-bit images

bitdepth : Int32 - Write as a 1, 2, 4 or 8 bit image

resunit : Enums::ForeignTiffResunit - Resolution unit

xres : Float64 - Horizontal resolution in pixels/mm

yres : Float64 - Vertical resolution in pixels/mm

bigtiff : Bool - Write a bigtiff image

properties : Bool - Write a properties document to IMAGEDESCRIPTION

region_shrink : Enums::RegionShrink - Method to shrink regions

level : Int32 - ZSTD compression level

lossless : Bool - Enable WEBP lossless mode

depth : Enums::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 : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
tiffsave_buffer

Save image to tiff buffer

# buffer = in.tiffsave_buffer({compression: Enums::ForeignTiffCompression, q: Int32, predictor: Enums::ForeignTiffPredictor, profile: String, tile: Bool, tile_width: Int32, tile_height: Int32, pyramid: Bool, miniswhite: Bool, bitdepth: Int32, resunit: Enums::ForeignTiffResunit, xres: Float64, yres: Float64, bigtiff: Bool, properties: Bool, region_shrink: Enums::RegionShrink, level: Int32, lossless: Bool, depth: Enums::ForeignDzDepth, subifd: Bool, premultiply: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

compression : Enums::ForeignTiffCompression - Compression for this file

q : Int32 - Q factor

predictor : Enums::ForeignTiffPredictor - Compression prediction

profile : String - ICC profile to embed

tile : Bool - Write a tiled tiff

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

pyramid : Bool - Write a pyramidal tiff

miniswhite : Bool - Use 0 for white in 1-bit images

bitdepth : Int32 - Write as a 1, 2, 4 or 8 bit image

resunit : Enums::ForeignTiffResunit - Resolution unit

xres : Float64 - Horizontal resolution in pixels/mm

yres : Float64 - Vertical resolution in pixels/mm

bigtiff : Bool - Write a bigtiff image

properties : Bool - Write a properties document to IMAGEDESCRIPTION

region_shrink : Enums::RegionShrink - Method to shrink regions

level : Int32 - ZSTD compression level

lossless : Bool - Enable WEBP lossless mode

depth : Enums::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 : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
tiffsave_stream(stream : IO, **kwargs)

Save image to tiff stream

in.tiffsave_stream(stream, {compression: Enums::ForeignTiffCompression, q: Int32, predictor: Enums::ForeignTiffPredictor, profile: String, tile: Bool, tile_width: Int32, tile_height: Int32, pyramid: Bool, miniswhite: Bool, bitdepth: Int32, resunit: Enums::ForeignTiffResunit, xres: Float64, yres: Float64, bigtiff: Bool, properties: Bool, region_shrink: Enums::RegionShrink, level: Int32, lossless: Bool, depth: Enums::ForeignDzDepth, subifd: Bool, premultiply: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

compression : Enums::ForeignTiffCompression - Compression for this file

q : Int32 - Q factor

predictor : Enums::ForeignTiffPredictor - Compression prediction

profile : String - ICC profile to embed

tile : Bool - Write a tiled tiff

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

pyramid : Bool - Write a pyramidal tiff

miniswhite : Bool - Use 0 for white in 1-bit images

bitdepth : Int32 - Write as a 1, 2, 4 or 8 bit image

resunit : Enums::ForeignTiffResunit - Resolution unit

xres : Float64 - Horizontal resolution in pixels/mm

yres : Float64 - Vertical resolution in pixels/mm

bigtiff : Bool - Write a bigtiff image

properties : Bool - Write a properties document to IMAGEDESCRIPTION

region_shrink : Enums::RegionShrink - Method to shrink regions

level : Int32 - ZSTD compression level

lossless : Bool - Enable WEBP lossless mode

depth : Enums::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 : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
tiffsave_target(target : Target, **kwargs)

Save image to tiff target

in.tiffsave_target(target, {compression: Enums::ForeignTiffCompression, q: Int32, predictor: Enums::ForeignTiffPredictor, profile: String, tile: Bool, tile_width: Int32, tile_height: Int32, pyramid: Bool, miniswhite: Bool, bitdepth: Int32, resunit: Enums::ForeignTiffResunit, xres: Float64, yres: Float64, bigtiff: Bool, properties: Bool, region_shrink: Enums::RegionShrink, level: Int32, lossless: Bool, depth: Enums::ForeignDzDepth, subifd: Bool, premultiply: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

compression : Enums::ForeignTiffCompression - Compression for this file

q : Int32 - Q factor

predictor : Enums::ForeignTiffPredictor - Compression prediction

profile : String - ICC profile to embed

tile : Bool - Write a tiled tiff

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

pyramid : Bool - Write a pyramidal tiff

miniswhite : Bool - Use 0 for white in 1-bit images

bitdepth : Int32 - Write as a 1, 2, 4 or 8 bit image

resunit : Enums::ForeignTiffResunit - Resolution unit

xres : Float64 - Horizontal resolution in pixels/mm

yres : Float64 - Vertical resolution in pixels/mm

bigtiff : Bool - Write a bigtiff image

properties : Bool - Write a properties document to IMAGEDESCRIPTION

region_shrink : Enums::RegionShrink - Method to shrink regions

level : Int32 - ZSTD compression level

lossless : Bool - Enable WEBP lossless mode

depth : Enums::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 : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
tilecache

Cache an image as a set of tiles

# out_ = in.tilecache({tile_width: Int32, tile_height: Int32, max_tiles: Int32, access: Enums::Access, threaded: Bool, persistent: Bool})

Input Parameters

Optionals

tile_width : Int32 - Tile width in pixels

tile_height : Int32 - Tile height in pixels

max_tiles : Int32 - Maximum number of tiles to cache

access : Enums::Access - Expected access pattern

threaded : Bool - Allow threaded access

persistent : Bool - Keep cache between evaluations

Returns

Output image

Source
to_s(io : IO)

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
transpose3d

Transpose3d an image

# out_ = in.transpose3d({page_height: Int32})

Input Parameters

Optionals

page_height : Int32 - Height of each input page

Returns

Output image

Source
unpremultiply

Unpremultiply image alpha

# out_ = in.unpremultiply({max_alpha: Float64, alpha_band: Int32})

Input Parameters

Optionals

max_alpha : Float64 - Maximum value of alpha channel

alpha_band : Int32 - Unpremultiply with this alpha

Returns

Output image

Source
vipssave(filename : String, **kwargs)

Save image to file in vips format

in.vipssave(filename, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
vipssave_stream(stream : IO, **kwargs)

Save image to stream in vips format

in.vipssave_stream(stream, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
vipssave_target(target : Target, **kwargs)

Save image to target in vips format

in.vipssave_target(target, {strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
webpsave(filename : String, **kwargs)

Save as webp

in.webpsave(filename, {q: Int32, lossless: Bool, preset: Enums::ForeignWebpPreset, smart_subsample: Bool, near_lossless: Bool, alpha_q: Int32, min_size: Bool, kmin: Int32, kmax: Int32, effort: Int32, profile: String, mixed: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

filename : String - Filename to save to

Optionals

q : Int32 - Q factor

lossless : Bool - Enable lossless compression

preset : Enums::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 : Int32 - Change alpha plane fidelity for lossy compression

min_size : Bool - Optimise for minimum size

kmin : Int32 - Minimum number of frames between key frames

kmax : Int32 - Maximum number of frames between key frames

effort : Int32 - Level of CPU effort to reduce file size

profile : String - ICC profile to embed

mixed : Bool - Allow mixed encoding (might reduce file size)

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
webpsave_buffer

Save as webp

# buffer = in.webpsave_buffer({q: Int32, lossless: Bool, preset: Enums::ForeignWebpPreset, smart_subsample: Bool, near_lossless: Bool, alpha_q: Int32, min_size: Bool, kmin: Int32, kmax: Int32, effort: Int32, profile: String, mixed: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

q : Int32 - Q factor

lossless : Bool - Enable lossless compression

preset : Enums::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 : Int32 - Change alpha plane fidelity for lossy compression

min_size : Bool - Optimise for minimum size

kmin : Int32 - Minimum number of frames between key frames

kmax : Int32 - Maximum number of frames between key frames

effort : Int32 - Level of CPU effort to reduce file size

profile : String - ICC profile to embed

mixed : Bool - Allow mixed encoding (might reduce file size)

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Returns

Buffer to save to

Source
webpsave_mime

Save image to webp mime

in.webpsave_mime({q: Int32, lossless: Bool, preset: Enums::ForeignWebpPreset, smart_subsample: Bool, near_lossless: Bool, alpha_q: Int32, min_size: Bool, kmin: Int32, kmax: Int32, effort: Int32, profile: String, mixed: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Optionals

q : Int32 - Q factor

lossless : Bool - Enable lossless compression

preset : Enums::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 : Int32 - Change alpha plane fidelity for lossy compression

min_size : Bool - Optimise for minimum size

kmin : Int32 - Minimum number of frames between key frames

kmax : Int32 - Maximum number of frames between key frames

effort : Int32 - Level of CPU effort to reduce file size

profile : String - ICC profile to embed

mixed : Bool - Allow mixed encoding (might reduce file size)

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
webpsave_stream(stream : IO, **kwargs)

Save as webp

in.webpsave_stream(stream, {q: Int32, lossless: Bool, preset: Enums::ForeignWebpPreset, smart_subsample: Bool, near_lossless: Bool, alpha_q: Int32, min_size: Bool, kmin: Int32, kmax: Int32, effort: Int32, profile: String, mixed: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

stream : IO - Stream to save to Optionals

q : Int32 - Q factor

lossless : Bool - Enable lossless compression

preset : Enums::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 : Int32 - Change alpha plane fidelity for lossy compression

min_size : Bool - Optimise for minimum size

kmin : Int32 - Minimum number of frames between key frames

kmax : Int32 - Maximum number of frames between key frames

effort : Int32 - Level of CPU effort to reduce file size

profile : String - ICC profile to embed

mixed : Bool - Allow mixed encoding (might reduce file size)

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
webpsave_target(target : Target, **kwargs)

Save as webp

in.webpsave_target(target, {q: Int32, lossless: Bool, preset: Enums::ForeignWebpPreset, smart_subsample: Bool, near_lossless: Bool, alpha_q: Int32, min_size: Bool, kmin: Int32, kmax: Int32, effort: Int32, profile: String, mixed: Bool, strip: Bool, background: Array(Float64), page_height: Int32})

Input Parameters

Required

target : Target - Target to save to

Optionals

q : Int32 - Q factor

lossless : Bool - Enable lossless compression

preset : Enums::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 : Int32 - Change alpha plane fidelity for lossy compression

min_size : Bool - Optimise for minimum size

kmin : Int32 - Minimum number of frames between key frames

kmax : Int32 - Maximum number of frames between key frames

effort : Int32 - Level of CPU effort to reduce file size

profile : String - ICC profile to embed

mixed : Bool - Allow mixed encoding (might reduce file size)

strip : Bool - Strip all metadata from image

background : Array(Float64) - Background value

page_height : Int32 - Set page height for multipage save

Source
width

Image width in pixels

Source
wrap

Wrap image origin

# out_ = in.wrap({x: Int32, y: Int32})

Input Parameters

Optionals

x : Int32 - Left edge of input in output

y : Int32 - Top edge of input in output

Returns

Output image

Source
write(other : Image)

Write an image to another image. This function writes self to another image. Use something like new_temp_file to make an image that can be written to.

Source
write_to_buffer(format : String, **kwargs)

Write this image to a memory buffer. This method can save images in any format supported by vips. Save options may be encoded in the filename or given as a keyword argument. For example:

image.write_to_file("fred.jpg[Q=95])"

or equivalently:

image.write_to_file("fred.jpg", Q: 95)

The full set of save options depend on the selected saver. Try something like:

$ vips jpegsave

to see all the available options for JPEG save.

Get the GType of a metadata field. The result is 0 if no such field exists.

Source
write_to_bytes

Write the image to a Bytes. 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 # => return Bytes of size 4 containing values 1,2,3,4

Returns Bytes

Source
write_to_file(name : String, **kwargs)

Write this image to a file. This method can save images in any format supported by vips. Save options may be encoded in the filename or given as a keyword argument. For example:

image.write_to_file("fred.jpg[Q=95])"

or equivalently:

image.write_to_file("fred.jpg", Q: 95)

The full set of save options depend on the selected saver. Try something like:

$ vips jpegsave

to see all the available options for JPEG save.

Get the GType of a metadata field. The result is 0 if no such field exists.

Source
write_to_memory

Write the image to memory as a simple, unformatted C-style array. Note: The caller is responsible for freeing this memory with Vips.free Returns {Void*, LibC::SizeT}

Source
write_to_target(stream : IO, format : String, **kwargs)

Write an image to a stream. This behaves exactly as write_to_file, but the image is written to a stream rather than a file. Note: At least libvips 8.9 is needed.

Source
write_to_target(target : Target, format : String, **kwargs)

Write an image to a target. This behaves exactly as write_to_file, but the image is written to a target rather than a file. Note: At least libvips 8.9 is needed.

Source
xoffset

Horizontal offset of origin

Source
xres

Horizontal resolution in pixels/mm

Source
xyz2cmyk

Transform xyz to cmyk

# out_ = in.xyz2cmyk()

Returns

Output image

Source
xyz2lab

Transform xyz to lab

# out_ = in.xyz2lab({temp: Array(Float64)})

Input Parameters

Optionals

temp : Array(Float64) - Colour temperature

Returns

Output image

Source
xyz2scrgb

Transform xyz to scrgb

# out_ = in.xyz2scrgb()

Returns

Output image

Source
xyz2yxy

Transform xyz to yxy

# out_ = in.xyz2yxy()

Returns

Output image

Source
yoffset

Vertical offset of origin

Source
yres

Vertical resolution in pixels/mm

Source
yxy2xyz

Transform yxy to xyz

# out_ = in.yxy2xyz()

Returns

Output image

Source
zoom(xfac : Int32, yfac : Int32)

Zoom an image

# out_ = input.zoom(xfac, yfac)

Input Parameters

Required

xfac : Int32 - Horizontal zoom factor

yfac : Int32 - Vertical zoom factor

Returns

Output image

Source

Nested types