class Vips::Image

Direct Known Subclasses

Defined in:

vips/ext/image.cr
vips/image.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Vips::VipsObject

get(name : String) get, get_blurb(name : String) get_blurb, get_description get_description, get_pspec(name : String) : LibVips::GParamSpec | Nil get_pspec, get_typeof(name : String) get_typeof, post_close(&block : -> ) post_close, print_all print_all, set(gtype, name, value)
set(options : String)
set

Instance methods inherited from class Vips::GObject

finalize finalize, get(name : String, gval : GValue) get, object_ref object_ref, ref_count ref_count, release_handle release_handle, set(name : String, gval : GValue) set, signal_connect(signal : String, callback : Proc, data : Pointer(Void) = Pointer(Void).null) : LibVips::Gulong signal_connect, signal_disconnect(handler_id : LibVips::Gulong)
signal_disconnect(func : Proc, data : Pointer(Void) = Pointer(Void).null)
signal_disconnect(data : LibVips::Gpointer)
signal_disconnect

Constructor Detail

def self.imageize(match_image : Image, value) : Image #

expand a constant into an image


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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.


[View source]
def self.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


[View source]
def self.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


[View source]

Class Method Detail

def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.identity(**kwargs) #

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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.profile_load(name : String) #

Load named icc profile

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

Input Parameters

Required

name : String - Profile name

Returns

Loaded profile


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.tonelut(**kwargs) #

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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]
def self.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


[View source]

Instance Method Detail

def !=(other) #
Description copied from class Object

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.


[View source]
def %(other) #

[View source]
def &(other) #

[View source]
def *(other) #

[View source]
def **(exp : Image) #

Raise to the power of an image


[View source]
def **(exp : Array(Number)) #

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


[View source]
def **(*exp : Number) #

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


[View source]
def +(other) #

[View source]
def -(other) #

[View source]
def /(other) #

[View source]
def <(other) #

[View source]
def <<(other) #

[View source]
def <=(other) #

[View source]
def ==(other) #
Description copied from class Reference

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


[View source]
def >(other) #

[View source]
def >=(other) #

[View source]
def >>(other) #

[View source]
def [](x : Int32, y : Int32) #

A synonym for #getpoint


[View source]
def [](i : Int32) #

pull out band elements from an image


[View source]
def [](index : Range) #

Fetch bands using a range


[View source]
def ^(other) #

[View source]
def |(other) #

[View source]
def a_cosh : Image #

Return the inverse hyperbolic cosine of an image in degrees.


[View source]
def a_sinh : Image #

Return the inverse hyperbolic sine of an image in degrees.


[View source]
def a_tan2(x : Image) #

Arc tangent of an image in degrees.


[View source]
def a_tanh : Image #

Return the inverse hyperbolic tangent of an image in degrees.


[View source]
def abs #

Absolute value of an image

# out_ = in.abs()

Returns

Output image


[View source]
def acos : Image #

Return the inverse cosine of an image in degrees.


[View source]
def add(right : Image) #

Add two images

# out_ = left.add(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image


[View source]
def add_alpha : Image #

Append an alpha channel to an image.


[View source]
def 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


[View source]
def asin : Image #

Return the inverse sine of an image in degrees.


[View source]
def atan : Image #

Return the inverse tangent of an image in degrees.


[View source]
def 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


[View source]
def avg #

Find image average

# out_ = in.avg()

Returns

Output value


[View source]
def band_exists?(i : Int32) #

Does band exist in image.


[View source]
def bandand #

AND the bands of an image together


[View source]
def 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


[View source]
def bandeor #

EOR the bands of an image together


[View source]
def bandfold(**kwargs) #

Fold up x axis into bands

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

Input Parameters

Optionals

factor : Int32 - Fold by this factor

Returns

Output image


[View source]
def bandjoin(arr : Array(Int32)) : Image #

[View source]
def bandjoin(arr : Array(Float64)) : Image #

[View source]
def bandjoin(arr : Array(Image)) : Image #

[View source]
def bandjoin(*arr : Float64) : Image #

Append a set of constants bandwise


[View source]
def bandjoin(*arr : Int32) : Image #

Append a set of constants bandwise


[View source]
def bandjoin(*arr : Image) : Image #

Append a set of images bandwise


[View source]
def bandjoin(*arr : Image | Number) : Image #

