class Vips.Image : Vips.Object
{
/* No available fields */
}
The VipsImage
class and associated types and macros.
Images can be created from formatted files on disc, from C-style arrays on disc, from formatted areas of memory, or from C-style arrays in memory. See vips_image_new_from_file()
and friends. Creating an image is fast. libvips reads just enough of the image to be able to get the various properties, such as width in pixels. It delays reading any pixels until they are really needed.
Once you have an image, you can get properties from it in the usual way. You can use projection functions, like vips_image_get_width()
or g_object_get(), to get GObject properties.
.v
images are three-dimensional arrays, the dimensions being width, height and bands. Each dimension can be up to 2 ** 31 pixels (or band elements). An image has a format, meaning the machine number type used to represent each value. libvips supports 10 formats, from 8-bit unsigned integer up to 128-bit double complex, see vips_image_get_format()
.
In libvips, images are uninterpreted arrays, meaning that from the point of view of most operations, they are just large collections of numbers. There’s no difference between an RGBA (RGB with alpha) image and a CMYK image, for example, they are both just four-band images. It’s up to the user of the library to pass the right sort of image to each operation.
To take an example, libvips has vips_Lab2XYZ()
, an operation to transform an image from CIE LAB colour space to CIE XYZ space. It assumes the first three bands represent pixels in LAB colour space and returns an image where the first three bands are transformed to XYZ and any remaining bands are just copied. Pass it an RGB image by mistake and you’ll just get nonsense.
libvips has a feature to help (a little) with this: it sets a VipsInterpretation
hint for each image (see vips_image_get_interpretation()
); a hint which says how pixels should be interpreted. For example, vips_Lab2XYZ()
will set the interpretation of the output image to VIPS_INTERPRETATION_XYZ
. A few utility operations will also use interpretation as a guide. For example, you can give vips_colourspace()
an input image and a desired colourspace and it will use the input’s interpretation hint to apply the best sequence of colourspace transforms to get to the desired space.
Use things like vips_invert()
to manipulate your images. When you are done, you can write images to disc files (with vips_image_write_to_file()
), to formatted memory buffers (with vips_image_write_to_buffer()
) and to C-style memory arrays (with vips_image_write_to_memory()
).
You can also write images to other images. Create, for example, a temporary disc image with vips_image_new_temp_file()
, then write your image to that with vips_image_write()
. You can create several other types of image and write to them, see vips_image_new_memory()
, for example.
See VipsOperation
for an introduction to running operations on images, see Image headers for getting and setting image metadata. See VipsObject
for a discussion of the lower levels.
A renamed vips_image_new_memory()
… Some gobject binding systems do not like more than one _new()
method.
vips_image_new()
creates a new, empty VipsImage
. If you write to one of these images, vips will just attach some callbacks, no pixels will be generated.
Loads an image from the formatted area of memory buf
, len
using the loader recommended by vips_foreign_find_load_buffer()
. To load an unformatted area of memory, use vips_image_new_from_memory()
.
vips_image_new_from_file()
opens name
for reading. It can load files in many image formats, including VIPS, TIFF, PNG, JPEG, FITS, Matlab, OpenEXR, CSV, WebP, Radiance, RAW, PPM and others.
Opens the named file for simultaneous reading and writing. This will only work for VIPS files in a format native to your machine. It is only for paintbox-type applications.
vips_image_new_from_imageCreates a new image with width, height, format, interpretation, resolution and offset taken from image
, but with number of bands taken from n
and the value of each band element set from c
.
Creates a new image with width, height, format, interpretation, resolution and offset taken from image
, but with one band and each pixel having the value c
.
This function wraps a VipsImage
around a memory area. The memory area must be a simple array, for example RGBRGBRGB, left-to-right, top-to-bottom. Use vips_image_new_from_buffer()
to load an area of memory containing an image in a format.
Like vips_image_new_from_memory()
, but VIPS will make a copy of the memory area. This means more memory use and an extra copy operation, but is much simpler and safer.
This convenience function makes an image which is a matrix: a one-band VIPS_FORMAT_DOUBLE
image held in memory.
As vips_image_new_matrix()
, but initialise the matrix from the argument list. After height
should be width
* height
double constants which are used to set the matrix elements.
vips_image_new_memory()
creates a new VipsImage
which, when written to, will create a memory image.
Make a VipsImage
which, when written to, will create a temporary file on disc. The file will be automatically deleted when the image is destroyed. format
is something like “%s.v” for a vips file.
Load an Analyze 6.0 file. If filename
is “fred.img”, this will look for an image header called “fred.hdr” and pixel data in “fred.img”. You can also load “fred” or “fred.hdr”.
Make a black unsigned char image of a specified size.
vips_eyeCreate a test pattern with increasing spatial frequency in X and amplitude in Y.
vips_fractsurfGenerate an image of size width
by height
and fractal dimension fractal_dimension
. The dimension should be between 2 and 3.
Creates a circularly symmetric Gaussian image of radius sigma
.
Make a one band float image of gaussian noise with the specified distribution.
vips_greyCreate a one-band float image with the left-most column zero and the right-most 1.
vips_heifload_bufferRead a HEIF image file into a VIPS image. Exactly as vips_heifload()
, but read from a memory buffer.
Creates an identity lookup table, ie. one which will leave an image unchanged when applied with vips_maplut()
. Each entry in the table has a value equal to its position.
Read a JPEG file into a VIPS image. It can read most 8-bit JPEG images, including CMYK and YCbCr.
vips_jpegload_bufferRead a JPEG-formatted memory block into a VIPS image. Exactly as vips_jpegload()
, but read from a memory buffer.
Read a JPEG-formatted memory block into a VIPS image. Exactly as vips_jpegload()
, but read from a source.
Create a circularly symmetric Laplacian of Gaussian mask of radius sigma
.
Read an image memory block using libMagick into a VIPS image. Exactly as vips_magickload()
, but read from a memory source.
Make an butterworth high- or low-pass filter, that is, one with a variable, smooth transition positioned at frequency_cutoff
, where frequency_cutoff
is in range 0 - 1.
Make an butterworth band-pass or band-reject filter, that is, one with a variable, smooth transition positioned at frequency_cutoff_x
, frequency_cutoff_y
, of radius radius
.
Make a butterworth ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at frequency_cutoff
of width width
, where frequency_cutoff
is in the range 0 - 1.
This operation should be used to create fractal images by filtering the power spectrum of Gaussian white noise.
vips_mask_gaussianMake a gaussian high- or low-pass filter, that is, one with a variable, smooth transition positioned at frequency_cutoff
.
Make a gaussian band-pass or band-reject filter, that is, one with a variable, smooth transition positioned at frequency_cutoff_x
, frequency_cutoff_y
, of radius radius
.
Make a gaussian ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at frequency_cutoff
of width ringwidth
.
Make an ideal high- or low-pass filter, that is, one with a sharp cutoff positioned at frequency_cutoff
, where frequency_cutoff
is in the range 0 - 1.
Make an ideal band-pass or band-reject filter, that is, one with a sharp cutoff around the point frequency_cutoff_x
, frequency_cutoff_y
, of size radius
.
Make an ideal ring-pass or ring-reject filter, that is, one with a sharp ring positioned at frequency_cutoff
of width width
, where frequency_cutoff
and width
are expressed as the range 0 - 1.
Read a virtual slide supported by the OpenSlide library into a VIPS image. OpenSlide supports images in Aperio, Hamamatsu, MIRAX, Sakura, Trestle, and Ventana formats.
vips_pdfload_bufferRead a PDF-formatted memory buffer into a VIPS image. Exactly as vips_pdfload()
, but read from memory.
Read a PNG file into a VIPS image. It can read all png images, including 8- and 16-bit images, 1 and 3 channel, with and without an alpha channel.
vips_rawloadThis operation mmaps the file, setting up out
so that access to that image will read from the file.
Create a signed distance field (SDF) image of the given shape
.
Creates a float one band image of the a sine waveform in two dimensions.
vips_svgload_bufferRead a SVG-formatted memory block into a VIPS image. Exactly as vips_svgload()
, but read from a memory buffer.
Exactly as vips_svgload()
, but read from a string. This function takes a copy of the string.
vips_system()
runs a command, optionally passing a set of images in and optionally getting an image back. The command’s stdout is returned in log
.
Read a TIFF-formatted memory block into a VIPS image. Exactly as vips_tiffload()
, but read from a memory source.
vips_tonelut()
generates a tone curve for the adjustment of image levels.
Read a WebP-formatted memory block into a VIPS image. Exactly as vips_webpload()
, but read from a memory buffer.
Create a two-band uint32 image where the elements in the first band have the value of their x coordinate and elements in the second band have their y coordinate.
vips_zoneCreate a one-band image of a zone plate.
Functions vips_image_pipeline_arrayAdd an image to a pipeline. image
depends on all of the images in in
, image
prefers to supply pixels according to hint
.
Lay out the images in in
in a grid. The grid is across
images across and however high is necessary to use up all of in
. Images are set down left-to-right and top-to-bottom. across
defaults to n
.
Sorts the images in
band-element-wise, then outputs an image in which each band element is selected from the sorted list by the index
parameter. For example, if index
is zero, then each output band element will be the minimum of all the corresponding input band elements.
This operation sums all images in in
and writes the result to out
.
The tests
images are evaluated and at each point the index of the first non-zero value is written to out
. If all tests
are false, the value (n
+ 1) is written.
Turn CMYK to XYZ. If the image has an embedded ICC profile this will be used for the conversion. If there is no embedded profile, a generic fallback profile will be used.
vips_Lab2LabQConvert a Lab three-band float image to LabQ (VIPS_CODING_LABQ
).
Turn Lab to XYZ. The colour temperature defaults to D65, but can be specified with temp
.
Unpack a LabQ (VIPS_CODING_LABQ
) image to a three-band float image.
Unpack a LabQ (VIPS_CODING_LABQ
) image to a three-band short image.
Unpack a LabQ (VIPS_CODING_LABQ
) image to a three-band short image.
Convert a LabS three-band signed short image to a three-band float image.
vips_XYZ2LabTurn XYZ to Lab, optionally specifying the colour temperature. temp
defaults to D65.
This operation finds the absolute value of an image. It does a copy for unsigned integer types, negate for negative values in signed integer types, fabs()
for float types, and calculates modulus for complex types.
Perform VIPS_OPERATION_MATH_ACOS
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_ACOSH
on an image. See vips_math()
.
This operation calculates in1
+ in2
and writes the result to out
.
This operator performs an affine transform on an image using interpolate
.
Perform VIPS_OPERATION_BOOLEAN_AND
on a pair of images. See vips_boolean()
.
Perform VIPS_OPERATION_BOOLEAN_AND
on an image and an array of constants. See vips_boolean_const()
.
Perform VIPS_OPERATION_BOOLEAN_AND
on an image and a constant. See vips_boolean_const1()
.
Perform VIPS_OPERATION_MATH_ASIN
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_ASINH
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_ATAN
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH2_ATAN2
on a pair of images. See vips_math2()
.
Perform VIPS_OPERATION_MATH2_ATAN2
on an image and a constant. See vips_math2_const()
.
Perform VIPS_OPERATION_MATH2_ATAN2
on an image and a constant. See vips_math2_const()
.
Perform VIPS_OPERATION_MATH_ATANH
on an image. See vips_math()
.
Look at the image metadata and rotate and flip the image to make it upright. The VIPS_META_ORIENTATION
tag is removed from out
to prevent accidental double rotation.
Remove the orientation tag on image
. Also remove any exif orientation tags. You must vips_copy()
the image before calling this function since it modifies metadata.
This operation finds the average value in an image. It operates on all bands of the input image: use vips_stats()
if you need to calculate an average for each band. For complex images, return the average modulus.
Perform VIPS_OPERATION_BOOLEAN_AND
on an image. See vips_bandbool()
.
Perform various boolean operations across the bands of an image. For example, a three-band uchar image operated on with VIPS_OPERATION_BOOLEAN_AND
will produce a one-band uchar image where each pixel is the bitwise and of the band elements of the corresponding pixel in the input image.
Perform VIPS_OPERATION_BOOLEAN_EOR
on an image. See vips_bandbool()
.
Fold up an image horizontally: width is collapsed into bands. Use factor
to set how much to fold by: factor
3, for example, will make the output image three times narrower than the input, and with three times as many bands. By default the whole of the input width is folded up.
Join a pair of images together, bandwise. See vips_bandjoin()
.
This operation writes a one-band image where each pixel is the average of the bands for that pixel in the input image. The output band format is the same as the input band format. Integer types use round-to-nearest averaging.
vips_bandorPerform VIPS_OPERATION_BOOLEAN_OR
on an image. See vips_bandbool()
.
Unfold image bands into x axis. Use factor
to set how much to unfold by: factor
3, for example, will make the output image three times wider than the input, and with one third as many bands. By default, all bands are unfolded.
Perform various boolean operations on pairs of images.
vips_boolean_constPerform various boolean operations on an image against an array of constants.
vips_boolean_const1Perform various boolean operations on an image with a single constant. See vips_boolean_const()
.
This operation builds a lookup table from a set of points. Intermediate values are generated by piecewise linear interpolation. The lookup table is always of type VIPS_FORMAT_DOUBLE
, use vips_cast()
to change it to the type you need.
Find edges by Canny’s method: The maximum of the derivative of the gradient in the direction of the gradient. Output is float, except for uchar input, where output is uchar, and double input, where output is double. Non-complex images only.
vips_caseUse values in index
to select pixels from cases
.
Convert in
to format
. You can convert between any pair of formats. Floats are truncated (not rounded). Out of range values are clipped.
Round to an integral value with VIPS_OPERATION_ROUND_CEIL
. See vips_round()
.
This operation clamps pixel values to a range, by default 0 - 1.
vips_colourspaceThis operation looks at the interpretation field of in
(or uses source_space
, if set) and runs a set of colourspace conversion functions to move it to space
.
This convolves in
with mask
times
times, rotating mask
by angle
each time. By default, it comvolves twice, rotating by 90 degrees, taking the maximum result.
Perform various binary operations on complex images.
vips_complexformCompose two real images to make a complex image. If either left
or right
are VIPS_FORMAT_DOUBLE
, out
is VIPS_FORMAT_DPCOMPLEX
. Otherwise out
is VIPS_FORMAT_COMPLEX
. left
becomes the real component of out
and right
the imaginary.
Composite overlay
on top of base
with mode
. See vips_composite()
.
Perform VIPS_OPERATION_COMPLEX_CONJ
on an image. See vips_complex()
.
Perform a convolution of in
with mask
.
Perform an approximate integer convolution of in
with mask
. This is a low-level operation, see vips_conv()
for something more convenient.
Approximate separable integer convolution. This is a low-level operation, see vips_convsep()
for something more convenient.
Convolution. This is a low-level operation, see vips_conv()
for something more convenient.
Integer convolution. This is a low-level operation, see vips_conv()
for something more convenient.
Perform a separable convolution of in
with mask
. See vips_conv()
for a detailed description.
Copy an image, optionally modifying the header. VIPS copies images by copying pointers, so this operation is instant, even for very large images.
vips_copy_fileA simple convenience function to copy an image to a file, then copy again to output. If the image is already a file, just copy straight through.
vips_image_copy_memoryThis function allocates memory, renders image
into it, builds a new image around the memory area, and returns that.
Perform VIPS_OPERATION_MATH_COS
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_COSH
on an image. See vips_math()
.
Function which calculates the number of transitions between black and white for the horizontal or the vertical direction of an image. black<128 , white>=128 The function calculates the number of transitions for all Xsize or Ysize and returns the mean of the result Input should be one band, 8-bit.
vips_cross_phasePerform VIPS_OPERATION_COMPLEX2_CROSS_PHASE
on an image. See vips_complex2()
.
Writes the pixels in in
to the filename
as CSV (comma-separated values).
Calculate dE CMC. The input images are transformed to CMC colour space and the euclidean distance between corresponding pixels calculated.
vips_image_decodeA convenience function to unpack to a format that we can compute with. out
.coding is always VIPS_CODING_NONE
.
We often need to know what an image will decode to without actually decoding it, for example, in arg checking.
vips_deviateThis operation finds the standard deviation of all pixels in in
. It operates on all bands of the input image: use vips_stats()
if you need to calculate an average for each band.
This operation calculates in1
/ in2
and writes the result to out
. If any pixels in in2
are zero, the corresponding pixel in out
is also zero.
As vips_draw_line()
, but just take a single double for ink
.
Draw mask
on the image. mask
is a monochrome 8-bit image with 0/255 for transparent or ink
coloured points. Intermediate values blend the ink with the pixel. Use with vips_text()
to draw text on an image. Use in a vips_draw_line()
subclass to draw an object along a line.
As vips_draw_mask()
, but just takes a single double for ink
.
Paint pixels within left
, top
, width
, height
in image
with ink
.
As vips_draw_rect()
, but just take a single double for ink
.
Smudge a section of image
. Each pixel in the area left
, top
, width
, height
is replaced by the average of the surrounding 3x3 pixels.
Save an image as a set of tiles at various resolutions. By default dzsave uses DeepZoom layout — use layout
to pick other conventions.
The opposite of vips_extract_area()
: embed in
within an image of size width
by height
at position x
, y
.
A convenience function to pack to a coding. The inverse of vips_image_decode()
.
Perform VIPS_OPERATION_BOOLEAN_EOR
on a pair of images. See vips_boolean()
.
Perform VIPS_OPERATION_BOOLEAN_EOR
on an image and an array of constants. See vips_boolean_const()
.
Perform VIPS_OPERATION_BOOLEAN_EOR
on an image and a constant. See vips_boolean_const1()
.
Perform VIPS_OPERATION_RELATIONAL_EQUAL
on a pair of images. See vips_relational()
.
Perform VIPS_OPERATION_RELATIONAL_EQUAL
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_EQUAL
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_MATH_EXP
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_EXP10
on an image. See vips_math()
.
Extract a band or bands from an image. Extracting out of range is an error.
vips_falsecolourForce in
to 1 band, 8-bit, then transform to a 3-band 8-bit image with a false colour map. The map is supposed to make small differences in brightness more obvious.
Fill outwards from every non-zero pixel in in
, setting pixels in distance
and value
.
Search in
for the bounding box of the non-background area.
Take the last band of in
as an alpha and use it to blend the remaining channels with background
.
Flips an image left-right or up-down.
vips_float2radConvert a three-band float image to Radiance 32-bit packed format.
vips_floorRound to an integral value with VIPS_OPERATION_ROUND_FLOOR
. See vips_round()
.
Loaders can call this on the image they are making if they see a read error from the load library. It signals “invalidate” on the load operation and will cause it to be dropped from cache.
vips_image_free_bufferFree the externally allocated buffer found in the input image. This function is intended to be used with g_signal_connect.
vips_gammaCalculate in
** (1 / exponent
), normalising to the maximum range of the input type. For float types use 1.0 as the maximum.
This operator runs vips_gaussmat()
and vips_convsep()
for you on an image.
Fill value_copy
with a copy of the header field. value_copy
must be zeroed but uninitialised.
Gets data
from image
under the name name
. A convenience function over vips_image_get()
. Use vips_image_get_typeof()
to test for the existence of a piece of metadata.
Returns name
from image
in out
. This function will read any field, returning it as a printable string. You need to free the string with g_free()
when you are done with it.
Gets data
from image
under the name name
, optionally returns its length in length
. Use vips_image_get_typeof()
to test for the existence of a piece of metadata.
Return a pointer to the image’s pixel data, if possible. This can involve allocating large amounts of memory and performing a long computation. Image pixels are laid out in band-packed rows.
vips_image_get_doubleGets out
from im
under the name name
. The value will be transformed into a double, if possible.
Get a NULL
-terminated array listing all the metadata field names on image
. Free the return result with g_strfreev()
.
This function reads the image history as a C string. The string is owned by VIPS and must not be freed.
vips_image_get_imageGets out
from im
under the name name
. The field must be of type VIPS_TYPE_IMAGE
. You must unref out
with g_object_unref()
.
Gets out
from im
under the name name
. The value will be transformed into an int, if possible.
Return the VipsInterpretation
set in the image header. Use vips_image_guess_format()
if you want a sanity-checked value.
Image modes are things like "t"
, meaning a memory buffer, and "p"
meaning a delayed computation.
Fetch and sanity-check VIPS_META_ORIENTATION
. Default to 1 (no rotate, no flip) if not present or crazy.
Multi-page images can have a page height. Fetch it, and sanity check it. If page-height is not set, it defaults to the image height.
vips_image_get_stringGets out
from im
under the name name
. The field must be of type G_TYPE_STRING
or VIPS_TYPE_REF_STRING
.
Pick a tile size and a buffer height for this image and the current value of vips_concurrency_get()
. The buffer height will always be a multiple of tile_height.
vips_globalbalance()
can be used to remove contrast differences in an assembled mosaic.
The opposite of vips_extract_area()
: place in
within an image of size width
by height
at a certain gravity.
Chop a tall thin image up into a set of tiles, lay the tiles out in a grid.
vips_image_guess_formatReturn the VipsBandFormat
for an image, guessing a sane value if the set value looks crazy.
Look at an image’s interpretation and see if it has extra alpha bands. For example, a 4-band VIPS_INTERPRETATION_sRGB
would, but a six-band VIPS_INTERPRETATION_MULTIBAND
would not.
Estimate image entropy from a histogram. Entropy is calculated as:.
vips_hist_findFind the histogram of in
. Find the histogram for band band
(producing a one-band histogram), or for all bands (producing an n-band histogram) if band
is -1.
Make a histogram of in
, but use image index
to pick the bins. In other words, element zero in out
contains the combination of all the pixels in in
whose corresponding pixel in index
is zero.
Make a one, two or three dimensional histogram of a 1, 2 or 3 band image. Divide each axis into bins
bins .. ie. output is 1 x bins, bins x bins, or bins x bins x bins bands. bins
defaults to 10.
Performs local histogram equalisation on in
using a window of size width
by height
centered on the input pixel.
Adjust in
to match ref
. If in
and ref
are normalised cumulative histograms, out
will be a LUT that adjusts the PDF of the image from which in
was made to match the PDF of ref
‘s image.
Normalise histogram. The maximum of each band becomes equal to the maximum index, so for example the max for a uchar image becomes 255. Normalise each band separately.
vips_hist_plotPlot a 1 by any or any by 1 image file as a max by any or any by max image using these rules:.
vips_image_history_argsFormats the name/argv as a single string and calls vips_image_history_printf()
. A convenience function for command-line programs.
Add a line to the image history. The format
and arguments are expanded, the date and time is appended prefixed with a hash character, and the whole string is appended to the image history and terminated with a newline.
Find the circular Hough transform of an image. in
must be one band, with non-zero pixels for image edges. out
is three-band, with the third channel representing the detected circle radius. The operation scales the number of votes by circle circumference so circles of differing size are given equal weight.
Find the line Hough transform for in
. in
must have one band. out
has one band, with pixels being the number of votes for that line. The X dimension of out
is the line angle in 0 - 180 degrees, the Y dimension is the distance of the closest part of that line to the origin in the top-left.
Transform an image from absolute to relative colorimetry using the MediaWhitePoint stored in the ICC profile.
vips_icc_exportExport an image from D65 LAB to device space with an ICC profile.
vips_icc_importImport an image from device space to D65 LAB with an ICC profile.
vips_ifthenelseThis operation scans the condition image cond
and uses it to select pixels from either the then image in1
or the else image in2
. Non-zero means in1
, 0 means in2
.
Perform VIPS_OPERATION_COMPLEXGET_IMAG
on an image. See vips_complexget()
.
A convenience function to set the header fields after creating an image. Normally you copy the fields from your input images with [method.Image.pipelinev] and then make any adjustments you need, but if you are creating an image from scratch, for example vips_black()
or vips_jpegload()
, you do need to set all the fields yourself.
Gets image
ready for an in-place operation, such as vips_draw_circle()
. After calling this function you can both read and write the image with VIPS_IMAGE_ADDR()
.
Invalidate all pixel caches on image
and any downstream images, that is, images which depend on this image. Additionally, all operations which depend upon this image are dropped from the VIPS operation cache.
For unsigned formats, this operation calculates (max - in
), eg. (255 - in
) for uchar. For signed and float formats, this operation calculates (-1 in
).
Given a mask of target values and real values, generate a LUT which will map reals to targets.
vips_invfftTransform an image from Fourier space to real space.
vips_image_isMSBfirstReturn TRUE
if image
is in most-significant- byte first form. This is the byte order used on the SPARC architecture and others.
TRUE
if any of the images upstream from image
were opened in sequential mode. Some operations change behaviour slightly in sequential mode to optimize memory behaviour.
If image
has been killed (see vips_image_set_kill()
), set an error message, clear the VipsImage
.kill flag and return TRUE
. Otherwise return FALSE
.
Join in1
and in2
together, left-right or up-down depending on the value of direction
.
Write a VIPS image to a file in JPEG-XL format.
vips_lessPerform VIPS_OPERATION_RELATIONAL_LESS
on a pair of images. See vips_relational()
.
Perform VIPS_OPERATION_RELATIONAL_LESS
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_LESS
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_LESSEQ
on a pair of images. See vips_relational()
.
Perform VIPS_OPERATION_RELATIONAL_LESSEQ
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_LESSEQ
on an image and a constant. See vips_relational_const()
.
Pass an image through a linear transform, ie. (out
= in
* a
+ b
). Output is float for integer input, double for double input, complex for complex input and double complex for double complex input. Set uchar
to output uchar pixels.
This operation behaves rather like vips_copy()
between images in
and out
, except that it keeps a cache of computed scanlines.
Perform VIPS_OPERATION_MATH_LOG
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_LOG10
on an image. See vips_math()
.
Perform VIPS_OPERATION_BOOLEAN_LSHIFT
on a pair of images. See vips_boolean()
.
Perform VIPS_OPERATION_BOOLEAN_LSHIFT
on an image and an array of constants. See vips_boolean_const()
.
Perform VIPS_OPERATION_BOOLEAN_LSHIFT
on an image and a constant. See vips_boolean_const1()
.
This function calls fn
for every header field, including every item of metadata.
This operator resamples in
using index
to look up pixels.
Map an image through another image acting as a LUT (Look Up Table). The lut may have any type and the output image will be that type.
vips_matchScale, rotate and translate sec
so that the tie-points line up.
Perform various functions in -lm, the maths library, on images.
vips_math2This operation calculates a 2-ary maths operation on a pair of images and writes the result to out
. The images may have any non-complex format. out
is float except in the case that either of left
or right
are double, in which case out
is also double.
This operation calculates various 2-ary maths operations on an image and an array of constants and writes the result to out
. The image may have any non-complex format. out
is float except in the case that in
is double, in which case out
is also double.
This operation calculates various 2-ary maths operations on an image and a constant. See vips_math2_const()
.
This operation calculates the inverse of the matrix represented in m
. The scale and offset members of the input matrix are ignored.
Print in
to %stdout in matrix format. See vips_matrixload()
for a description of the format.
Write in
to filename
in matrix format. See vips_matrixload()
for a description of the format.
This operation finds the maximum value in an image.
vips_maxpairFor each pixel, pick the maximum of a pair of images.
vips_measureAnalyse a grid of colour patches, producing an array of patch averages. The mask has a row for each measured patch and a column for each image band. The operations issues a warning if any patch has a deviation more than 20% of the mean. Only the central 50% of each patch is averaged.
vips_mergeThis operation joins two images left-right (with ref
on the left) or up-down (with ref
above) with a smooth seam.
This operation finds the minimum value in an image.
vips_image_minimise_allMinimise memory use on this image and any upstream images, that is, images which this image depends upon. This function is called automatically at the end of a computation, but it might be useful to call at other times.
vips_minpairFor each pixel, pick the minimum of a pair of images.
vips_morePerform VIPS_OPERATION_RELATIONAL_MORE
on a pair of images. See vips_relational()
.
Perform VIPS_OPERATION_RELATIONAL_MORE
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_MORE
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_MOREEQ
on a pair of images. See vips_relational()
.
Perform VIPS_OPERATION_RELATIONAL_MOREEQ
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_MOREEQ
on an image and a constant. See vips_relational_const()
.
Performs a morphological operation on in
using mask
as a structuring element.
This operation joins two images left-right (with ref
on the left) or top-bottom (with ref
above) given an approximate overlap.
This operation joins two images top-bottom (with sec
on the right) or left-right (with sec
at the bottom) given an approximate pair of tie-points. sec
is scaled and rotated as necessary before the join.
Turn any integer image to 8-bit unsigned char by discarding all but the most significant byte. Signed values are converted to unsigned by adding 128.
vips_multiplyThis operation calculates left
* right
and writes the result to out
.
Perform VIPS_OPERATION_RELATIONAL_NOTEQ
on a pair of images. See vips_relational()
.
Perform VIPS_OPERATION_RELATIONAL_NOTEQ
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_RELATIONAL_NOTEQ
on an image and a constant. See vips_relational_const()
.
Perform VIPS_OPERATION_BOOLEAN_OR
on a pair of images. See vips_boolean()
.
Perform VIPS_OPERATION_BOOLEAN_OR
on an image and an array of constants. See vips_boolean_const()
.
Perform VIPS_OPERATION_BOOLEAN_OR
on an image and a constant. See vips_boolean_const1()
.
vips_percent()
returns (through the threshold
parameter) the threshold below which there are percent
values of in
. For example:.
Convert the two input images to Fourier space, calculate phase-correlation, back to real space.
vips_image_pio_inputCheck that an image is readable with vips_region_prepare()
and friends. If it isn’t, try to transform the image so that vips_region_prepare()
can work.
Check that an image is writeable with vips_image_generate()
. If it isn’t, try to transform the image so that vips_image_generate()
can work.
Perform VIPS_OPERATION_COMPLEX_POLAR
on an image. See vips_complex()
.
Perform VIPS_OPERATION_MATH2_POW
on a pair of images. See vips_math2()
.
Perform VIPS_OPERATION_MATH2_POW
on an image and a constant. See vips_math2_const()
.
Perform VIPS_OPERATION_MATH2_POW
on an image and a constant. See vips_math2_const()
.
vips_profile()
searches inward from the edge of in
and finds the first non-zero pixel. Pixels in columns
have the distance from the top edge to the first non-zero pixel in that column, rows
has the distance from the left edge to the first non-zero pixel in that row.
Find the horizontal and vertical projections of an image, ie. the sum of every row of pixels, and the sum of every column of pixels. The output format is uint, int or double, depending on the input format.
vips_quadraticTransform an image with a 0, 1, 2, or 3rd order polynomial.
vips_rad2floatUnpack a RAD (VIPS_CODING_RAD
) image to a three-band float image.
vips_rank()
does rank filtering on an image. A window of size width
by height
is passed over the image. At each position, the pixels inside the window are sorted into ascending order and the pixel at position index
is output. index
numbers from 0.
Writes the pixels in in
to the file filename
with no header or other metadata.
Perform VIPS_OPERATION_COMPLEXGET_REAL
on an image. See vips_complexget()
.
This operation recombines an image’s bands. Each pixel in in
is treated as an n-element vector, where n is the number of bands in in
, and multiplied by the n x m matrix m
to produce the m-band image out
.
Perform VIPS_OPERATION_COMPLEX_RECT
on an image. See vips_complex()
.
Reduce in
by a pair of factors with a pair of 1D kernels.
Perform various relational operations on an image and a constant. See vips_relational_const()
.
This operation calculates left
% right
(remainder after integer division) and writes the result to out
. The images may have any non-complex format. For float formats, vips_remainder()
calculates in1
- in2
* floor (in1
/ in2
).
This operation calculates in
% c
(remainder after division by an array of constants) and writes the result to out
. The image may have any non-complex format. For float formats, vips_remainder_const()
calculates in
- c
* floor (in
/ c
).
This operation calculates in
% c
(remainder after division by a constant) and writes the result to out
. The image may have any non-complex format. For float formats, vips_remainder_const()
calculates in
- c
* floor (in
/ c
).
vips_remosaic()
works rather as vips_globalbalance()
. It takes apart the mosaiced image in
and rebuilds it, substituting images.
Find and remove an item of metadata. Return FALSE
if no metadata of that name was found.
vips_reorder_margin_hint()
sets a hint that image
contains a margin, that is, that each vips_region_prepare()
on image
will request a slightly larger region from it’s inputs. A good value for margin
is (width * height) for the window the operation uses.
vips_reorder_prepare_many()
runs vips_region_prepare()
on each region in regions
, requesting the pixels in r
.
Round to an integral value with VIPS_OPERATION_ROUND_RINT
. See vips_round()
.
Rotate in
by a multiple of 90 degrees.
Rotate in
by 180 degrees. A convenience function over vips_rot()
.
Rotate in
by 270 degrees clockwise. A convenience function over vips_rot()
.
Rotate in
by a multiple of 45 degrees. Odd-length sides and square images only.
Rotate in
by 90 degrees clockwise. A convenience function over vips_rot()
.
This operator calls vips_affine()
for you, calculating the matrix for the affine transform from scale
and angle
.
Perform VIPS_OPERATION_BOOLEAN_RSHIFT
on a pair of images. See vips_boolean()
.
Perform VIPS_OPERATION_BOOLEAN_LSHIFT
on an image and an array of constants. See vips_boolean_const()
.
Perform VIPS_OPERATION_BOOLEAN_RSHIFT
on an image and a constant. See vips_boolean_const1()
.
Convert an scRGB image to greyscale. Set depth
to 16 to get 16-bit output.
Convert an scRGB image to sRGB. Set depth
to 16 to get 16-bit output.
Search the image for the maximum and minimum value, then return the image as unsigned 8-bit, scaled so that the maximum value is 255 and the minimum is zero.
vips_sequentialThis operation behaves rather like vips_copy()
between images in
and out
, except that it checks that pixels on in
are only requested top-to-bottom. This operation is useful for loading file formats which are strictly top-to-bottom, like PNG.
Set a piece of metadata on image
. Any old metadata with that name is destroyed. The GValue
is copied into the image, so you need to unset the value when you’re done with it.
Attaches data
as a metadata item on image
under the name name
. When VIPS no longer needs the metadata, it will be freed with free_fn
.
Attaches array
as a metadata item on image
as name
. A convenience function over vips_image_set()
.
Attaches data
as a metadata item on image
under the name name
, taking a copy of the memory area.
Sets the delete_on_close flag for the image. If this flag is set, when image
is finalized, the filename held in image
->filename at the time of this call is deleted.
Attaches d
as a metadata item on image
as name
. A convenience function over vips_image_set()
.
Attaches im
as a metadata item on image
as name
. A convenience function over vips_image_set()
.
Attaches i
as a metadata item on image
under the name name
. A convenience function over vips_image_set()
.
Set the VipsImage
.kill flag on an image. Handy for stopping sets of threads.
Vips signals evaluation progress via the VipsImage::preeval
, VipsImage::eval
and VipsImage::posteval
signals. Progress is signalled on the most-downstream image for which vips_image_set_progress()
was called.
Attaches str
as a metadata item on image
as name
. A convenience function over vips_image_set()
using VIPS_TYPE_REF_STRING
.
Selectively sharpen the L channel of a LAB image. The input image is transformed to VIPS_INTERPRETATION_LABS
.
Shrink in
by a pair of factors with a simple box filter.
Shrink in
horizontally by an integer factor. Each pixel in the output is the average of the corresponding line of hshrink
pixels in the input.
Finds the unit vector in the direction of the pixel value. For non-complex images, it returns a signed char image with values -1, 0, and 1 for negative, zero and positive pixels. For complex images, it returns a complex normalised to length 1.
vips_similarityThis operator calls vips_affine()
for you, calculating the matrix for the affine transform from scale
and angle
. Other parameters are passed on to vips_affine()
unaltered.
Perform VIPS_OPERATION_MATH_SIN
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_SINH
on an image. See vips_math()
.
Loops over an image. generate_fn
is called for every pixel in the image, with the reg
argument being a region of calculated pixels. vips_sink()
is used to implement operations like vips_avg()
which have no image output.
vips_sink_disc()
loops over im
, top-to-bottom, generating it in sections. As each section is produced, write_fn
is called.
This operation renders in
in the background, making pixels available on out
as they are calculated. The notify_fn
callback is run every time a new set of pixels are available. Calculated pixels are kept in a cache with tiles sized tile_width
by tile_height
pixels and with at most max_tiles
tiles. If max_tiles
is -1, the cache is of unlimited size (up to the maximum image * size). The mask
image is a one-band uchar image and has 255 for pixels which are currently in cache and 0 for uncalculated pixels.
Loops over an image. generate_fn
is called for every pixel in the image, with the reg
argument being a region of calculated pixels.
Crop an image down to a specified width and height by removing boring parts.
vips_spectrumMake a displayable (ie. 8-bit unsigned int) power spectrum.
vips_statsFind many image statistics in a single pass through the data. out
is a one-band VIPS_FORMAT_DOUBLE
image of at least 10 columns by n + 1 (where n is number of bands in image in
) rows. Columns are statistics, and are, in order: minimum, maximum, sum, sum of squares, mean, standard deviation, x coordinate of minimum, y coordinate of minimum, x coordinate of maximum, y coordinate of maximum. Later versions of vips_stats()
may add more columns.
vips_stdif()
performs statistical differencing according to the formula given in page 45 of the book “An Introduction to Digital Image Processing” by Wayne Niblack.
Subsample an image by an integer fraction. This is fast, nearest-neighbour shrink.
vips_subtractThis operation calculates in1
- in2
and writes the result to out
.
Perform VIPS_OPERATION_MATH_TAN
on an image. See vips_math()
.
Perform VIPS_OPERATION_MATH_TANH
on an image. See vips_math()
.
This operation behaves rather like vips_copy()
between images in
and out
, except that it keeps a cache of computed pixels. This cache is made of up to max_tiles
tiles (a value of -1 means any number of tiles), and each tile is of size tile_width
by tile_height
pixels.
Check that an image is readable via the VIPS_IMAGE_ADDR()
macro, that is, that the entire image is in memory and all pixels can be read with VIPS_IMAGE_ADDR()
. If it isn’t, try to transform it so that VIPS_IMAGE_ADDR()
can work.
Perform VIPS_OPERATION_MATH2_WOP
on a pair of images. See vips_math2()
.
Perform VIPS_OPERATION_MATH2_WOP
on an image and a constant. See vips_math2_const()
.
Perform VIPS_OPERATION_MATH2_WOP
on an image and a constant. See vips_math2_const()
.
Slice an image up and move the segments about so that the pixel that was at 0, 0 is now at x
, y
.
Write image
to out
. Use vips_image_new()
and friends to create the VipsImage
you want to write to.
Write a line of pixels to an image. This function must be called repeatedly with ypos
increasing from 0 to VipsImage:height
. linebuffer
must be VIPS_IMAGE_SIZEOF_LINE()
bytes long.
Call this after setting header fields (width, height, and so on) to allocate resources ready for writing.
vips_zoomZoom an image by repeating pixels. This is fast nearest-neighbour zoom.
Methods inherited from GObject (43)Please see GObject for a full list of methods.
Signals Vips.Image::evalThis signal is emitted once per work unit (typically a 128 x 128 area of pixels) during image computation.
Vips.Image::invalidateThis signal is emitted when an image or one of it’s upstream data sources has been destructively modified. See vips_image_invalidate_all()
.
This signal is emitted when an image has been asked to minimise memory usage. All non-essential caches are dropped. See vips_image_minimise_all()
.
This signal is emitted once at the end of the computation of image
. It’s a good place to shut down evaluation feedback.
This signal is emitted once before computation of image
starts. It’s a good place to set up evaluation feedback.
This signal is emitted just after an image has been written to. It is used by vips to implement things like write to foreign file formats.
Signals inherited from VipsObject (4) VipsObject::closeThe ::close signal is emitted once during object close. The object is dying and may not work.
VipsObject::postbuildThe ::postbuild signal is emitted once just after successful object construction. Return non-zero to cause object construction to fail.
VipsObject::postcloseThe ::postclose signal is emitted once after object close. The object pointer is still valid, but nothing else.
VipsObject::precloseThe ::preclose signal is emitted once just before object close starts. The object is still alive.
Signals inherited from GObject (1) GObject::notifyThe notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structurestruct VipsImageClass {
VipsObjectClass parent_class;
void (* preeval) (
VipsImage* image,
VipsProgress* progress,
void* data
);
void (* eval) (
VipsImage* image,
VipsProgress* progress,
void* data
);
void (* posteval) (
VipsImage* image,
VipsProgress* progress,
void* data
);
void (* written) (
VipsImage* image,
int* result,
void* data
);
void (* invalidate) (
VipsImage* image,
void* data
);
void (* minimise) (
VipsImage* image,
void* data
);
}
No description available.
Class membersparent_class: VipsObjectClass
No description available.
preeval: void (* preeval) ( VipsImage* image, VipsProgress* progress, void* data )
No description available.
eval: void (* eval) ( VipsImage* image, VipsProgress* progress, void* data )
No description available.
posteval: void (* posteval) ( VipsImage* image, VipsProgress* progress, void* data )
No description available.
written: void (* written) ( VipsImage* image, int* result, void* data )
No description available.
invalidate: void (* invalidate) ( VipsImage* image, void* data )
No description available.
minimise: void (* minimise) ( VipsImage* image, void* data )
No description available.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4