Documentation

Image extends ImageAutodoc implements ArrayAccess

This class represents a Vips image object.

This module provides a binding for the vips image processing library.

It needs libvips 8.0 or later to be installed, and it needs the binary vips extension to be added to your PHP.

Example

<?php
use Jcupitt\Vips;
$im = Vips\Image::newFromFile($argv[1], ['access' => 'sequential']);
$im = $im->crop(100, 100, $im->width - 200, $im->height - 200);
$im = $im->reduce(1.0 / 0.9, 1.0 / 0.9, ['kernel' => 'linear']);
$mask = Vips\Image::newFromArray(
     [[-1,  -1, -1],
      [-1,  16, -1],
      [-1,  -1, -1]], 8);
$im = $im->conv($mask);
$im->writeToFile($argv[2]);
?>

You'll need this in your composer.json:

    "require": {
        "jcupitt/vips" : "@dev"
    }

And run with:

$ composer install
$ ./try1.php ~/pics/k2.jpg x.tif

This example loads a file, crops 100 pixels from every edge, reduces by 10% using a bilinear interpolator (the default is lanczos3), sharpens the image, and saves it back to disc again.

Reading this example line by line, we have:

$im = Vips\Image::newFromFile($argv[1], ['access' => 'sequential']);

Image::newFromFile can load any image file supported by vips. Almost all operations can be given an array of options as a final argument.

In this example, we will be accessing pixels top-to-bottom as we sweep through the image reading and writing, so sequential access mode is best for us. The default mode is random, this allows for full random access to image pixels, but is slower and needs more memory.

You can also load formatted images from strings or create images from PHP arrays.

The next line:

$im = $im->crop(100, 100, $im->width - 200, $im->height - 200);

Crops 100 pixels from every edge. You can access any vips image property directly as a PHP property. If the vips property name does not conform to PHP naming conventions, you can use something like $image->get('ipct-data').

Next we have:

$mask = Vips\Image::newFromArray(
     [[-1,  -1, -1],
      [-1,  16, -1],
      [-1,  -1, -1]], 8);
$im = $im->conv($mask);

Image::newFromArray creates an image from an array constant. The 8 at the end sets the scale: the amount to divide the image by after integer convolution. See the libvips API docs for vips_conv() (the operation invoked by Image::conv) for details on the convolution operator. See Getting more help below.

Finally:

$im->writeToFile($argv[2]);

Image::writeToFile writes an image back to the filesystem. It can write any format supported by vips: the file type is set from the filename suffix. You can write formatted images to strings, and pixel values to arrays.

Getting more help

This binding lets you call the complete C API almost directly. You should consult the C docs for full details on the operations that are available and the arguments they take. There's a handy function list which summarises the operations in the library. You can use the vips command-line interface to get help as well, for example:

$ vips embed
embed an image in a larger image
usage:
   embed in out x y width height
where:
   in           - Input image, input VipsImage
   out          - Output image, output VipsImage
   x            - Left edge of input in output, input gint
                    default: 0
                    min: -1000000000, max: 1000000000
   y            - Top edge of input in output, input gint
                    default: 0
                    min: -1000000000, max: 1000000000
   width        - Image width in pixels, input gint
                    default: 1
                    min: 1, max: 1000000000
   height       - Image height in pixels, input gint
                    default: 1
                    min: 1, max: 1000000000
optional arguments:
   extend       - How to generate the extra pixels, input VipsExtend
                    default: black
                    allowed: black, copy, repeat, mirror, white, background
   background   - Colour for background pixels, input VipsArrayDouble
operation flags: sequential-unbuffered

You can call this from PHP as:

$out = $in->embed($x, $y, $width, $height,
    ['extend' => 'copy', 'background' => [1, 2, 3]]);

'background' can also be a simple constant, such as 12, see below.

The vipsheader command-line program is an easy way to see all the properties of an image. For example:

$ vipsheader -a ~/pics/k2.jpg
/home/john/pics/k2.jpg: 1450x2048 uchar, 3 bands, srgb, jpegload
width: 1450
height: 2048
bands: 3
format: 0 - uchar
coding: 0 - none
interpretation: 22 - srgb
xoffset: 0
yoffset: 0
xres: 2.834646
yres: 2.834646
filename: "/home/john/pics/k2.jpg"
vips-loader: jpegload
jpeg-multiscan: 0
ipct-data: VIPS_TYPE_BLOB, data = 0x20f0010, length = 332

You can access any of these fields as PHP properties of the Image class. Use $image->get('ipct-data') for property names which are not valid under PHP syntax.

How it works

The binary vips extension adds a few extra functions to PHP to let you call anything in the libvips library. The API it provides is simple, but horrible.

This module is pure PHP and builds on the binary extension to provide a convenient interface for programmers. It uses the PHP magic methods __call(), __callStatic(), __get() and __set() to make vips operators appear as methods on the Image class, and vips properties as PHP properties.

The API you end up with is a object-oriented version of the VIPS C API. Full documentation on the operations and what they do is there, you can use it directly. This document explains the extra features of the PHP API and lists the available operations very briefly.

Automatic wrapping

This binding has a __call() method and uses it to look up vips operations. For example, the libvips operation embed, which appears in C as vips_embed(), appears in PHP as Image::embed.

The operation's list of required arguments is searched and the first input image is set to the value of self. Operations which do not take an input image, such as Image::black, appear as static methods. The remainder of the arguments you supply in the function call are used to set the other required input arguments. If the final supplied argument is an array, it is used to set any optional input arguments. The result is the required output argument if there is only one result, or an array of values if the operation produces several results.

For example, Image::min, the vips operation that searches an image for the minimum value, has a large number of optional arguments. You can use it to find the minimum value like this:

$min_value = $image->min();

You can ask it to return the position of the minimum with x and y.

$result = $image->min(['x' => true, 'y' => true]);
$min_value = $result['out'];
$x_pos = $result['x'];
$y_pos = $result['y'];

Now x_pos and y_pos will have the coordinates of the minimum value. There's actually a convenience function for this, Image::minpos, see below.

You can also ask for the top n minimum, for example:

$result = $image->min(['size' => 10, 'x_array' => true, 'y_array' => true]);
$x_pos = $result['x_array'];
$y_pos = $result['y_array'];

Now x_pos and y_pos will be 10-element arrays.

Because operations are member functions and return the result image, you can chain them. For example, you can write:

$result_image = $image->real()->cos();

to calculate the cosine of the real part of a complex image.

libvips types are also automatically wrapped and unwrapped. The binding looks at the type of argument required by the operation and converts the value you supply, when it can. For example, Image::linear takes a VipsArrayDouble as an argument for the set of constants to use for multiplication. You can supply this value as an integer, a float, or some kind of compound object and it will be converted for you. You can write:

$result = $image->linear(1, 3);
$result = $image->linear(12.4, 13.9);
$result = $image->linear([1, 2, 3], [4, 5, 6]);
$result = $image->linear(1, [4, 5, 6]);

And so on. You can also use Image::add() and friends, see below.

It does a couple of more ambitious conversions. It will automatically convert to and from the various vips types, like VipsBlob and VipsArrayImage. For example, you can read the ICC profile out of an image like this:

$profile = $image->get('icc-profile-data');

and $profile will be a PHP string.

If an operation takes several input images, you can use a constant for all but one of them and the wrapper will expand the constant to an image for you. For example, Image::ifthenelse() uses a condition image to pick pixels between a then and an else image:

$result = $condition->ifthenelse($then_image, $else_image);

You can use a constant instead of either the then or the else parts and it will be expanded to an image for you. If you use a constant for both then and else, it will be expanded to match the condition image. For example:

$result = $condition->ifthenelse([0, 255, 0], [255, 0, 0]);

Will make an image where true pixels are green and false pixels are red.

This is useful for Image::bandjoin, the thing to join two or more images up bandwise. You can write:

$rgba = $rgb->bandjoin(255);

to append a constant 255 band to an image, perhaps to add an alpha channel. Of course you can also write:

$result = $image->bandjoin($image2);
$result = $image->bandjoin([image2, image3]);
$result = Image::bandjoin([image1, image2, image3]);
$result = $image->bandjoin([image2, 255]);

and so on.

Array access

Images can be treated as arrays of bands. You can write:

$result = $image[1];

to get band 1 from an image (green, in an RGB image).

You can assign to bands as well. You can write:

$image[1] = $other_image;

And band 1 will be replaced by all the bands in $other_image using bandjoin. Use no offset to mean append, use -1 to mean prepend:

$image[] = $other_image; // append bands from other
$image[-1] = $other_image; // prepend bands from other

You can use number and array constants as well, for example:

$image[] = 255; // append a constant 255
$image[1] = [1, 2, 3]; // swap band 1 for three constant bands

Finally, you can delete bands with unset:

unset($image[1]); // remove band 1

Exceptions

The wrapper spots errors from vips operations and throws Vips\Exception. You can catch it in the usual way.

Draw operations

Paint operations like Image::draw_circle and Image::draw_line modify their input image. This makes them hard to use with the rest of libvips: you need to be very careful about the order in which operations execute or you can get nasty crashes.