Append a set of mixed images and constants bandwise


[View source]
def 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


[View source]
def bandmean #

Band-wise average

# out_ = in.bandmean()

Returns

Output image


[View source]
def bandor #

OR the bands of an image together


[View source]
def bandrank(*vals : Float64, **kwargs) #

Band-wise rank a set of constants.

Optionals

index : Int32 - Select this band element from sorted list


[View source]
def bandrank(*vals : Int32, **kwargs) #

Band-wise rank a set of constants.

Optionals

index : Int32 - Select this band element from sorted list


[View source]
def bandrank(*vals : Image, **kwargs) #

Band-wise rank a set of images.

Optionals

index : Int32 - Select this band element from sorted list


[View source]
def bandrank(*vals, **kwargs) #

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

Optionals

index : Int32 - Select this band element from sorted list


[View source]
def bands : Int32 #

Number of bands in image


[View source]
def bandsplit : Array(Image) #

Split an n-band image into n separate images.


[View source]
def bandunfold(**kwargs) #

Unfold image bands into x axis

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

Input Parameters

Optionals

factor : Int32 - Unfold by this factor

Returns

Output image


[View source]
def 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


[View source]
def 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


[View source]
def buildlut #

Build a look-up table

# out_ = in.buildlut()

Returns

Output image


[View source]
def byteswap #

Byteswap an image

# out_ = in.byteswap()

Returns

Output image


[View source]
def cache(**kwargs) #

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


[View source]
def canny(**kwargs) #

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


[View source]
def case(*args : Float64) : Image #

Use pixel values to pick cases from an array of constants


[View source]
def case(*args : Int32) : Image #

Use pixel values to pick cases from an array of constants


[View source]
def case(*images : Image) : Image #

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


[View source]
def case(*args) : Image #

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


[View source]
def 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


[View source]
def ceil : Image #

Return the smallest integral value not less than the argument.


[View source]
def cmc2lch #

Transform lch to cmc

# out_ = in.cmc2lch()

Returns

Output image


[View source]
def cmyk2xyz #

Transform cmyk to xyz

# out_ = in.cmyk2xyz()

Returns

Output image


[View source]
def coding : Enums::Coding #

Pixel coding


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def conj : Image #

Return the complex conjugate of an image.


[View source]
def contains(name : String) #

Check if the underlying image contains an property of metadata.


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def convf(mask : Image) #

Float convolution operation

# out_ = in.convf(mask)

Input Parameters

Required

mask : Image - Input matrix image

Returns

Output image


[View source]
def convi(mask : Image) #

Int convolution operation

# out_ = in.convi(mask)

Input Parameters

Required

mask : Image - Input matrix image

Returns

Output image


[View source]
def 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


[View source]
def copy(**kwargs) #

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


[View source]
def 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


[View source]
def cos : Image #

Return the cosine of an image in degrees.


[View source]
def cosh : Image #

Return the hyperbolic cosine of an image in degrees.


[View source]
def 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


[View source]
def crop(left : Int32, top : Int32, width : Int32, height : Int32) #

A synonym for #extract_area


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def de00(right : Image) #

Calculate de00

# out_ = left.de00(right)

Input Parameters

Required

right : Image - Right-hand input image

Returns

Output image


[View source]
def de76(right : Image) #

Calculate de76

# out_ = left.de76(right)

Input Parameters

Required

right : Image - Right-hand input image

Returns

Output image


[View source]
def decmc(right : Image) #

Calculate decmc

# out_ = left.decmc(right)

Input Parameters

Required

right : Image - Right-hand input image

Returns

Output image


[View source]
def deviate #

Find image standard deviation

# out_ = in.deviate()

Returns

Output value


[View source]
def dilate(mask : Image) #

Dilate with a structuring element.


[View source]
def divide(right : Image) #

Divide two images

# out_ = left.divide(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image


[View source]
def 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


[View source]
def dzsave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def erode(mask : Image) #

Erode with a structuring element.


[View source]
def exp : Image #

Returns e ** pixel


[View source]
def exp10 : Image #

Returns 10 ** pixel


[View source]
def 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


[View source]
def 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


[View source]
def falsecolour #

False-color an image

# out_ = in.falsecolour()

Returns

Output image


[View source]
def fastcor(ref : Image) #

Fast correlation

