Vips.Image (original) (raw)
Class
VipsImage
Description [src]
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. Seevips_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() org_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 CMYKimage, 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 aVipsInterpretation hint for each image (seevips_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 (withvips_image_write_to_file()), to formatted memory buffers (withvips_image_write_to_buffer()) and to C-style memory arrays (withvips_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.
Constructors
vips_image_memory
A renamed vips_image_new_memory() … Some gobject binding systems do not like more than one _new() method.
vips_image_new
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.
vips_image_new_from_buffer
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, usevips_image_new_from_memory().
vips_image_new_from_file
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.
vips_image_new_from_file_RW
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_image
Creates 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.
vips_image_new_from_image1
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.
vips_image_new_from_memory
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.
vips_image_new_from_memory_copy
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.
vips_image_new_matrix
This convenience function makes an image which is a matrix: a one-bandVIPS_FORMAT_DOUBLE image held in memory.
vips_image_new_matrixv
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
vips_image_new_memory() creates a new VipsImage which, when written to, will create a memory image.
vips_image_new_temp_file
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.
vips_analyzeload
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”.
vips_black
Make a black unsigned char image of a specified size.
vips_eye
Create a test pattern with increasing spatial frequency in X and amplitude in Y.
vips_fractsurf
Generate an image of size width by height and fractal dimensionfractal_dimension. The dimension should be between 2 and 3.
vips_gaussmat
Creates a circularly symmetric Gaussian image of radiussigma.
vips_gaussnoise
Make a one band float image of gaussian noise with the specified distribution.
vips_grey
Create a one-band float image with the left-most column zero and the right-most 1.
vips_heifload_buffer
Read a HEIF image file into a VIPS image. Exactly as vips_heifload(), but read from a memory buffer.
vips_identity
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.
vips_jpegload
Read a JPEG file into a VIPS image. It can read most 8-bit JPEG images, including CMYK and YCbCr.
vips_jpegload_buffer
Read a JPEG-formatted memory block into a VIPS image. Exactly asvips_jpegload(), but read from a memory buffer.
vips_jpegload_source
Read a JPEG-formatted memory block into a VIPS image. Exactly asvips_jpegload(), but read from a source.
vips_logmat
Create a circularly symmetric Laplacian of Gaussian mask of radiussigma.
vips_magickload_buffer
Read an image memory block using libMagick into a VIPS image. Exactly asvips_magickload(), but read from a memory source.
vips_mask_butterworth
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.
vips_mask_butterworth_band
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.
vips_mask_butterworth_ring
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.
vips_mask_fractal
This operation should be used to create fractal images by filtering the power spectrum of Gaussian white noise.
vips_mask_gaussian
Make a gaussian high- or low-pass filter, that is, one with a variable, smooth transition positioned at frequency_cutoff.
vips_mask_gaussian_band
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.
vips_mask_gaussian_ring
Make a gaussian ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at frequency_cutoff of widthringwidth.
vips_mask_ideal
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.
vips_mask_ideal_band
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.
vips_mask_ideal_ring
Make an ideal ring-pass or ring-reject filter, that is, one with a sharp ring positioned at frequency_cutoff of width width, wherefrequency_cutoff and width are expressed as the range 0 - 1.
vips_openslideload
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_buffer
Read a PDF-formatted memory buffer into a VIPS image. Exactly asvips_pdfload(), but read from memory.
vips_pngload
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_rawload
This operation mmaps the file, setting up out so that access to that image will read from the file.
vips_sdf
Create a signed distance field (SDF) image of the given shape.
vips_sines
Creates a float one band image of the a sine waveform in two dimensions.
vips_svgload_buffer
Read a SVG-formatted memory block into a VIPS image. Exactly asvips_svgload(), but read from a memory buffer.
vips_svgload_string
Exactly as vips_svgload(), but read from a string. This function takes a copy of the string.
vips_system
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.
vips_tiffload_buffer
Read a TIFF-formatted memory block into a VIPS image. Exactly asvips_tiffload(), but read from a memory source.
vips_tonelut
vips_tonelut() generates a tone curve for the adjustment of image levels.
vips_webpload_buffer
Read a WebP-formatted memory block into a VIPS image. Exactly asvips_webpload(), but read from a memory buffer.
vips_xyz
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_zone
Create a one-band image of a zone plate.
Functions
vips_image_pipeline_array
Add an image to a pipeline. image depends on all of the images in in,image prefers to supply pixels according to hint.
vips_arrayjoin
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.
vips_bandrank
Sorts the images in band-element-wise, then outputs an image in which each band element is selected from the sorted list by theindex parameter. For example, if indexis zero, then each output band element will be the minimum of all the corresponding input band elements.
vips_sum
This operation sums all images in in and writes the result to out.
vips_switch
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.
Instance methods
vips_CMYK2XYZ
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_Lab2LabQ
Convert a Lab three-band float image to LabQ (VIPS_CODING_LABQ).
vips_Lab2XYZ
Turn Lab to XYZ. The colour temperature defaults to D65, but can be specified with temp.
vips_LabQ2Lab
Unpack a LabQ (VIPS_CODING_LABQ) image to a three-band float image.
vips_LabQ2LabS
Unpack a LabQ (VIPS_CODING_LABQ) image to a three-band short image.
vips_LabQ2sRGB
Unpack a LabQ (VIPS_CODING_LABQ) image to a three-band short image.
vips_LabS2Lab
Convert a LabS three-band signed short image to a three-band float image.
vips_XYZ2Lab
Turn XYZ to Lab, optionally specifying the colour temperature. tempdefaults to D65.
vips_abs
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.
vips_acos
Perform VIPS_OPERATION_MATH_ACOS on an image. See vips_math().
vips_acosh
Perform VIPS_OPERATION_MATH_ACOSH on an image. See vips_math().
vips_add
This operation calculates in1 + in2 and writes the result to out.
vips_affine
This operator performs an affine transform on an image using interpolate.
vips_andimage
Perform VIPS_OPERATION_BOOLEAN_AND on a pair of images. Seevips_boolean().
vips_andimage_const
Perform VIPS_OPERATION_BOOLEAN_AND on an image and an array of constants. See vips_boolean_const().
vips_andimage_const1
Perform VIPS_OPERATION_BOOLEAN_AND on an image and a constant. See vips_boolean_const1().
vips_asin
Perform VIPS_OPERATION_MATH_ASIN on an image. See vips_math().
vips_asinh
Perform VIPS_OPERATION_MATH_ASINH on an image. See vips_math().
vips_atan
Perform VIPS_OPERATION_MATH_ATAN on an image. See vips_math().
vips_atan2
Perform VIPS_OPERATION_MATH2_ATAN2 on a pair of images. Seevips_math2().
vips_atan2_const
Perform VIPS_OPERATION_MATH2_ATAN2 on an image and a constant. Seevips_math2_const().
vips_atan2_const1
Perform VIPS_OPERATION_MATH2_ATAN2 on an image and a constant. Seevips_math2_const().
vips_atanh
Perform VIPS_OPERATION_MATH_ATANH on an image. See vips_math().
vips_autorot
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.
vips_autorot_remove_angle
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.
vips_avg
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.
vips_bandand
Perform VIPS_OPERATION_BOOLEAN_AND on an image. Seevips_bandbool().
vips_bandbool
Perform various boolean operations across the bands of an image. For example, a three-band uchar image operated on withVIPS_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.
vips_bandeor
Perform VIPS_OPERATION_BOOLEAN_EOR on an image. Seevips_bandbool().
vips_bandfold
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.
vips_bandjoin2
Join a pair of images together, bandwise. See vips_bandjoin().
vips_bandmean
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_bandor
Perform VIPS_OPERATION_BOOLEAN_OR on an image. Seevips_bandbool().
vips_bandunfold
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.
vips_boolean
Perform various boolean operations on pairs of images.
vips_boolean_const
Perform various boolean operations on an image against an array of constants.
vips_boolean_const1
Perform various boolean operations on an image with a single constant. Seevips_boolean_const().
vips_buildlut
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.
vips_canny
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_case
Use values in index to select pixels from cases.
vips_cast
Convert in to format. You can convert between any pair of formats. Floats are truncated (not rounded). Out of range values are clipped.
vips_ceil
Round to an integral value with VIPS_OPERATION_ROUND_CEIL. Seevips_round().
vips_clamp
This operation clamps pixel values to a range, by default 0 - 1.
vips_colourspace
This operation looks at the interpretation field of in (or usessource_space, if set) and runs a set of colourspace conversion functions to move it to space.
vips_compass
This convolves in with mask times times, rotating mask by angleeach time. By default, it comvolves twice, rotating by 90 degrees, taking the maximum result.
vips_complex2
Perform various binary operations on complex images.
vips_complexform
Compose two real images to make a complex image. If either left or rightare VIPS_FORMAT_DOUBLE, out is VIPS_FORMAT_DPCOMPLEX. Otherwise outis VIPS_FORMAT_COMPLEX. left becomes the real component of out andright the imaginary.
vips_composite2
Composite overlay on top of base with mode. See vips_composite().
vips_conj
Perform VIPS_OPERATION_COMPLEX_CONJ on an image. See vips_complex().
vips_conv
Perform a convolution of in with mask.
vips_conva
Perform an approximate integer convolution of in with mask. This is a low-level operation, see vips_conv() for something more convenient.
vips_convasep
Approximate separable integer convolution. This is a low-level operation, seevips_convsep() for something more convenient.
vips_convf
Convolution. This is a low-level operation, see vips_conv() for something more convenient.
vips_convi
Integer convolution. This is a low-level operation, see vips_conv() for something more convenient.
vips_convsep
Perform a separable convolution of in with mask. See vips_conv() for a detailed description.
vips_copy
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_file
A 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_memory
This function allocates memory, renders image into it, builds a new image around the memory area, and returns that.
vips_cos
Perform VIPS_OPERATION_MATH_COS on an image. See vips_math().
vips_cosh
Perform VIPS_OPERATION_MATH_COSH on an image. See vips_math().
vips_countlines
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_phase
Perform VIPS_OPERATION_COMPLEX2_CROSS_PHASE on an image. See vips_complex2().
vips_csvsave
Writes the pixels in in to the filename as CSV (comma-separated values).
vips_dECMC
Calculate dE CMC. The input images are transformed to CMC colour space and the euclidean distance between corresponding pixels calculated.
vips_image_decode
A convenience function to unpack to a format that we can compute with.out.coding is always VIPS_CODING_NONE.
vips_image_decode_predict
We often need to know what an image will decode to without actually decoding it, for example, in arg checking.
vips_deviate
This 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.
vips_divide
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.
vips_draw_line1
As vips_draw_line(), but just take a single double for ink.
vips_draw_mask
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 avips_draw_line() subclass to draw an object along a line.
vips_draw_mask1
As vips_draw_mask(), but just takes a single double for ink.
vips_draw_rect
Paint pixels within left, top, width, height in image with ink.
vips_draw_rect1
As vips_draw_rect(), but just take a single double for ink.
vips_draw_smudge
Smudge a section of image. Each pixel in the area left, top, width,height is replaced by the average of the surrounding 3x3 pixels.
vips_dzsave
Save an image as a set of tiles at various resolutions. By default dzsave uses DeepZoom layout — use layout to pick other conventions.
vips_embed
The opposite of vips_extract_area(): embed in within an image of size width by height at position x, y.
vips_image_encode
A convenience function to pack to a coding. The inverse ofvips_image_decode().
vips_eorimage
Perform VIPS_OPERATION_BOOLEAN_EOR on a pair of images. Seevips_boolean().
vips_eorimage_const
Perform VIPS_OPERATION_BOOLEAN_EOR on an image and an array of constants. See vips_boolean_const().
vips_eorimage_const1
Perform VIPS_OPERATION_BOOLEAN_EOR on an image and a constant. See vips_boolean_const1().
vips_equal
Perform VIPS_OPERATION_RELATIONAL_EQUAL on a pair of images. Seevips_relational().
vips_equal_const
Perform VIPS_OPERATION_RELATIONAL_EQUAL on an image and a constant. Seevips_relational_const().
vips_equal_const1
Perform VIPS_OPERATION_RELATIONAL_EQUAL on an image and a constant. Seevips_relational_const().
vips_exp
Perform VIPS_OPERATION_MATH_EXP on an image. See vips_math().
vips_exp10
Perform VIPS_OPERATION_MATH_EXP10 on an image. See vips_math().
vips_extract_band
Extract a band or bands from an image. Extracting out of range is an error.
vips_falsecolour
Force 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.
vips_fill_nearest
Fill outwards from every non-zero pixel in in, setting pixels in distanceand value.
vips_find_trim
Search in for the bounding box of the non-background area.
vips_flatten
Take the last band of in as an alpha and use it to blend the remaining channels with background.
vips_flip
Flips an image left-right or up-down.
vips_float2rad
Convert a three-band float image to Radiance 32-bit packed format.
vips_floor
Round to an integral value with VIPS_OPERATION_ROUND_FLOOR. Seevips_round().
vips_foreign_load_invalidate
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_buffer
Free the externally allocated buffer found in the input image. This function is intended to be used with g_signal_connect.
vips_gamma
Calculate in ** (1 / exponent), normalising to the maximum range of the input type. For float types use 1.0 as the maximum.
vips_gaussblur
This operator runs vips_gaussmat() and vips_convsep() for you on an image.
vips_image_get
Fill value_copy with a copy of the header field. value_copy must be zeroed but uninitialised.
vips_image_get_area
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.
vips_image_get_as_string
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.
vips_image_get_blob
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.
vips_image_get_data
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_double
Gets out from im under the name name. The value will be transformed into a double, if possible.
vips_image_get_fields
Get a NULL-terminated array listing all the metadata field names on image. Free the return result with g_strfreev().
vips_image_get_history
This function reads the image history as a C string. The string is owned by VIPS and must not be freed.
vips_image_get_image
Gets out from im under the name name. The field must be of type VIPS_TYPE_IMAGE. You must unref out with g_object_unref().
vips_image_get_int
Gets out from im under the name name. The value will be transformed into an int, if possible.
vips_image_get_interpretation
Return the VipsInterpretation set in the image header. Use vips_image_guess_format() if you want a sanity-checked value.
vips_image_get_mode
Image modes are things like "t", meaning a memory buffer, and "p"meaning a delayed computation.
vips_image_get_orientation
Fetch and sanity-check VIPS_META_ORIENTATION. Default to 1 (no rotate, no flip) if not present or crazy.
vips_image_get_page_height
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_string
Gets out from im under the name name. The field must be of type G_TYPE_STRING or VIPS_TYPE_REF_STRING.
vips_get_tile_size
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
vips_globalbalance() can be used to remove contrast differences in an assembled mosaic.
vips_gravity
The opposite of vips_extract_area(): place in within an image of size width by height at a certain gravity.
vips_grid
Chop a tall thin image up into a set of tiles, lay the tiles out in a grid.
vips_image_guess_format
Return the VipsBandFormat for an image, guessing a sane value if the set value looks crazy.
vips_image_hasalpha
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-bandVIPS_INTERPRETATION_MULTIBAND would not.
vips_hist_entropy
Estimate image entropy from a histogram. Entropy is calculated as:.
vips_hist_find
Find the histogram of in. Find the histogram for band band (producing a one-band histogram), or for all bands (producing an n-band histogram) ifband is -1.
vips_hist_find_indexed
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 inwhose corresponding pixel in index is zero.
vips_hist_find_ndim
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.
vips_hist_local
Performs local histogram equalisation on in using a window of size width by height centered on the input pixel.
vips_hist_match
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.
vips_hist_norm
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_plot
Plot 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_args
Formats the name/argv as a single string and callsvips_image_history_printf(). A convenience function for command-line programs.
vips_image_history_printf
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.
vips_hough_circle
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.
vips_hough_line
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.
vips_icc_ac2rc
Transform an image from absolute to relative colorimetry using the MediaWhitePoint stored in the ICC profile.
vips_icc_export
Export an image from D65 LAB to device space with an ICC profile.
vips_icc_import
Import an image from device space to D65 LAB with an ICC profile.
vips_ifthenelse
This operation scans the condition image condand uses it to select pixels from either the then image in1 or the else image in2. Non-zero means in1, 0 means in2.
vips_imag
Perform VIPS_OPERATION_COMPLEXGET_IMAG on an image. See vips_complexget().
vips_image_init_fields
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 examplevips_black() or vips_jpegload(), you do need to set all the fields yourself.
vips_image_inplace
Gets image ready for an in-place operation, such asvips_draw_circle(). After calling this function you can both read and write the image with VIPS_IMAGE_ADDR().
vips_image_invalidate_all
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.
vips_invert
For unsigned formats, this operation calculates (max - in), eg. (255 -in) for uchar. For signed and float formats, this operation calculates (-1in).
vips_invertlut
Given a mask of target values and real values, generate a LUT which will map reals to targets.
vips_invfft
Transform an image from Fourier space to real space.
vips_image_isMSBfirst
Return TRUE if image is in most-significant- byte first form. This is the byte order used on the SPARCarchitecture and others.
vips_image_is_sequential
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.
vips_image_iskilled
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.
vips_join
Join in1 and in2 together, left-right or up-down depending on the value of direction.
vips_jxlsave
Write a VIPS image to a file in JPEG-XL format.
vips_less
Perform VIPS_OPERATION_RELATIONAL_LESS on a pair of images. Seevips_relational().
vips_less_const
Perform VIPS_OPERATION_RELATIONAL_LESS on an image and a constant. Seevips_relational_const().
vips_less_const1
Perform VIPS_OPERATION_RELATIONAL_LESS on an image and a constant. Seevips_relational_const().
vips_lesseq
Perform VIPS_OPERATION_RELATIONAL_LESSEQ on a pair of images. Seevips_relational().
vips_lesseq_const
Perform VIPS_OPERATION_RELATIONAL_LESSEQ on an image and a constant. Seevips_relational_const().
vips_lesseq_const1
Perform VIPS_OPERATION_RELATIONAL_LESSEQ on an image and a constant. Seevips_relational_const().
vips_linear
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.
vips_linecache
This operation behaves rather like vips_copy() between imagesin and out, except that it keeps a cache of computed scanlines.
vips_log
Perform VIPS_OPERATION_MATH_LOG on an image. See vips_math().
vips_log10
Perform VIPS_OPERATION_MATH_LOG10 on an image. See vips_math().
vips_lshift
Perform VIPS_OPERATION_BOOLEAN_LSHIFT on a pair of images. Seevips_boolean().
vips_lshift_const
Perform VIPS_OPERATION_BOOLEAN_LSHIFT on an image and an array of constants. See vips_boolean_const().
vips_lshift_const1
Perform VIPS_OPERATION_BOOLEAN_LSHIFT on an image and a constant. See vips_boolean_const1().
vips_image_map
This function calls fn for every header field, including every item of metadata.
vips_mapim
This operator resamples in using index to look up pixels.
vips_maplut
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_match
Scale, rotate and translate sec so that the tie-points line up.
vips_math
Perform various functions in -lm, the maths library, on images.
vips_math2
This 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 leftor right are double, in which case out is also double.
vips_math2_const
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 inis double, in which case out is also double.
vips_math2_const1
This operation calculates various 2-ary maths operations on an image and a constant. See vips_math2_const().
vips_matrixinvert
This operation calculates the inverse of the matrix represented in m. The scale and offset members of the input matrix are ignored.
vips_matrixprint
Print in to %stdout in matrix format. See vips_matrixload() for a description of the format.
vips_matrixsave
Write in to filename in matrix format. See vips_matrixload() for a description of the format.
vips_max
This operation finds the maximum value in an image.
vips_maxpair
For each pixel, pick the maximum of a pair of images.
vips_measure
Analyse 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_merge
This operation joins two images left-right (with ref on the left) or up-down (with ref above) with a smooth seam.
vips_min
This operation finds the minimum value in an image.
vips_image_minimise_all
Minimise 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_minpair
For each pixel, pick the minimum of a pair of images.
vips_more
Perform VIPS_OPERATION_RELATIONAL_MORE on a pair of images. Seevips_relational().
vips_more_const
Perform VIPS_OPERATION_RELATIONAL_MORE on an image and a constant. Seevips_relational_const().
vips_more_const1
Perform VIPS_OPERATION_RELATIONAL_MORE on an image and a constant. Seevips_relational_const().
vips_moreeq
Perform VIPS_OPERATION_RELATIONAL_MOREEQ on a pair of images. Seevips_relational().
vips_moreeq_const
Perform VIPS_OPERATION_RELATIONAL_MOREEQ on an image and a constant. Seevips_relational_const().
vips_moreeq_const1
Perform VIPS_OPERATION_RELATIONAL_MOREEQ on an image and a constant. Seevips_relational_const().
vips_morph
Performs a morphological operation on in using mask as a structuring element.
vips_mosaic
This operation joins two images left-right (with ref on the left) or top-bottom (with ref above) given an approximate overlap.
vips_mosaic1
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.
vips_msb
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_multiply
This operation calculates left * right and writes the result to out.
vips_notequal
Perform VIPS_OPERATION_RELATIONAL_NOTEQ on a pair of images. Seevips_relational().
vips_notequal_const
Perform VIPS_OPERATION_RELATIONAL_NOTEQ on an image and a constant. Seevips_relational_const().
vips_notequal_const1
Perform VIPS_OPERATION_RELATIONAL_NOTEQ on an image and a constant. Seevips_relational_const().
vips_orimage
Perform VIPS_OPERATION_BOOLEAN_OR on a pair of images. Seevips_boolean().
vips_orimage_const
Perform VIPS_OPERATION_BOOLEAN_OR on an image and an array of constants. See vips_boolean_const().
vips_orimage_const1
Perform VIPS_OPERATION_BOOLEAN_OR on an image and a constant. See vips_boolean_const1().
vips_percent
vips_percent() returns (through the threshold parameter) the threshold below which there are percent values of in. For example:.
vips_phasecor
Convert the two input images to Fourier space, calculate phase-correlation, back to real space.
vips_image_pio_input
Check 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.
vips_image_pio_output
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.
vips_polar
Perform VIPS_OPERATION_COMPLEX_POLAR on an image. See vips_complex().
vips_pow
Perform VIPS_OPERATION_MATH2_POW on a pair of images. Seevips_math2().
vips_pow_const
Perform VIPS_OPERATION_MATH2_POW on an image and a constant. Seevips_math2_const().
vips_pow_const1
Perform VIPS_OPERATION_MATH2_POW on an image and a constant. Seevips_math2_const().
vips_profile
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.
vips_project
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_quadratic
Transform an image with a 0, 1, 2, or 3rd order polynomial.
vips_rad2float
Unpack a RAD (VIPS_CODING_RAD) image to a three-band float image.
vips_rank
vips_rank() does rank filtering on an image. A window of size width byheight 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.
vips_rawsave
Writes the pixels in in to the file filename with no header or other metadata.
vips_real
Perform VIPS_OPERATION_COMPLEXGET_REAL on an image. See vips_complexget().
vips_recomb
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.
vips_rect
Perform VIPS_OPERATION_COMPLEX_RECT on an image. See vips_complex().
vips_reduce
Reduce in by a pair of factors with a pair of 1D kernels.
vips_relational_const1
Perform various relational operations on an image and a constant. Seevips_relational_const().
vips_remainder
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).
vips_remainder_const
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() calculatesin - c * floor (in / c).
vips_remainder_const1
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() calculatesin - c * floor (in / c).
vips_remosaic
vips_remosaic() works rather as vips_globalbalance(). It takes apart the mosaiced image in and rebuilds it, substituting images.
vips_image_remove
Find and remove an item of metadata. Return FALSE if no metadata of that name was found.
vips_reorder_margin_hint
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
vips_reorder_prepare_many() runs vips_region_prepare() on each region in regions, requesting the pixels in r.
vips_rint
Round to an integral value with VIPS_OPERATION_ROUND_RINT. Seevips_round().
vips_rot
Rotate in by a multiple of 90 degrees.
vips_rot180
Rotate in by 180 degrees. A convenience function over vips_rot().
vips_rot270
Rotate in by 270 degrees clockwise. A convenience function over vips_rot().
vips_rot45
Rotate in by a multiple of 45 degrees. Odd-length sides and square images only.
vips_rot90
Rotate in by 90 degrees clockwise. A convenience function over vips_rot().
vips_rotate
This operator calls vips_affine() for you, calculating the matrix for the affine transform from scale and angle.
vips_rshift
Perform VIPS_OPERATION_BOOLEAN_RSHIFT on a pair of images. Seevips_boolean().
vips_rshift_const
Perform VIPS_OPERATION_BOOLEAN_LSHIFT on an image and an array of constants. See vips_boolean_const().
vips_rshift_const1
Perform VIPS_OPERATION_BOOLEAN_RSHIFT on an image and a constant. See vips_boolean_const1().
vips_scRGB2BW
Convert an scRGB image to greyscale. Set depth to 16 to get 16-bit output.
vips_scRGB2sRGB
Convert an scRGB image to sRGB. Set depth to 16 to get 16-bit output.
vips_scale
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_sequential
This operation behaves rather like vips_copy() between imagesin 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.
vips_image_set
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.
vips_image_set_area
Attaches data as a metadata item on image under the name name. WhenVIPS no longer needs the metadata, it will be freed with free_fn.
vips_image_set_array_int
Attaches array as a metadata item on image as name. A convenience function over vips_image_set().
vips_image_set_blob_copy
Attaches data as a metadata item on image under the name name, taking a copy of the memory area.
vips_image_set_delete_on_close
Sets the delete_on_close flag for the image. If this flag is set, whenimage is finalized, the filename held in image->filename at the time of this call is deleted.
vips_image_set_double
Attaches d as a metadata item on image as name. A convenience function over vips_image_set().
vips_image_set_image
Attaches im as a metadata item on image as name. A convenience function over vips_image_set().
vips_image_set_int
Attaches i as a metadata item on image under the name name. A convenience function over vips_image_set().
vips_image_set_kill
Set the VipsImage.kill flag on an image. Handy for stopping sets of threads.
vips_image_set_progress
Vips signals evaluation progress via the VipsImage::preeval,VipsImage::eval and VipsImage::postevalsignals. Progress is signalled on the most-downstream image for whichvips_image_set_progress() was called.
vips_image_set_string
Attaches str as a metadata item on image as name. A convenience function over vips_image_set() using VIPS_TYPE_REF_STRING.
vips_sharpen
Selectively sharpen the L channel of a LAB image. The input image is transformed to VIPS_INTERPRETATION_LABS.
vips_shrink
Shrink in by a pair of factors with a simple box filter.
vips_shrinkh
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.
vips_sign
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_similarity
This 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.
vips_sin
Perform VIPS_OPERATION_MATH_SIN on an image. See vips_math().
vips_sinh
Perform VIPS_OPERATION_MATH_SINH on an image. See vips_math().
vips_sink
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 likevips_avg() which have no image output.
vips_sink_disc
vips_sink_disc() loops over im, top-to-bottom, generating it in sections. As each section is produced, write_fn is called.
vips_sink_screen
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.
vips_sink_tile
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_smartcrop
Crop an image down to a specified width and height by removing boring parts.
vips_spectrum
Make a displayable (ie. 8-bit unsigned int) power spectrum.
vips_stats
Find 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
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.
vips_subsample
Subsample an image by an integer fraction. This is fast, nearest-neighbour shrink.
vips_subtract
This operation calculates in1 - in2 and writes the result to out.
vips_tan
Perform VIPS_OPERATION_MATH_TAN on an image. See vips_math().
vips_tanh
Perform VIPS_OPERATION_MATH_TANH on an image. See vips_math().
vips_tilecache
This operation behaves rather like vips_copy() between imagesin 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_widthby tile_height pixels.
vips_image_wio_input
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 withVIPS_IMAGE_ADDR(). If it isn’t, try to transform it so that VIPS_IMAGE_ADDR() can work.
vips_wop
Perform VIPS_OPERATION_MATH2_WOP on a pair of images. Seevips_math2().
vips_wop_const
Perform VIPS_OPERATION_MATH2_WOP on an image and a constant. Seevips_math2_const().
vips_wop_const1
Perform VIPS_OPERATION_MATH2_WOP on an image and a constant. Seevips_math2_const().
vips_wrap
Slice an image up and move the segments about so that the pixel that was at 0, 0 is now at x, y.
vips_image_write
Write image to out. Use vips_image_new() and friends to create theVipsImage you want to write to.
vips_image_write_line
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.
vips_image_write_prepare
Call this after setting header fields (width, height, and so on) to allocate resources ready for writing.
vips_zoom
Zoom 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.
Properties
Signals
Vips.Image::eval
This signal is emitted once per work unit (typically a 128 x 128 area of pixels) during image computation.
Vips.Image::invalidate
This signal is emitted when an image or one of it’s upstream data sources has been destructively modified. Seevips_image_invalidate_all().
Vips.Image::minimise
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().
Vips.Image::posteval
This signal is emitted once at the end of the computation of image. It’s a good place to shut down evaluation feedback.
Vips.Image::preeval
This signal is emitted once before computation of imagestarts. It’s a good place to set up evaluation feedback.
Vips.Image::written
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::close
The ::close signal is emitted once during object close. The object is dying and may not work.
VipsObject::postbuild
The ::postbuild signal is emitted once just after successful object construction. Return non-zero to cause object construction to fail.
VipsObject::postclose
The ::postclose signal is emitted once after object close. The object pointer is still valid, but nothing else.
VipsObject::preclose
The ::preclose signal is emitted once just before object close starts. The object is still alive.
Signals inherited from GObject (1)
GObject::notify
The 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 structure
struct 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 members
parent_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.
Virtual methods
Content