The wrapper spots operations of this type and makes a private copy of the image in memory before calling the operation. This stops crashes, but it does make it inefficient. If you draw 100 lines on an image, for example, you'll copy the image 100 times. The wrapper does make sure that memory is recycled where possible, so you won't have 100 copies in memory.

If you want to avoid the copies, you'll need to call drawing operations yourself.

Thumbnailing

The thumbnailing functionality is implemented by Vips\Image::thumbnail and Vips\Image::thumbnail_buffer (which thumbnails an image held as a string).

You could write:

$filename = 'image.jpg';
$image = Vips\Image::thumbnail($filename, 200, ['height' => 200]);
$image->writeToFile('my-thumbnail.jpg');

Resample

There are three types of operation in this section.

First, ->affine() applies an affine transform to an image. This is any sort of 2D transform which preserves straight lines; so any combination of stretch, sheer, rotate and translate. You supply an interpolator for it to use to generate pixels (@see Image::newInterpolator()). It will not produce good results for very large shrinks: you'll see aliasing.

->reduce() is like ->affine(), but it can only shrink images, it can't enlarge, rotate, or skew. It's very fast and uses an adaptive kernel (@see Kernel for possible values) for interpolation. It will be slow for very large shrink factors.

->shrink() is a fast block shrinker. It can quickly reduce images by large integer factors. It will give poor results for small size reductions: again, you'll see aliasing.

Next, ->resize() specialises in the common task of image reduce and enlarge. It strings together combinations of ->shrink(), ->reduce(), ->affine() and others to implement a general, high-quality image resizer.

Finally, ->mapim() can apply arbitrary 2D image transforms to an image.

Expansions

Some vips operators take an enum to select an action, for example Image::math can be used to calculate sine of every pixel like this:

$result = $image->math('sin');

This is annoying, so the wrapper expands all these enums into separate members named after the enum. So you can write:

$result = $image->sin();

Convenience functions

The wrapper defines a few extra useful utility functions: Image::get, Image::set, Image::bandsplit, Image::maxpos, Image::minpos, Image::median. See below.

Logging

Use Config::setLogger to enable logging in the usual manner. A sample logger, handy for debugging, is defined in Vips\DebugLogger. You can enable debug logging with:

Vips\Config::setLogger(new Vips\DebugLogger);

Configuration

You can use the methods in Vips\Config to set various global properties of the library. For example, you can control the size of the libvips cache, or the size of the worker threadpools that libvips uses to evaluate images.

Table of Contents