# out_ = in.fastcor(ref)

Input Parameters

Required

ref : Image - Input reference image

Returns

Output image


[View source]
def filename : String #

Image filename


[View source]
def 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


[View source]
def find_trim(**kwargs) #

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


[View source]
def 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


[View source]
def flatten(**kwargs) #

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


[View source]
def flip(direction : Enums::Direction) #

Flip an image

# out_ = in.flip(direction)

Input Parameters

Required

direction : Enums::Direction - Direction to flip image

Returns

Output image


[View source]
def fliphor #

Flip horizontally


[View source]
def flipver #

Flip vertically


[View source]
def float2rad #

Transform float rgb to radiance coding

# out_ = in.float2rad()

Returns

Output image


[View source]
def floor : Image #

Return the largest integral value not greater than the argument.


[View source]
def format : Enums::BandFormat #

Pixel format in image


[View source]
def freqmult(mask : Image) #

Frequency-domain filtering

# out_ = in.freqmult(mask)

Input Parameters

Required

mask : Image - Input mask image

Returns

Output image


[View source]
def fwfft #

Forward fft

# out_ = in.fwfft()

Returns

Output image


[View source]
def gamma(**kwargs) #

Gamma an image

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

Input Parameters

Optionals

exponent : Float64 - Gamma factor

Returns

Output image


[View source]
def 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


[View source]
def 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.


[View source]
def get_fields #

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


[View source]
def get_typeof(nam : String) #
Description copied from class Vips::VipsObject

Get the GType of a GObject property


[View source]
def 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


[View source]
def 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