$width int
$height int
$bands int
$format string
$coding string
$interpretation string
$xoffset int
$yoffset int
$xres float
$yres float
$filename string
newFromFile() Create a new Image from a file on disc. Image
findLoad() 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 newFromFile(). string|null
newFromBuffer() Create a new Image from a compressed image held as a string. Image
findLoadBuffer() 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 newFromBuffer(). string|null
newFromArray() Create a new Image from a php array. Image
newFromMemory() Wraps an Image around an area of memory containing a C-style array. Image
newInterpolator() Make an interpolator from a name. resource|null
newFromImage() Create a new image from a constant. Image
writeToFile() Write an image to a file. void
writeToBuffer() Write an image to a formatted string. string
writeToMemory() Write an image to a large memory array. string
writeToArray() Write an image to a PHP array. array
copyMemory() Copy to memory. Image
__get() Get any property from the underlying image. mixed
__set() Set any property on the underlying image. void
__isset() Check if the GType of a property from the underlying image exists. bool
get() Get any property from the underlying image. mixed
typeof() Get the GType of a property from the underlying image. GTypes are integer type identifiers. This function will return 0 if the field does not exist. int
set() Set any property on the underlying image. void
setType() Set the type and value for any property on the underlying image. void
remove() Remove a field from the underlying image. void
__toString() Makes a string-ified version of the Image. string
callBase() Call any vips operation. The final element of $arguments can be (but doesn't have to be) an array of options to pass to the operation. mixed
call() Call any vips operation, with an explicit set of options. This is more convenient than callBase() if you have a set of known options. mixed
__call() Call any vips operation as an instance method. mixed
__callStatic() Call any vips operation as a class method. mixed
hasAlpha() Does this image have an alpha channel? bool
offsetExists() Does band exist in image. bool
offsetGet() Get band from image. Image|null
offsetSet() Set a band. void
offsetUnset() Remove a band from an image. void
add() Add $other to this image. Image
subtract() Subtract $other from this image. Image
multiply() Multiply this image by $other. Image
divide() Divide this image by $other. Image
remainder() Remainder of this image and $other. Image
pow() Find $this to the power of $other. Image
wop() Find $other to the power of $this. Image
lshift() Shift $this left by $other. Image
rshift() Shift $this right by $other. Image
andimage() Bitwise AND of $this and $other. This has to be called ->andimage() rather than ->and() to avoid confusion in phpdoc. Image
orimage() Bitwise OR of $this and $other. Image
eorimage() Bitwise EOR of $this and $other. Image
more() 255 where $this is more than $other. Image
moreEq() 255 where $this is more than or equal to $other. Image
less() 255 where $this is less than $other. Image
lessEq() 255 where $this is less than or equal to $other. Image
equal() 255 where $this is equal to $other. Image
notEq() 255 where $this is not equal to $other. Image
bandjoin() Join $this and $other bandwise. Image
bandsplit() Split $this into an array of single-band images. array
bandrank() For each band element, sort the array of input images and pick the median. Use the index option to pick something else. Image
composite() Composite $other on top of $this with $mode. Image
maxpos() Position of max is awkward with plain self::max. array
minpos() Position of min is awkward with plain self::max. array
ifthenelse() Use $this as a condition image to pick pixels from either $then or $else. Image
floor() Return the largest integral value not greater than the argument. Image
ceil() Return the smallest integral value not less than the argument. Image
rint() Return the nearest integral value. Image
bandand() AND image bands together. Image
bandor() OR image bands together. Image
bandeor() EOR image bands together. Image
real() Return the real part of a complex image. Image
imag() Return the imaginary part of a complex image. Image
polar() Return an image converted to polar coordinates. Image
rect() Return an image converted to rectangular coordinates. Image
conj() Return the complex conjugate of an image. Image
crossPhase() Find the cross-phase of this image with $other. Image
sin() Return the sine of an image in degrees. Image
cos() Return the cosine of an image in degrees. Image
tan() Return the tangent of an image in degrees. Image
asin() Return the inverse sine of an image in degrees. Image
acos() Return the inverse cosine of an image in degrees. Image
atan() Return the inverse tangent of an image in degrees. Image
log() Return the natural log of an image. Image
log10() Return the log base 10 of an image. Image
exp() Return e ** pixel. Image
exp10() Return 10 ** pixel. Image
erode() Erode with a structuring element. Image
dilate() Dilate with a structuring element. Image
median() $size x $size median filter. Image
fliphor() Flip horizontally. Image
flipver() Flip vertically. Image
rot90() Rotate 90 degrees clockwise. Image
rot180() Rotate 180 degrees. Image
rot270() Rotate 270 degrees clockwise. Image
CMC2LCh() Image
CMYK2XYZ() Image
HSV2sRGB() Image
LCh2CMC() Image
LCh2Lab() Image
Lab2LCh() Image
Lab2LabQ() Image
Lab2LabS() Image
Lab2XYZ() Image
LabQ2Lab() Image
LabQ2LabS() Image
LabQ2sRGB() Image
LabS2Lab() Image
LabS2LabQ() Image
XYZ2CMYK() Image
XYZ2Lab() Image
XYZ2Yxy() Image
XYZ2scRGB() Image
Yxy2XYZ() Image
abs() Image
affine() Image
analyzeload() Image
arrayjoin() Image
autorot() Image
avg() float
bandbool() Image
bandfold() Image
bandjoin_const() Image
bandmean() Image
bandunfold() Image
black() Image
boolean() Image
boolean_const() Image
buildlut() Image
byteswap() Image
cache() Image
canny() Image
case() Image
cast() Image
colourspace() Image
compass() Image
complex() Image
complex2() Image
complexform() Image
complexget() Image
composite() Image
composite2() Image
conv() Image
conva() Image
convasep() Image
convf() Image
convi() Image
convsep() Image
copy() Image
countlines() float
crop() Image
csvload() Image
csvload_source() Image
csvsave() void
csvsave_target() void
dE00() Image
dE76() Image
dECMC() Image
deviate() float
draw_circle() Image
draw_flood() Image
draw_image() Image
draw_line() Image
draw_mask() Image
draw_rect() Image
draw_smudge() Image
dzsave() void
dzsave_buffer() string
embed() Image
extract_area() Image
extract_band() Image
eye() Image
falsecolour() Image
fastcor() Image
fill_nearest() Image
find_trim() array
fitsload() Image
fitssave() void
flatten() Image
flip() Image
float2rad() Image
fractsurf() Image
freqmult() Image
fwfft() Image
gamma() Image
gaussblur() Image
gaussmat() Image
gaussnoise() Image
getpoint() array
gifload() Image
gifload_buffer() Image
gifload_source() Image
globalbalance() Image
gravity() Image
grey() Image
grid() Image
heifload() Image
heifload_buffer() Image
heifload_source() Image
heifsave() void
heifsave_buffer() string
heifsave_target() void
hist_cum() Image
hist_entropy() float
hist_equal() Image
hist_find() Image
hist_find_indexed() Image
hist_find_ndim() Image
hist_ismonotonic() bool
hist_local() Image
hist_match() Image
hist_norm() Image
hist_plot() Image
hough_circle() Image
hough_line() Image
icc_export() Image
icc_import() Image
icc_transform() Image
identity() Image
insert() Image
invert() Image
invertlut() Image
invfft() Image
join() Image
jpegload() Image
jpegload_buffer() Image
jpegload_source() Image
jpegsave() void
jpegsave_buffer() string
jpegsave_mime() void
jpegsave_target() void
labelregions() Image
linear() Image
linecache() Image
logmat() Image
magickload() Image
magickload_buffer() Image
magicksave() void
magicksave_buffer() string
mapim() Image
maplut() Image
mask_butterworth() Image
mask_butterworth_band() Image
mask_butterworth_ring() Image
mask_fractal() Image
mask_gaussian() Image
mask_gaussian_band() Image
mask_gaussian_ring() Image
mask_ideal() Image
mask_ideal_band() Image
mask_ideal_ring() Image
match() Image
math() Image
math2() Image
math2_const() Image
matload() Image
matrixinvert() Image
matrixload() Image
matrixload_source() Image
matrixprint() void
matrixsave() void
matrixsave_target() void
max() float
measure() Image
merge() Image
min() float
morph() Image
mosaic() Image
mosaic1() Image
msb() Image
niftiload() Image
niftisave() void
openexrload() Image
openslideload() Image
pdfload() Image
pdfload_buffer() Image
pdfload_source() Image
percent() int
perlin() Image
phasecor() Image
pngload() Image
pngload_buffer() Image
pngload_source() Image
pngsave() void
pngsave_buffer() string
pngsave_target() void
ppmload() Image
ppmload_source() Image
ppmsave() void
ppmsave_target() void
premultiply() Image
profile() array
profile_load() string
project() array
quadratic() Image
rad2float() Image
radload() Image
radload_buffer() Image
radload_source() Image
radsave() void
radsave_buffer() string
radsave_target() void
rank() Image
rawload() Image
rawsave() void
rawsave_fd() void
recomb() Image
reduce() Image
reduceh() Image
reducev() Image
relational() Image
relational_const() Image
remainder_const() Image
replicate() Image
resize() Image
rot() Image
rot45() Image
rotate() Image
round() Image
sRGB2HSV() Image
sRGB2scRGB() Image
scRGB2BW() Image
scRGB2XYZ() Image
scRGB2sRGB() Image
scale() Image
sequential() Image
sharpen() Image
shrink() Image
shrinkh() Image
shrinkv() Image
sign() Image
similarity() Image
sines() Image
smartcrop() Image
sobel() Image
spcor() Image
spectrum() Image
stats() Image
stdif() Image
subsample() Image
sum() Image
svgload() Image
svgload_buffer() Image
svgload_source() Image
switch() Image
system() void
text() Image
thumbnail() Image
thumbnail_buffer() Image
thumbnail_image() Image
thumbnail_source() Image
tiffload() Image
tiffload_buffer() Image
tiffload_source() Image
tiffsave() void
tiffsave_buffer() string
tilecache() Image
tonelut() Image
transpose3d() Image
unpremultiply() Image
vipsload() Image
vipssave() void
webpload() Image
webpload_buffer() Image
webpload_source() Image
webpsave() void
webpsave_buffer() string
webpsave_target() void
worley() Image
wrap() Image
xyz() Image
zone() Image
zoom() Image

Properties

$format

public string $format
Pixel format in image @see BandFormat for possible values

$coding

public string $coding
Pixel coding @see Coding for possible values

$interpretation

public string $interpretation
Pixel interpretation @see Interpretation for possible values

$xres

public float $xres
Horizontal resolution in pixels/mm

$yres

public float $yres
Vertical resolution in pixels/mm

Methods

newFromFile()

Create a new Image from a file on disc.

public static newFromFile( $filename : string [, $options : array = [] ] ) : Image
Parameters
$filename : string

The file to open.

$options : array = []

Any options to pass on to the load operation.

Tags
throws
Return values
Image

A new Image.

findLoad()

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 newFromFile().

public static findLoad( $filename : string ) : string|null
Parameters
$filename : string

The file to test.

Return values
string|null

The name of the load operation, or null.

newFromBuffer()

Create a new Image from a compressed image held as a string.

public static newFromBuffer( $buffer : string [, $option_string : string = '' ] [, $options : array = [] ] ) : Image
Parameters
$buffer : string

The formatted image to open.

$option_string : string = ''

Any text-style options to pass to the selected loader.

$options : array = []

Any options to pass on to the load operation.

Tags
throws
Return values
Image

A new Image.

findLoadBuffer()

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 newFromBuffer().

public static findLoadBuffer( $buffer : string ) : string|null
Parameters
$buffer : string

The formatted image to test.

Return values
string|null

The name of the load operation, or null.

newFromArray()

Create a new Image from a php array.

public static newFromArray( $array : array [, $scale : float = 1.0 ] [, $offset : float = 0.0 ] ) : Image

2D arrays become 2D images. 1D arrays become 2D images with height 1.

Parameters
$array : array

The array to make the image from.

$scale : float = 1.0

The "scale" metadata item. Useful for integer convolution masks.

$offset : float = 0.0

The "offset" metadata item. Useful for integer convolution masks.

Tags
throws
Return values
Image

A new Image.

newFromMemory()

Wraps an Image around an area of memory containing a C-style array.

public static newFromMemory( $data : string , $width : int , $height : int , $bands : int , $format : string ) : Image
Parameters
$data : string

C-style array.

$width : int

Image width in pixels.

$height : int

Image height in pixels.

$bands : int

Number of bands.

$format : string

Band format. (@see BandFormat)

Tags
throws
Return values
Image

A new Image.

newInterpolator()

Make an interpolator from a name.

public static newInterpolator( $name : string ) : resource|null
Parameters
$name : string

Name of the interpolator. Possible interpolators are:

  • 'nearest': Use nearest neighbour interpolation.
  • 'bicubic': Use bicubic interpolation.
  • 'bilinear': Use bilinear interpolation (the default).
  • 'nohalo': Use Nohalo interpolation.
  • 'lbb': Use LBB interpolation.
  • 'vsqbs': Use the VSQBS interpolation.
Return values
resource|null

The interpolator, or null on error.

newFromImage()

Create a new image from a constant.

public newFromImage( $value : mixed ) : Image

The new image has the same width, height, format, interpretation, xres, yres, xoffset, yoffset as $this, but each pixel has the constant value $value.

Pass a single number to make a one-band image, pass an array of numbers to make an N-band image.

Parameters
$value : mixed

The value to set each pixel to.

Tags
throws
Return values
Image

A new Image.

writeToFile()

Write an image to a file.

public writeToFile( $filename : string [, $options : array = [] ] ) : void
Parameters
$filename : string

The file to write the image to.

$options : array = []

Any options to pass on to the selected save operation.

Tags
throws

writeToBuffer()

Write an image to a formatted string.

public writeToBuffer( $suffix : string [, $options : array = [] ] ) : string
Parameters
$suffix : string

The file type suffix, eg. ".jpg".

$options : array = []

Any options to pass on to the selected save operation.

Tags
throws
Return values
string

The formatted image.

writeToMemory()

Write an image to a large memory array.

public writeToMemory( ) : string
Tags
throws
Return values
string

The memory array.

writeToArray()

Write an image to a PHP array.

public writeToArray( ) : array

Pixels are written as a simple one-dimensional array, for example, if you write:

$result = $image->crop(100, 100, 10, 1)->writeToArray();

This will crop out 10 pixels and write them to the array. If $image is an RGB image, then $array will contain 30 numbers, with the first three being R, G and B for the first pixel.

You'll need to slice and repack the array if you want more dimensions.

This method is much faster than repeatedly calling getpoint(). It will use a lot of memory.

Tags
throws
Return values
array

The pixel values as a PHP array.

copyMemory()

Copy to memory.

public copyMemory( ) : Image

An area of memory large enough to hold the complete image is allocated, the image is rendered into it, and a new Image is returned which wraps this memory area.

This is useful for ending a pipeline and starting a new random access one, but can obviously use a lot of memory if the image is large.

Tags
throws
Return values
Image

A new Image.

__get()

Get any property from the underlying image.

public __get( $name : string ) : mixed
Parameters
$name : string

The property name.

Tags
throws
Return values
mixed

__set()

Set any property on the underlying image.

public __set( $name : string , $value : mixed ) : void
Parameters
$name : string

The property name.

$value : mixed

The value to set for this property.

__isset()

Check if the GType of a property from the underlying image exists.

public __isset( $name : string ) : bool
Parameters
$name : string

The property name.

Return values
bool

get()

Get any property from the underlying image.

public get( $name : string ) : mixed

This is handy for fields whose name does not match PHP's variable naming conventions, like 'exif-data'.

It will throw an exception if $name does not exist. Use Image::typeof() to test for the existence of a field.

Parameters
$name : string

The property name.

Tags
throws
Return values
mixed

typeof()

Get the GType of a property from the underlying image. GTypes are integer type identifiers. This function will return 0 if the field does not exist.

public typeof( $name : string ) : int
Parameters
$name : string

The property name.

Return values
int

set()

Set any property on the underlying image.

public set( $name : string , $value : mixed ) : void

This is handy for fields whose name does not match PHP's variable naming conventions, like 'exif-data'.

Parameters
$name : string

The property name.

$value : mixed

The value to set for this property.

Tags
throws

setType()

Set the type and value for any property on the underlying image.

public setType( $type : int , $name : string , $value : mixed ) : void

This is useful if the type of the property cannot be determined from the php type of the value.

Use Utils::typeFromName() to look up types by name.

Parameters
$type : int

The type of the property.

$name : string

The property name.

$value : mixed

The value to set for this property.

Tags
throws

remove()

Remove a field from the underlying image.

public remove( $name : string ) : void
Parameters
$name : string

The property name.

Tags
throws

__toString()

Makes a string-ified version of the Image.

public __toString( ) : string
Return values
string

callBase()

Call any vips operation. The final element of $arguments can be (but doesn't have to be) an array of options to pass to the operation.

public static callBase( $name : string , $instance : Image|null , $arguments : array ) : mixed

We can't have a separate arg for the options since this will be run from __call(), which cannot know which args are required and which are optional. See call() below for a version with the options broken out.

Parameters
$name : string

The operation name.

$instance : Image|null

The instance this operation is being invoked from.

$arguments : array

An array of arguments to pass to the operation.

Tags
throws
Return values
mixed

The result(s) of the operation.

call()

Call any vips operation, with an explicit set of options. This is more convenient than callBase() if you have a set of known options.

public static call( $name : string , $instance : Image|null , $arguments : array [, $options : array = [] ] ) : mixed
Parameters
$name : string

The operation name.

$instance : Image|null

The instance this operation is being invoked from.

$arguments : array

An array of arguments to pass to the operation.

$options : array = []

An array of optional arguments to pass to the operation.

Tags
throws
Return values
mixed

The result(s) of the operation.

__call()

Call any vips operation as an instance method.

public __call( $name : string , $arguments : array ) : mixed
Parameters
$name : string

The thing we call.

$arguments : array

The arguments to the thing.

Tags
throws
Return values
mixed

The result.

__callStatic()

Call any vips operation as a class method.

public static __callStatic( $name : string , $arguments : array ) : mixed
Parameters
$name : string

The thing we call.

$arguments : array

The arguments to the thing.

Tags
throws
Return values
mixed

The result.

hasAlpha()

Does this image have an alpha channel?

public hasAlpha( ) : bool

Uses colour space interpretation with number of channels to guess this.

Return values
bool

indicating if this image has an alpha channel.

offsetExists()

Does band exist in image.

public offsetExists( $offset : mixed ) : bool
Parameters
$offset : mixed

The index to fetch.

Return values
bool

true if the index exists.

offsetGet()

Get band from image.

public offsetGet( $offset : mixed ) : Image|null
Parameters
$offset : mixed

The index to fetch.

Tags
throws
Return values
Image|null

the extracted band or null.

offsetSet()

Set a band.

public offsetSet( $offset : int , $value : Image ) : void

Use $image[1] = $other_image;' to remove band 1 from this image, replacing it with all the bands in$other_image`.

Use $image[] = $other_image;' to append all the bands in$other_image to$image`.

Use $image[-1] = $other_image; to prepend all the bands in $other_image to $image.

You can use constants or arrays in place of $other_image. Use $image[] = 255; to append a constant 255 band, for example, or $image[1] = [1, 2]; to replace band 1 with two constant bands.

Parameters
$offset : int

The index to set.

$value : Image

The band to insert

Tags
throws

if the offset is not integer or null

throws

offsetUnset()

Remove a band from an image.

public offsetUnset( $offset : int ) : void
Parameters
$offset : int

The index to remove.

Tags
throws

if there is only one band left in the image

throws

add()

Add $other to this image.

public add( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The thing to add to this image.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

subtract()

Subtract $other from this image.

public subtract( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The thing to subtract from this image.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

multiply()

Multiply this image by $other.

public multiply( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The thing to multiply this image by.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

divide()

Divide this image by $other.

public divide( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The thing to divide this image by.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

remainder()

Remainder of this image and $other.

public remainder( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The thing to take the remainder with.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

pow()

Find $this to the power of $other.

public pow( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

wop()

Find $other to the power of $this.

public wop( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

lshift()

Shift $this left by $other.

public lshift( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

rshift()

Shift $this right by $other.

public rshift( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

andimage()

Bitwise AND of $this and $other. This has to be called ->andimage() rather than ->and() to avoid confusion in phpdoc.

public andimage( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

orimage()

Bitwise OR of $this and $other.

public orimage( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

eorimage()

Bitwise EOR of $this and $other.

public eorimage( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

more()

255 where $this is more than $other.

public more( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

moreEq()

255 where $this is more than or equal to $other.

public moreEq( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

less()

255 where $this is less than $other.

public less( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

lessEq()

255 where $this is less than or equal to $other.

public lessEq( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

equal()

255 where $this is equal to $other.

public equal( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

notEq()

255 where $this is not equal to $other.

public notEq( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

bandjoin()

Join $this and $other bandwise.

public bandjoin( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

bandsplit()

Split $this into an array of single-band images.

public bandsplit( [ $options : array = [] ] ) : array
Parameters
$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
array

An array of images.

bandrank()

For each band element, sort the array of input images and pick the median. Use the index option to pick something else.

public bandrank( $other : mixed [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The right-hand side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

composite()

Composite $other on top of $this with $mode.

public composite( $other : mixed , $mode : BlendMode|array [, $options : array = [] ] ) : Image
Parameters
$other : mixed

The overlay.

$mode : BlendMode|array

The mode to composite with.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

maxpos()

Position of max is awkward with plain self::max.

public maxpos( ) : array
Tags
throws
Return values
array

(float, int, int) The value and position of the maximum.

minpos()

Position of min is awkward with plain self::max.

public minpos( ) : array
Tags
throws
Return values
array

(float, int, int) The value and position of the minimum.

ifthenelse()

Use $this as a condition image to pick pixels from either $then or $else.

public ifthenelse( $then : mixed , $else : mixed [, $options : array = [] ] ) : Image
Parameters
$then : mixed

The true side of the operator

$else : mixed

The false side of the operator.

$options : array = []

An array of options to pass to the operation.

Tags
throws
Return values
Image

A new image.

floor()

Return the largest integral value not greater than the argument.

public floor( ) : Image
Tags
throws
Return values
Image

A new image.

ceil()

Return the smallest integral value not less than the argument.

public ceil( ) : Image
Tags
throws
Return values
Image

A new image.

rint()

Return the nearest integral value.

public rint( ) : Image
Tags
throws
Return values
Image

A new image.

bandand()

AND image bands together.

public bandand( ) : Image
Tags
throws
Return values
Image

A new image.

bandor()

OR image bands together.

public bandor( ) : Image
Tags
throws
Return values
Image

A new image.

bandeor()

EOR image bands together.

public bandeor( ) : Image
Tags
throws
Return values
Image

A new image.

real()

Return the real part of a complex image.

public real( ) : Image
Tags
throws
Return values
Image

A new image.

imag()

Return the imaginary part of a complex image.

public imag( ) : Image
Tags
throws
Return values
Image

A new image.

polar()

Return an image converted to polar coordinates.

public polar( ) : Image
Tags
throws
Return values
Image

A new image.

rect()

Return an image converted to rectangular coordinates.

public rect( ) : Image
Tags
throws
Return values
Image

A new image.

conj()

Return the complex conjugate of an image.

public conj( ) : Image
Tags
throws
Return values
Image

A new image.

crossPhase()

Find the cross-phase of this image with $other.

public crossPhase( $other : mixed ) : Image
Parameters
$other : mixed

The thing to cross-phase by.

Tags
throws
Return values
Image

A new image.

sin()

Return the sine of an image in degrees.

public sin( ) : Image
Tags
throws
Return values
Image

A new image.

cos()

Return the cosine of an image in degrees.

public cos( ) : Image
Tags
throws
Return values
Image

A new image.

tan()

Return the tangent of an image in degrees.

public tan( ) : Image
Tags
throws
Return values
Image

A new image.

asin()

Return the inverse sine of an image in degrees.

public asin( ) : Image
Tags
throws
Return values
Image

A new image.

acos()

Return the inverse cosine of an image in degrees.

public acos( ) : Image
Tags
throws
Return values
Image

A new image.

atan()

Return the inverse tangent of an image in degrees.

public atan( ) : Image
Tags
throws
Return values
Image

A new image.

log()

Return the natural log of an image.

public log( ) : Image
Tags
throws
Return values
Image

A new image.

log10()

Return the log base 10 of an image.

public log10( ) : Image
Tags
throws
Return values
Image

A new image.

exp()

Return e ** pixel.

public exp( ) : Image
Tags
throws
Return values
Image

A new image.

exp10()

Return 10 ** pixel.

public exp10( ) : Image
Tags
throws
Return values
Image

A new image.

erode()

Erode with a structuring element.

public erode( $mask : mixed ) : Image
Parameters
$mask : mixed

Erode with this structuring element.

Tags
throws
Return values
Image

A new image.

dilate()

Dilate with a structuring element.

public dilate( $mask : mixed ) : Image
Parameters
$mask : mixed

Dilate with this structuring element.

Tags
throws
Return values
Image

A new image.

median()

$size x $size median filter.

public median( $size : int ) : Image
Parameters
$size : int

Size of median filter.

Tags
throws
Return values
Image

A new image.

fliphor()

Flip horizontally.

public fliphor( ) : Image
Tags
throws
Return values
Image

A new image.

flipver()

Flip vertically.

public flipver( ) : Image
Tags
throws
Return values
Image

A new image.

rot90()

Rotate 90 degrees clockwise.

public rot90( ) : Image
Tags
throws
Return values
Image

A new image.

rot180()

Rotate 180 degrees.

public rot180( ) : Image
Tags
throws
Return values
Image

A new image.

rot270()

Rotate 270 degrees clockwise.

public rot270( ) : Image
Tags
throws
Return values
Image

A new image.

CMC2LCh()

public CMC2LCh( $options = [] : array ) : Image

Transform LCh to CMC. @throws Exception

Parameters
$options = [] : array
Return values
Image

CMYK2XYZ()

public CMYK2XYZ( $options = [] : array ) : Image

Transform CMYK to XYZ. @throws Exception

Parameters
$options = [] : array
Return values
Image

HSV2sRGB()

public HSV2sRGB( $options = [] : array ) : Image

Transform HSV to sRGB. @throws Exception

Parameters
$options = [] : array
Return values
Image

LCh2CMC()

public LCh2CMC( $options = [] : array ) : Image

Transform LCh to CMC. @throws Exception

Parameters
$options = [] : array
Return values
Image

LCh2Lab()

public LCh2Lab( $options = [] : array ) : Image

Transform LCh to Lab. @throws Exception

Parameters
$options = [] : array
Return values
Image

Lab2LCh()

public Lab2LCh( $options = [] : array ) : Image

Transform Lab to LCh. @throws Exception

Parameters
$options = [] : array
Return values
Image

Lab2LabQ()

public Lab2LabQ( $options = [] : array ) : Image

Transform float Lab to LabQ coding. @throws Exception

Parameters
$options = [] : array
Return values
Image

Lab2LabS()

public Lab2LabS( $options = [] : array ) : Image

Transform float Lab to signed short. @throws Exception

Parameters
$options = [] : array
Return values
Image

Lab2XYZ()

public Lab2XYZ( $options = [] : array ) : Image

Transform CIELAB to XYZ. @throws Exception

Parameters
$options = [] : array
Return values
Image

LabQ2Lab()

public LabQ2Lab( $options = [] : array ) : Image

Unpack a LabQ image to float Lab. @throws Exception

Parameters
$options = [] : array
Return values
Image

LabQ2LabS()

public LabQ2LabS( $options = [] : array ) : Image

Unpack a LabQ image to short Lab. @throws Exception

Parameters
$options = [] : array
Return values
Image

LabQ2sRGB()

public LabQ2sRGB( $options = [] : array ) : Image

Convert a LabQ image to sRGB. @throws Exception

Parameters
$options = [] : array
Return values
Image

LabS2Lab()

public LabS2Lab( $options = [] : array ) : Image

Transform signed short Lab to float. @throws Exception

Parameters
$options = [] : array
Return values
Image

LabS2LabQ()

public LabS2LabQ( $options = [] : array ) : Image

Transform short Lab to LabQ coding. @throws Exception

Parameters
$options = [] : array
Return values
Image

XYZ2CMYK()

public XYZ2CMYK( $options = [] : array ) : Image

Transform XYZ to CMYK. @throws Exception

Parameters
$options = [] : array
Return values
Image

XYZ2Lab()

public XYZ2Lab( $options = [] : array ) : Image

Transform XYZ to Lab. @throws Exception

Parameters
$options = [] : array
Return values
Image

XYZ2Yxy()

public XYZ2Yxy( $options = [] : array ) : Image

Transform XYZ to Yxy. @throws Exception

Parameters
$options = [] : array
Return values
Image

XYZ2scRGB()

public XYZ2scRGB( $options = [] : array ) : Image

Transform XYZ to scRGB. @throws Exception

Parameters
$options = [] : array
Return values
Image

Yxy2XYZ()

public Yxy2XYZ( $options = [] : array ) : Image

Transform Yxy to XYZ. @throws Exception

Parameters
$options = [] : array
Return values
Image

abs()

public abs( $options = [] : array ) : Image

Absolute value of an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

affine()

public affine( $matrix : float[]|float , $options = [] : array ) : Image

Affine transform of an image. @throws Exception

Parameters
$matrix : float[]|float
$options = [] : array
Return values
Image

analyzeload()

public static analyzeload( $filename : string , $options = [] : array ) : Image

Load an Analyze6 image. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

arrayjoin()

public static arrayjoin( $in : \Jcupitt\Vips\Image[]|Image , $options = [] : array ) : Image

Join an array of images. @throws Exception

Parameters
$in : \Jcupitt\Vips\Image[]|Image
$options = [] : array
Return values
Image

autorot()

public autorot( $options = [] : array ) : Image

Autorotate image by exif tag. @throws Exception

Parameters
$options = [] : array
Return values
Image

avg()

public avg( $options = [] : array ) : float

Find image average. @throws Exception

Parameters
$options = [] : array
Return values
float

bandbool()

public bandbool( $boolean : string , $options = [] : array ) : Image

Boolean operation across image bands. @see OperationBoolean for possible values for $boolean @throws Exception

Parameters
$boolean : string
$options = [] : array
Return values
Image

bandfold()

public bandfold( $options = [] : array ) : Image

Fold up x axis into bands. @throws Exception

Parameters
$options = [] : array
Return values
Image

bandjoin_const()

public bandjoin_const( $c : float[]|float , $options = [] : array ) : Image

Append a constant band to an image. @throws Exception

Parameters
$c : float[]|float
$options = [] : array
Return values
Image

bandmean()

public bandmean( $options = [] : array ) : Image

Band-wise average. @throws Exception

Parameters
$options = [] : array
Return values
Image

bandunfold()

public bandunfold( $options = [] : array ) : Image

Unfold image bands into x axis. @throws Exception

Parameters
$options = [] : array
Return values
Image

black()

public static black( $width : int , $height : int , $options = [] : array ) : Image

Make a black image. @throws Exception

Parameters
$width : int
$height : int
$options = [] : array
Return values
Image

boolean()

public boolean( $right : Image , $boolean : string , $options = [] : array ) : Image

Boolean operation on two images. @see OperationBoolean for possible values for $boolean @throws Exception

Parameters
$right : Image
$boolean : string
$options = [] : array
Return values
Image

boolean_const()

public boolean_const( $boolean : string , $c : float[]|float , $options = [] : array ) : Image

Boolean operations against a constant. @see OperationBoolean for possible values for $boolean @throws Exception

Parameters
$boolean : string
$c : float[]|float
$options = [] : array
Return values
Image

buildlut()

public buildlut( $options = [] : array ) : Image

Build a look-up table. @throws Exception

Parameters
$options = [] : array
Return values
Image

byteswap()

public byteswap( $options = [] : array ) : Image

Byteswap an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

cache()

public cache( $options = [] : array ) : Image

Cache an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

canny()

public canny( $options = [] : array ) : Image

Canny edge detector. @throws Exception

Parameters
$options = [] : array
Return values
Image

case()

public case( $cases : \Jcupitt\Vips\Image[]|Image , $options = [] : array ) : Image

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

Parameters
$cases : \Jcupitt\Vips\Image[]|Image
$options = [] : array
Return values
Image

cast()

public cast( $format : string , $options = [] : array ) : Image

Cast an image. @see BandFormat for possible values for $format @throws Exception

Parameters
$format : string
$options = [] : array
Return values
Image

colourspace()

public colourspace( $space : string , $options = [] : array ) : Image

Convert to a new colorspace. @see Interpretation for possible values for $space @throws Exception

Parameters
$space : string
$options = [] : array
Return values
Image

compass()

public compass( $mask : Image , $options = [] : array ) : Image

Convolve with rotating mask. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

complex()

public complex( $cmplx : string , $options = [] : array ) : Image

Perform a complex operation on an image. @see OperationComplex for possible values for $cmplx @throws Exception

Parameters
$cmplx : string
$options = [] : array
Return values
Image

complex2()

public complex2( $right : Image , $cmplx : string , $options = [] : array ) : Image

Complex binary operations on two images. @see OperationComplex2 for possible values for $cmplx @throws Exception

Parameters
$right : Image
$cmplx : string
$options = [] : array
Return values
Image

complexform()

public complexform( $right : Image , $options = [] : array ) : Image

Form a complex image from two real images. @throws Exception

Parameters
$right : Image
$options = [] : array
Return values
Image

complexget()

public complexget( $get : string , $options = [] : array ) : Image

Get a component from a complex image. @see OperationComplexget for possible values for $get @throws Exception

Parameters
$get : string
$options = [] : array
Return values
Image

composite()

public static composite( $in : \Jcupitt\Vips\Image[]|Image , $mode : int[]|int , $options = [] : array ) : Image

Blend an array of images with an array of blend modes. @throws Exception

Parameters
$in : \Jcupitt\Vips\Image[]|Image
$mode : int[]|int
$options = [] : array
Return values
Image

composite2()

public composite2( $overlay : Image , $mode : string , $options = [] : array ) : Image

Blend a pair of images with a blend mode. @see BlendMode for possible values for $mode @throws Exception

Parameters
$overlay : Image
$mode : string
$options = [] : array
Return values
Image

conv()

public conv( $mask : Image , $options = [] : array ) : Image

Convolution operation. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

conva()

public conva( $mask : Image , $options = [] : array ) : Image

Approximate integer convolution. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

convasep()

public convasep( $mask : Image , $options = [] : array ) : Image

Approximate separable integer convolution. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

convf()

public convf( $mask : Image , $options = [] : array ) : Image

Float convolution operation. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

convi()

public convi( $mask : Image , $options = [] : array ) : Image

Int convolution operation. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

convsep()

public convsep( $mask : Image , $options = [] : array ) : Image

Seperable convolution operation. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

copy()

public copy( $options = [] : array ) : Image

Copy an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

countlines()

public countlines( $direction : string , $options = [] : array ) : float

Count lines in an image. @see Direction for possible values for $direction @throws Exception

Parameters
$direction : string
$options = [] : array
Return values
float

crop()

public crop( $left : int , $top : int , $width : int , $height : int , $options = [] : array ) : Image

Extract an area from an image. @throws Exception

Parameters
$left : int
$top : int
$width : int
$height : int
$options = [] : array
Return values
Image

csvload()

public static csvload( $filename : string , $options = [] : array ) : Image

Load csv. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

csvload_source()

public static csvload_source( $source : string , $options = [] : array ) : Image

Load csv. @throws Exception

Parameters
$source : string
$options = [] : array
Return values
Image

csvsave()

public csvsave( $filename : string , $options = [] : array ) : void

Save image to csv. @throws Exception

Parameters
$filename : string
$options = [] : array

csvsave_target()

public csvsave_target( $target : string , $options = [] : array ) : void

Save image to csv. @throws Exception

Parameters
$target : string
$options = [] : array

dE00()

public dE00( $right : Image , $options = [] : array ) : Image

Calculate dE00. @throws Exception

Parameters
$right : Image
$options = [] : array
Return values
Image

dE76()

public dE76( $right : Image , $options = [] : array ) : Image

Calculate dE76. @throws Exception

Parameters
$right : Image
$options = [] : array
Return values
Image

dECMC()

public dECMC( $right : Image , $options = [] : array ) : Image

Calculate dECMC. @throws Exception

Parameters
$right : Image
$options = [] : array
Return values
Image

deviate()

public deviate( $options = [] : array ) : float

Find image standard deviation. @throws Exception

Parameters
$options = [] : array
Return values
float

draw_circle()

public draw_circle( $ink : float[]|float , $cx : int , $cy : int , $radius : int , $options = [] : array ) : Image

Draw a circle on an image. @throws Exception

Parameters
$ink : float[]|float
$cx : int
$cy : int
$radius : int
$options = [] : array
Return values
Image

draw_flood()

public draw_flood( $ink : float[]|float , $x : int , $y : int , $options = [] : array ) : Image

Flood-fill an area. @throws Exception

Parameters
$ink : float[]|float
$x : int
$y : int
$options = [] : array
Return values
Image

draw_image()

public draw_image( $sub : Image , $x : int , $y : int , $options = [] : array ) : Image

Paint an image into another image. @throws Exception

Parameters
$sub : Image
$x : int
$y : int
$options = [] : array
Return values
Image

draw_line()

public draw_line( $ink : float[]|float , $x1 : int , $y1 : int , $x2 : int , $y2 : int , $options = [] : array ) : Image

Draw a line on an image. @throws Exception

Parameters
$ink : float[]|float
$x1 : int
$y1 : int
$x2 : int
$y2 : int
$options = [] : array
Return values
Image

draw_mask()

public draw_mask( $ink : float[]|float , $mask : Image , $x : int , $y : int , $options = [] : array ) : Image

Draw a mask on an image. @throws Exception

Parameters
$ink : float[]|float
$mask : Image
$x : int
$y : int
$options = [] : array
Return values
Image

draw_rect()

public draw_rect( $ink : float[]|float , $left : int , $top : int , $width : int , $height : int , $options = [] : array ) : Image

Paint a rectangle on an image. @throws Exception

Parameters
$ink : float[]|float
$left : int
$top : int
$width : int
$height : int
$options = [] : array
Return values
Image

draw_smudge()

public draw_smudge( $left : int , $top : int , $width : int , $height : int , $options = [] : array ) : Image

Blur a rectangle on an image. @throws Exception

Parameters
$left : int
$top : int
$width : int
$height : int
$options = [] : array
Return values
Image

dzsave()

public dzsave( $filename : string , $options = [] : array ) : void

Save image to deepzoom file. @throws Exception

Parameters
$filename : string
$options = [] : array

dzsave_buffer()

public dzsave_buffer( $options = [] : array ) : string

Save image to dz buffer. @throws Exception

Parameters
$options = [] : array
Return values
string

embed()

public embed( $x : int , $y : int , $width : int , $height : int , $options = [] : array ) : Image

Embed an image in a larger image. @throws Exception

Parameters
$x : int
$y : int
$width : int
$height : int
$options = [] : array
Return values
Image

extract_area()

public extract_area( $left : int , $top : int , $width : int , $height : int , $options = [] : array ) : Image

Extract an area from an image. @throws Exception

Parameters
$left : int
$top : int
$width : int
$height : int
$options = [] : array
Return values
Image

extract_band()

public extract_band( $band : int , $options = [] : array ) : Image

Extract band from an image. @throws Exception

Parameters
$band : int
$options = [] : array
Return values
Image

eye()

public static eye( $width : int , $height : int , $options = [] : array ) : Image

Make an image showing the eye's spatial response. @throws Exception

Parameters
$width : int
$height : int
$options = [] : array
Return values
Image

falsecolour()

public falsecolour( $options = [] : array ) : Image

False-color an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

fastcor()

public fastcor( $ref : Image , $options = [] : array ) : Image

Fast correlation. @throws Exception

Parameters
$ref : Image
$options = [] : array
Return values
Image

fill_nearest()

public fill_nearest( $options = [] : array ) : Image

Fill image zeros with nearest non-zero pixel. @throws Exception

Parameters
$options = [] : array
Return values
Image

find_trim()

public find_trim( $options = [] : array ) : array

Search an image for non-edge areas. Return array with: [ 'left' => @type integer Left edge of image 'top' => @type integer Top edge of extract area 'width' => @type integer Width of extract area 'height' => @type integer Height of extract area ]; @throws Exception

Parameters
$options = [] : array
Return values
array

fitsload()

public static fitsload( $filename : string , $options = [] : array ) : Image

Load a FITS image. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

fitssave()

public fitssave( $filename : string , $options = [] : array ) : void

Save image to fits file. @throws Exception

Parameters
$filename : string
$options = [] : array

flatten()

public flatten( $options = [] : array ) : Image

Flatten alpha out of an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

flip()

public flip( $direction : string , $options = [] : array ) : Image

Flip an image. @see Direction for possible values for $direction @throws Exception

Parameters
$direction : string
$options = [] : array
Return values
Image

float2rad()

public float2rad( $options = [] : array ) : Image

Transform float RGB to Radiance coding. @throws Exception

Parameters
$options = [] : array
Return values
Image

fractsurf()

public static fractsurf( $width : int , $height : int , $fractal_dimension : float , $options = [] : array ) : Image

Make a fractal surface. @throws Exception

Parameters
$width : int
$height : int
$fractal_dimension : float
$options = [] : array
Return values
Image

freqmult()

public freqmult( $mask : Image , $options = [] : array ) : Image

Frequency-domain filtering. @throws Exception

Parameters
$mask : Image
$options = [] : array
Return values
Image

fwfft()

public fwfft( $options = [] : array ) : Image

Forward FFT. @throws Exception

Parameters
$options = [] : array
Return values
Image

gamma()

public gamma( $options = [] : array ) : Image

Gamma an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

gaussblur()

public gaussblur( $sigma : float , $options = [] : array ) : Image

Gaussian blur. @throws Exception

Parameters
$sigma : float
$options = [] : array
Return values
Image

gaussmat()

public static gaussmat( $sigma : float , $min_ampl : float , $options = [] : array ) : Image

Make a gaussian image. @throws Exception

Parameters
$sigma : float
$min_ampl : float
$options = [] : array
Return values
Image

gaussnoise()

public static gaussnoise( $width : int , $height : int , $options = [] : array ) : Image

Make a gaussnoise image. @throws Exception

Parameters
$width : int
$height : int
$options = [] : array
Return values
Image

getpoint()

public getpoint( $x : int , $y : int , $options = [] : array ) : array

Read a point from an image. @throws Exception

Parameters
$x : int
$y : int
$options = [] : array
Return values
array

gifload()

public static gifload( $filename : string , $options = [] : array ) : Image

Load GIF with giflib. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

gifload_buffer()

public static gifload_buffer( $buffer : string , $options = [] : array ) : Image

Load GIF with giflib. @throws Exception

Parameters
$buffer : string
$options = [] : array
Return values
Image

gifload_source()

public static gifload_source( $source : string , $options = [] : array ) : Image

Load GIF with giflib. @throws Exception

Parameters
$source : string
$options = [] : array
Return values
Image

globalbalance()

public globalbalance( $options = [] : array ) : Image

Global balance an image mosaic. @throws Exception

Parameters
$options = [] : array
Return values
Image

gravity()

public gravity( $direction : string , $width : int , $height : int , $options = [] : array ) : Image

Place an image within a larger image with a certain gravity. @see CompassDirection for possible values for $direction @throws Exception

Parameters
$direction : string
$width : int
$height : int
$options = [] : array
Return values
Image

grey()

public static grey( $width : int , $height : int , $options = [] : array ) : Image

Make a grey ramp image. @throws Exception

Parameters
$width : int
$height : int
$options = [] : array
Return values
Image

grid()

public grid( $tile_height : int , $across : int , $down : int , $options = [] : array ) : Image

Grid an image. @throws Exception

Parameters
$tile_height : int
$across : int
$down : int
$options = [] : array
Return values
Image

heifload()

public static heifload( $filename : string , $options = [] : array ) : Image

Load a HEIF image. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

heifload_buffer()

public static heifload_buffer( $buffer : string , $options = [] : array ) : Image

Load a HEIF image. @throws Exception

Parameters
$buffer : string
$options = [] : array
Return values
Image

heifload_source()

public static heifload_source( $source : string , $options = [] : array ) : Image

Load a HEIF image. @throws Exception

Parameters
$source : string
$options = [] : array
Return values
Image

heifsave()

public heifsave( $filename : string , $options = [] : array ) : void

Save image in HEIF format. @throws Exception

Parameters
$filename : string
$options = [] : array

heifsave_buffer()

public heifsave_buffer( $options = [] : array ) : string

Save image in HEIF format. @throws Exception

Parameters
$options = [] : array
Return values
string

heifsave_target()

public heifsave_target( $target : string , $options = [] : array ) : void

Save image in HEIF format. @throws Exception

Parameters
$target : string
$options = [] : array

hist_cum()

public hist_cum( $options = [] : array ) : Image

Form cumulative histogram. @throws Exception

Parameters
$options = [] : array
Return values
Image

hist_entropy()

public hist_entropy( $options = [] : array ) : float

Estimate image entropy. @throws Exception

Parameters
$options = [] : array
Return values
float

hist_equal()

public hist_equal( $options = [] : array ) : Image

Histogram equalisation. @throws Exception

Parameters
$options = [] : array
Return values
Image

hist_find()

public hist_find( $options = [] : array ) : Image

Find image histogram. @throws Exception

Parameters
$options = [] : array
Return values
Image

hist_find_indexed()

public hist_find_indexed( $index : Image , $options = [] : array ) : Image

Find indexed image histogram. @throws Exception

Parameters
$index : Image
$options = [] : array
Return values
Image

hist_find_ndim()

public hist_find_ndim( $options = [] : array ) : Image

Find n-dimensional image histogram. @throws Exception

Parameters
$options = [] : array
Return values
Image

hist_ismonotonic()

public hist_ismonotonic( $options = [] : array ) : bool

Test for monotonicity. @throws Exception

Parameters
$options = [] : array
Return values
bool

hist_local()

public hist_local( $width : int , $height : int , $options = [] : array ) : Image

Local histogram equalisation. @throws Exception

Parameters
$width : int
$height : int
$options = [] : array
Return values
Image

hist_match()

public hist_match( $ref : Image , $options = [] : array ) : Image

Match two histograms. @throws Exception

Parameters
$ref : Image
$options = [] : array
Return values
Image

hist_norm()

public hist_norm( $options = [] : array ) : Image

Normalise histogram. @throws Exception

Parameters
$options = [] : array
Return values
Image

hist_plot()

public hist_plot( $options = [] : array ) : Image

Plot histogram. @throws Exception

Parameters
$options = [] : array
Return values
Image

hough_circle()

public hough_circle( $options = [] : array ) : Image

Find hough circle transform. @throws Exception

Parameters
$options = [] : array
Return values
Image

hough_line()

public hough_line( $options = [] : array ) : Image

Find hough line transform. @throws Exception

Parameters
$options = [] : array
Return values
Image

icc_export()

public icc_export( $options = [] : array ) : Image

Output to device with ICC profile. @throws Exception

Parameters
$options = [] : array
Return values
Image

icc_import()

public icc_import( $options = [] : array ) : Image

Import from device with ICC profile. @throws Exception

Parameters
$options = [] : array
Return values
Image

icc_transform()

public icc_transform( $output_profile : string , $options = [] : array ) : Image

Transform between devices with ICC profiles. @throws Exception

Parameters
$output_profile : string
$options = [] : array
Return values
Image

identity()

public static identity( $options = [] : array ) : Image

Make a 1D image where pixel values are indexes. @throws Exception

Parameters
$options = [] : array
Return values
Image

insert()

public insert( $sub : Image , $x : int , $y : int , $options = [] : array ) : Image

Insert image @sub into @main at @x, @y. @throws Exception

Parameters
$sub : Image
$x : int
$y : int
$options = [] : array
Return values
Image

invert()

public invert( $options = [] : array ) : Image

Invert an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

invertlut()

public invertlut( $options = [] : array ) : Image

Build an inverted look-up table. @throws Exception

Parameters
$options = [] : array
Return values
Image

invfft()

public invfft( $options = [] : array ) : Image

Inverse FFT. @throws Exception

Parameters
$options = [] : array
Return values
Image

join()

public join( $in2 : Image , $direction : string , $options = [] : array ) : Image

Join a pair of images. @see Direction for possible values for $direction @throws Exception

Parameters
$in2 : Image
$direction : string
$options = [] : array
Return values
Image

jpegload()

public static jpegload( $filename : string , $options = [] : array ) : Image

Load jpeg from file. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

jpegload_buffer()

public static jpegload_buffer( $buffer : string , $options = [] : array ) : Image

Load jpeg from buffer. @throws Exception

Parameters
$buffer : string
$options = [] : array
Return values
Image

jpegload_source()

public static jpegload_source( $source : string , $options = [] : array ) : Image

Load image from jpeg source. @throws Exception

Parameters
$source : string
$options = [] : array
Return values
Image

jpegsave()

public jpegsave( $filename : string , $options = [] : array ) : void

Save image to jpeg file. @throws Exception

Parameters
$filename : string
$options = [] : array

jpegsave_buffer()

public jpegsave_buffer( $options = [] : array ) : string

Save image to jpeg buffer. @throws Exception

Parameters
$options = [] : array
Return values
string

jpegsave_mime()

public jpegsave_mime( $options = [] : array ) : void

Save image to jpeg mime. @throws Exception

Parameters
$options = [] : array

jpegsave_target()

public jpegsave_target( $target : string , $options = [] : array ) : void

Save image to jpeg target. @throws Exception

Parameters
$target : string
$options = [] : array

labelregions()

public labelregions( $options = [] : array ) : Image

Label regions in an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

linear()

public linear( $a : float[]|float , $b : float[]|float , $options = [] : array ) : Image

Calculate (a * in + b). @throws Exception

Parameters
$a : float[]|float
$b : float[]|float
$options = [] : array
Return values
Image

linecache()

public linecache( $options = [] : array ) : Image

Cache an image as a set of lines. @throws Exception

Parameters
$options = [] : array
Return values
Image

logmat()

public static logmat( $sigma : float , $min_ampl : float , $options = [] : array ) : Image

Make a laplacian of gaussian image. @throws Exception

Parameters
$sigma : float
$min_ampl : float
$options = [] : array
Return values
Image

magickload()

public static magickload( $filename : string , $options = [] : array ) : Image

Load file with ImageMagick. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

magickload_buffer()

public static magickload_buffer( $buffer : string , $options = [] : array ) : Image

Load buffer with ImageMagick. @throws Exception

Parameters
$buffer : string
$options = [] : array
Return values
Image

magicksave()

public magicksave( $filename : string , $options = [] : array ) : void

Save file with ImageMagick. @throws Exception

Parameters
$filename : string
$options = [] : array

magicksave_buffer()

public magicksave_buffer( $options = [] : array ) : string

Save image to magick buffer. @throws Exception

Parameters
$options = [] : array
Return values
string

mapim()

public mapim( $index : Image , $options = [] : array ) : Image

Resample with a map image. @throws Exception

Parameters
$index : Image
$options = [] : array
Return values
Image

maplut()

public maplut( $lut : Image , $options = [] : array ) : Image

Map an image though a lut. @throws Exception

Parameters
$lut : Image
$options = [] : array
Return values
Image

mask_butterworth()

public static mask_butterworth( $width : int , $height : int , $order : float , $frequency_cutoff : float , $amplitude_cutoff : float , $options = [] : array ) : Image

Make a butterworth filter. @throws Exception

Parameters
$width : int
$height : int
$order : float
$frequency_cutoff : float
$amplitude_cutoff : float
$options = [] : array
Return values
Image

mask_butterworth_band()

public static mask_butterworth_band( $width : int , $height : int , $order : float , $frequency_cutoff_x : float , $frequency_cutoff_y : float , $radius : float , $amplitude_cutoff : float , $options = [] : array ) : Image

Make a butterworth_band filter. @throws Exception

Parameters
$width : int
$height : int
$order : float
$frequency_cutoff_x : float
$frequency_cutoff_y : float
$radius : float
$amplitude_cutoff : float
$options = [] : array
Return values
Image

mask_butterworth_ring()

public static mask_butterworth_ring( $width : int , $height : int , $order : float , $frequency_cutoff : float , $amplitude_cutoff : float , $ringwidth : float , $options = [] : array ) : Image

Make a butterworth ring filter. @throws Exception

Parameters
$width : int
$height : int
$order : float
$frequency_cutoff : float
$amplitude_cutoff : float
$ringwidth : float
$options = [] : array
Return values
Image

mask_fractal()

public static mask_fractal( $width : int , $height : int , $fractal_dimension : float , $options = [] : array ) : Image

Make fractal filter. @throws Exception

Parameters
$width : int
$height : int
$fractal_dimension : float
$options = [] : array
Return values
Image

mask_gaussian()

public static mask_gaussian( $width : int , $height : int , $frequency_cutoff : float , $amplitude_cutoff : float , $options = [] : array ) : Image

Make a gaussian filter. @throws Exception

Parameters
$width : int
$height : int
$frequency_cutoff : float
$amplitude_cutoff : float
$options = [] : array
Return values
Image

mask_gaussian_band()

public static mask_gaussian_band( $width : int , $height : int , $frequency_cutoff_x : float , $frequency_cutoff_y : float , $radius : float , $amplitude_cutoff : float , $options = [] : array ) : Image

Make a gaussian filter. @throws Exception

Parameters
$width : int
$height : int
$frequency_cutoff_x : float
$frequency_cutoff_y : float
$radius : float
$amplitude_cutoff : float
$options = [] : array
Return values
Image

mask_gaussian_ring()

public static mask_gaussian_ring( $width : int , $height : int , $frequency_cutoff : float , $amplitude_cutoff : float , $ringwidth : float , $options = [] : array ) : Image

Make a gaussian ring filter. @throws Exception

Parameters
$width : int
$height : int
$frequency_cutoff : float
$amplitude_cutoff : float
$ringwidth : float
$options = [] : array
Return values
Image

mask_ideal()

public static mask_ideal( $width : int , $height : int , $frequency_cutoff : float , $options = [] : array ) : Image

Make an ideal filter. @throws Exception

Parameters
$width : int
$height : int
$frequency_cutoff : float
$options = [] : array
Return values
Image

mask_ideal_band()

public static mask_ideal_band( $width : int , $height : int , $frequency_cutoff_x : float , $frequency_cutoff_y : float , $radius : float , $options = [] : array ) : Image

Make an ideal band filter. @throws Exception

Parameters
$width : int
$height : int
$frequency_cutoff_x : float
$frequency_cutoff_y : float
$radius : float
$options = [] : array
Return values
Image

mask_ideal_ring()

public static mask_ideal_ring( $width : int , $height : int , $frequency_cutoff : float , $ringwidth : float , $options = [] : array ) : Image

Make an ideal ring filter. @throws Exception

Parameters
$width : int
$height : int
$frequency_cutoff : float
$ringwidth : float
$options = [] : array
Return values
Image

match()

public match( $sec : Image , $xr1 : int , $yr1 : int , $xs1 : int , $ys1 : int , $xr2 : int , $yr2 : int , $xs2 : int , $ys2 : int , $options = [] : array ) : Image

First-order match of two images. @throws Exception

Parameters
$sec : Image
$xr1 : int
$yr1 : int
$xs1 : int
$ys1 : int
$xr2 : int
$yr2 : int
$xs2 : int
$ys2 : int
$options = [] : array
Return values
Image

math()

public math( $math : string , $options = [] : array ) : Image

Apply a math operation to an image. @see OperationMath for possible values for $math @throws Exception

Parameters
$math : string
$options = [] : array
Return values
Image

math2()

public math2( $right : Image , $math2 : string , $options = [] : array ) : Image

Binary math operations. @see OperationMath2 for possible values for $math2 @throws Exception

Parameters
$right : Image
$math2 : string
$options = [] : array
Return values
Image

math2_const()

public math2_const( $math2 : string , $c : float[]|float , $options = [] : array ) : Image

Binary math operations with a constant. @see OperationMath2 for possible values for $math2 @throws Exception

Parameters
$math2 : string
$c : float[]|float
$options = [] : array
Return values
Image

matload()

public static matload( $filename : string , $options = [] : array ) : Image

Load mat from file. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

matrixinvert()

public matrixinvert( $options = [] : array ) : Image

Invert an matrix. @throws Exception

Parameters
$options = [] : array
Return values
Image

matrixload()

public static matrixload( $filename : string , $options = [] : array ) : Image

Load matrix. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

matrixload_source()

public static matrixload_source( $source : string , $options = [] : array ) : Image

Load matrix. @throws Exception

Parameters
$source : string
$options = [] : array
Return values
Image

matrixprint()

public matrixprint( $options = [] : array ) : void

Print matrix. @throws Exception

Parameters
$options = [] : array

matrixsave()

public matrixsave( $filename : string , $options = [] : array ) : void

Save image to matrix. @throws Exception

Parameters
$filename : string
$options = [] : array

matrixsave_target()

public matrixsave_target( $target : string , $options = [] : array ) : void

Save image to matrix. @throws Exception

Parameters
$target : string
$options = [] : array

max()

public max( $options = [] : array ) : float

Find image maximum. @throws Exception

Parameters
$options = [] : array
Return values
float

measure()

public measure( $h : int , $v : int , $options = [] : array ) : Image

Measure a set of patches on a color chart. @throws Exception

Parameters
$h : int
$v : int
$options = [] : array
Return values
Image

merge()

public merge( $sec : Image , $direction : string , $dx : int , $dy : int , $options = [] : array ) : Image

Merge two images. @see Direction for possible values for $direction @throws Exception

Parameters
$sec : Image
$direction : string
$dx : int
$dy : int
$options = [] : array
Return values
Image

min()

public min( $options = [] : array ) : float

Find image minimum. @throws Exception

Parameters
$options = [] : array
Return values
float

morph()

public morph( $mask : Image , $morph : string , $options = [] : array ) : Image

Morphology operation. @see OperationMorphology for possible values for $morph @throws Exception

Parameters
$mask : Image
$morph : string
$options = [] : array
Return values
Image

mosaic()

public mosaic( $sec : Image , $direction : string , $xref : int , $yref : int , $xsec : int , $ysec : int , $options = [] : array ) : Image

Mosaic two images. @see Direction for possible values for $direction @throws Exception

Parameters
$sec : Image
$direction : string
$xref : int
$yref : int
$xsec : int
$ysec : int
$options = [] : array
Return values
Image

mosaic1()

public mosaic1( $sec : Image , $direction : string , $xr1 : int , $yr1 : int , $xs1 : int , $ys1 : int , $xr2 : int , $yr2 : int , $xs2 : int , $ys2 : int , $options = [] : array ) : Image

First-order mosaic of two images. @see Direction for possible values for $direction @throws Exception

Parameters
$sec : Image
$direction : string
$xr1 : int
$yr1 : int
$xs1 : int
$ys1 : int
$xr2 : int
$yr2 : int
$xs2 : int
$ys2 : int
$options = [] : array
Return values
Image

msb()

public msb( $options = [] : array ) : Image

Pick most-significant byte from an image. @throws Exception

Parameters
$options = [] : array
Return values
Image

niftiload()

public static niftiload( $filename : string , $options = [] : array ) : Image

Load a NIFTI image. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

niftisave()

public niftisave( $filename : string , $options = [] : array ) : void

Save image to nifti file. @throws Exception

Parameters
$filename : string
$options = [] : array

openexrload()

public static openexrload( $filename : string , $options = [] : array ) : Image

Load an OpenEXR image. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

openslideload()

public static openslideload( $filename : string , $options = [] : array ) : Image

Load file with OpenSlide. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

pdfload()

public static pdfload( $filename : string , $options = [] : array ) : Image

Load PDF from file. @throws Exception

Parameters
$filename : string
$options = [] : array
Return values
Image

pdfload_buffer()

public static pdfload_buffer( $buffer : string , $options = [] : array ) : Image

Load PDF from buffer. @throws Exception

Parameters
$buffer : string
$options = [] : array
Return values
Image

pdfload_source()

public static pdfload_source( $source : string , $options = [] : array ) : Image

Load PDF from source. @throws Exception

Parameters
$source : string
$options = [] : array
Return values
Image

percent()

public percent( $percent : float , $options = [] : array ) : int

Find threshold for percent of pixels. @throws Exception

Parameters
$percent : float
$options = [] : array
Return values
int

perlin()

public static perlin( $width : int , $height : int , $options = [] : array ) : Image

Make a perlin noise image. @throws Exception

Parameters
$width : int
$height : int
$options = [] : array
Return values
Image

phasecor()

public phasecor( $in2 : Image , $options = [] : array ) : Image

Calculate phase correlation. @throws Exception

Parameters
$in2 : Image
$options = [] : array
Return values
Image