[View source]
def gifsave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def globalbalance(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def has_alpha? : Bool #

Does this image have an alpha channel?


[View source]
def height : Int32 #

Image height in pixels


[View source]
def hist_cum #

Form cumulative histogram

# out_ = in.hist_cum()

Returns

Output image


[View source]
def hist_entropy #

Estimate image entropy

# out_ = in.hist_entropy()

Returns

Output value


[View source]
def hist_equal(**kwargs) #

Histogram equalisation

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

Input Parameters

Optionals

band : Int32 - Equalise with this band

Returns

Output image


[View source]
def hist_find(**kwargs) #

Find image histogram

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

Input Parameters

Optionals

band : Int32 - Find histogram of band

Returns

Output histogram


[View source]
def 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


[View source]
def hist_find_ndim(**kwargs) #

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


[View source]
def hist_ismonotonic #

Test for monotonicity

# monotonic = in.hist_ismonotonic()

Returns

true if in is monotonic


[View source]
def 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


[View source]
def hist_match(ref : Image) #

Match two histograms

# out_ = in.hist_match(ref)

Input Parameters

Required

ref : Image - Reference histogram

Returns

Output image


[View source]
def hist_norm #

Normalise histogram

# out_ = in.hist_norm()

Returns

Output image


[View source]
def hist_plot #

Plot histogram

# out_ = in.hist_plot()

Returns

Output image


[View source]
def hough_circle(**kwargs) #

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


[View source]
def hough_line(**kwargs) #

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


[View source]
def hsv2srgb #

Transform hsv to srgb

# out_ = in.hsv2srgb()

Returns

Output image


[View source]
def icc_export(**kwargs) #

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


[View source]
def icc_import(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def imag : Image #

Return the imaginary part of a complex image.


[View source]
def 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


[View source]
def interpretation : Enums::Interpretation #

Pixel interpretation


[View source]
def invert #

Invert an image

# out_ = in.invert()

Returns

Output image


[View source]
def invertlut(**kwargs) #

Build an inverted look-up table

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

Input Parameters

Optionals

size : Int32 - LUT size to generate

Returns

Output image


[View source]
def invfft(**kwargs) #

Inverse fft

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

Input Parameters

Optionals

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

Returns

Output image


[View source]
def 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


[View source]
def 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


[View source]
def jp2ksave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def jpegsave_buffer(**kwargs) #

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


[View source]
def jpegsave_mime(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def jxlsave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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.


[View source]
def lab2labq #

Transform float lab to labq coding

# out_ = in.lab2labq()

Returns

Output image


[View source]
def lab2labs #

Transform float lab to signed short

# out_ = in.lab2labs()

Returns

Output image


[View source]
def lab2lch #

Transform lab to lch

# out_ = in.lab2lch()

Returns

Output image


[View source]
def lab2xyz(**kwargs) #

Transform cielab to xyz

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

Input Parameters

Optionals

temp : Array(Float64) - Color temperature

Returns

Output image


[View source]
def labelregions #

Label regions in an image

# mask, segments = in.labelregions()

Returns

Mask of region labels

Optionals

segments : Int32? - Number of discrete contiguous regions


[View source]
def labq2lab #

Unpack a labq image to float lab

# out_ = in.labq2lab()

Returns

Output image


[View source]
def labq2labs #

Unpack a labq image to short lab

# out_ = in.labq2labs()

Returns

Output image


[View source]
def labq2srgb #

Convert a labq image to srgb

# out_ = in.labq2srgb()

Returns

Output image


[View source]
def labs2lab #

Transform signed short lab to float

# out_ = in.labs2lab()

Returns

Output image


[View source]
def labs2labq #

Transform short lab to labq coding

# out_ = in.labs2labq()

Returns

Output image


[View source]
def lch2cmc #

Transform lch to cmc

# out_ = in.lch2cmc()

Returns

Output image


[View source]
def lch2lab #

Transform lch to lab

# out_ = in.lch2lab()

Returns

Output image


[View source]
def 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


[View source]
def linecache(**kwargs) #

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


[View source]
def log : Image #

Return the natural log of an image


[View source]
def log10 : Image #

Return the log base 10 of an image


[View source]
def 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


[View source]
def 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


[View source]
def magicksave_bmp_buffer(**kwargs) #

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


[View source]
def magicksave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def matrixinvert #

Invert an matrix

# out_ = in.matrixinvert()

Returns

Output matrix


[View source]
def matrixprint(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def max(**kwargs) #

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


[View source]
def maxpos #

Return the coordinates of the image maximum.


[View source]
def 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


[View source]
def median(size = 3) #

size x size median filter.


[View source]
def 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


[View source]
def min(**kwargs) #

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


[View source]
def minpos #

Return the coordinates of the image minimum.


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def msb(**kwargs) #

Pick most-significant byte from an image

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

Input Parameters

Optionals

band : Int32 - Band to msb

Returns

Output image


[View source]
def multiply(right : Image) #

Multiply two images

# out_ = left.multiply(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image


[View source]
def 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.


[View source]
def 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.


[View source]
def 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.


[View source]
def offset #

[View source]
def page_height : Int32 #

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.


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def phasecor(in2 : Image) #

Calculate phase correlation

# out_ = in.phasecor(in2)

Input Parameters

Required

in2 : Image - Second input image

Returns

Output image


[View source]
def 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


[View source]
def pngsave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def polar : Image #

Return an image converted to polar coordinates.


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def premultiply(**kwargs) #

Premultiply image alpha

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

Input Parameters

Optionals

max_alpha : Float64 - Maximum value of alpha channel

Returns

Output image


[View source]
def profile #

Find image profiles

# output   = in.profile()

Returns

First non-zero pixel in column

First non-zero pixel in row


[View source]
def project #

Find image projections

# output   = in.project()

Returns

Sums of columns

Sums of rows


[View source]
def 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


[View source]
def rad2float #

Unpack radiance coding to float rgb

# out_ = in.rad2float()

Returns

Output image


[View source]
def 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


[View source]
def radsave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def real : Image #

Return the real part of a complex image.


[View source]
def recomb(m : Image) #

Linear recombination with matrix

# out_ = in.recomb(m)

Input Parameters

Required

m : Image - Matrix of coefficients

Returns

Output image


[View source]
def rect : Image #

Return an image converted to rectangular coordinates.


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def rint : Image #

Return the nearest integral value.


[View source]
def rot(angle : Enums::Angle) #

Rotate an image

# out_ = in.rot(angle)

Input Parameters

Required

angle : Enums::Angle - Angle to rotate image

Returns

Output image


[View source]
def rot180 #

Rotate 180 degrees clockwise.


[View source]
def rot270 #

Rotate 270 degrees clockwise.


[View source]
def rot45(**kwargs) #

Rotate an image

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

Input Parameters

Optionals

angle : Enums::Angle45 - Angle to rotate image

Returns

Output image


[View source]
def rot90 #

Rotate 90 degrees clockwise.


[View source]
def 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


[View source]
def 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


[View source]
def scale #

[View source]
def scaleimage(**opts) #

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


[View source]
def scrgb2bw(**kwargs) #

Convert scrgb to bw

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

Input Parameters

Optionals

depth : Int32 - Output device space depth in bits

Returns

Output image


[View source]
def scrgb2srgb(**kwargs) #

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


[View source]
def scrgb2xyz #

Transform scrgb to xyz

# out_ = in.scrgb2xyz()

Returns

Output image


[View source]
def sequential(**kwargs) #

Check sequential access

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

Input Parameters

Optionals

tile_height : Int32 - Tile height in pixels

Returns

Output image


[View source]
def set_kill(kill : Bool) #

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


[View source]
def 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.


[View source]
def set_progress(&block : Int32 -> Nil) #

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")

[View source]
def sharpen(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def sign #

Unit vector of pixel

# out_ = in.sign()

Returns

Output image


[View source]
def 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.


[View source]
def similarity(**kwargs) #

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


[View source]
def sin : Image #

Return the sine of an image in degrees.


[View source]
def sinh : Image #

Return the hyperbolic sine of an image in degrees.


[View source]
def size #

Get the image size


[View source]
def 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


[View source]
def sobel #

Sobel edge detector

# out_ = in.sobel()

Returns

Output image


[View source]
def spcor(ref : Image) #

Spatial correlation

# out_ = in.spcor(ref)

Input Parameters

Required

ref : Image - Input reference image

Returns

Output image


[View source]
def spectrum #

Make displayable power spectrum

# out_ = in.spectrum()

Returns

Output image


[View source]
def srgb2hsv #

Transform srgb to hsv

# out_ = in.srgb2hsv()

Returns

Output image


[View source]
def srgb2scrgb #

Convert an srgb image to scrgb

# out_ = in.srgb2scrgb()

Returns

Output image


[View source]
def stats #

Find many image stats

# out_ = in.stats()

Returns

Output array of statistics


[View source]
def 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


[View source]
def 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


[View source]
def subtract(right : Image) #

Subtract two images

# out_ = left.subtract(right)

Input Parameters

Required

right : Image - Right-hand image argument

Returns

Output image


[View source]
def tan : Image #

Return the tangent of an image in degrees.


[View source]
def tanh : Image #

Return the hyperbolic tangent of an image in degrees.


[View source]
def 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


[View source]
def 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


[View source]
def tiffsave_buffer(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def tilecache(**kwargs) #

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


[View source]
def to_s(io : IO) #
Description copied from class Reference

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>

[View source]
def transpose3d(**kwargs) #

Transpose3d an image

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

Input Parameters

Optionals

page_height : Int32 - Height of each input page

Returns

Output image


[View source]
def unpremultiply(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def 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


[View source]
def webpsave_buffer(**kwargs) #

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


[View source]
def webpsave_mime(**kwargs) #

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


[View source]
def 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


[View source]
def 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


[View source]
def width : Int32 #

Image width in pixels


[View source]
def wrap(**kwargs) #

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


[View source]
def 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.


[View source]
def 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.


[View source]
def write_to_bytes : 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


[View source]
def 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.


[View source]
def write_to_memory : Tuple(Pointer(Void), LibC::SizeT) #

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}


[View source]
def 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.


[View source]
def 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.


[View source]
def xoffset : Int32 #

Horizontal offset of origin


[View source]
def xres : Float64 #

Horizontal resolution in pixels/mm


[View source]
def xyz2cmyk #

Transform xyz to cmyk

# out_ = in.xyz2cmyk()

Returns

Output image


[View source]
def xyz2lab(**kwargs) #

Transform xyz to lab

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

Input Parameters

Optionals

temp : Array(Float64) - Colour temperature

Returns

Output image


[View source]
def xyz2scrgb #

Transform xyz to scrgb

# out_ = in.xyz2scrgb()

Returns

Output image


[View source]
def xyz2yxy #

Transform xyz to yxy

# out_ = in.xyz2yxy()

Returns

Output image


[View source]
def yoffset : Int32 #

Vertical offset of origin


[View source]
def yres : Float64 #

Vertical resolution in pixels/mm


[View source]
def yxy2xyz #

Transform yxy to xyz

# out_ = in.yxy2xyz()

Returns

Output image


[View source]
def 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


[View source]