Class VImage
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionabs
(VipsOption... args) This operation finds the absolute value of an image.add
(VImage right, VipsOption... args) This operation calculatesin1
+in2
and writes the result toout
.addalpha
(VipsOption... args) Append an alpha channel.affine
(List<Double> matrix, VipsOption... args) This operator performs an affine transform on an image usinginterpolate
.analyzeload
(String filename, VipsOption... args) Load an Analyze 6.0 file.arrayjoin
(List<VImage> in, VipsOption... args) Lay out the images inin
in a grid.autorot
(VipsOption... args) Look at the image metadata and rotate and flip the image to make it upright.double
avg
(VipsOption... args) This operation finds the average value in an image.void
avifsaveTarget
(VTarget target, VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.bandbool
(VipsOperationBoolean boolean1, VipsOption... args) Perform various boolean operations across the bands of an image.bandfold
(VipsOption... args) Fold up an image horizontally: width is collapsed into bands.bandjoin
(List<VImage> in, VipsOption... args) Join a set of images together, bandwise.bandjoinConst
(List<Double> c, VipsOption... args) Append a set of constant bands to an image.bandmean
(VipsOption... args) This operation writes a one-band image where each pixel is the average of the bands for that pixel in the input image.bandrank
(List<VImage> in, VipsOption... args) Sorts the imagesin
band-element-wise, then outputs an image in which each band element is selected from the sorted list by theindex
parameter.bandunfold
(VipsOption... args) Unfold image bands into x axis.black
(int width, int height, VipsOption... args) Make a black unsigned char image of a specified size.boolean1
(VImage right, VipsOperationBoolean boolean1, VipsOption... args) Perform various boolean operations on pairs of images.booleanConst
(VipsOperationBoolean boolean1, List<Double> c, VipsOption... args) Perform various boolean operations on an image against an array of constants.buildlut
(VipsOption... args) This operation builds a lookup table from a set of points.byteswap
(VipsOption... args) Swap the byte order in an image.cache
(VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.canny
(VipsOption... args) Find edges by Canny's method: The maximum of the derivative of the gradient in the direction of the gradient.case1
(List<VImage> cases, VipsOption... args) Use values inindex
to select pixels fromcases
.cast
(VipsBandFormat format, VipsOption... args) Convertin
toformat
.clamp
(VipsOption... args) This operation clamps pixel values to a range, by default 0 - 1.CMC2LCh
(VipsOption... args) Turn LCh to CMC.CMYK2XYZ
(VipsOption... args) Turn CMYK to XYZ.colourspace
(VipsInterpretation space, VipsOption... args) This operation looks at the interpretation field ofin
(or usessource-space
, if set) and runs a set of colourspace conversion functions to move it tospace
.compass
(VImage mask, VipsOption... args) This convolvesin
withmask
times
times, rotatingmask
byangle
each time.complex
(VipsOperationComplex cmplx, VipsOption... args) Perform various operations on complex images.complex2
(VImage right, VipsOperationComplex2 cmplx, VipsOption... args) Perform various binary operations on complex images.complexform
(VImage right, VipsOption... args) Compose two real images to make a complex image.complexget
(VipsOperationComplexget get, VipsOption... args) Get components of complex images.Composite an array of images together.composite2
(VImage overlay, VipsBlendMode mode, VipsOption... args) Compositeoverlay
on top ofbase
withmode
.conv
(VImage mask, VipsOption... args) Convolution.conva
(VImage mask, VipsOption... args) Perform an approximate integer convolution ofin
withmask
.convasep
(VImage mask, VipsOption... args) Approximate separable integer convolution.convf
(VImage mask, VipsOption... args) Convolution.convi
(VImage mask, VipsOption... args) Integer convolution.convsep
(VImage mask, VipsOption... args) Perform a separable convolution ofin
withmask
.copy
(VipsOption... args) Copy an image, optionally modifying the header.double
countlines
(VipsDirection direction, VipsOption... args) Function which calculates the number of transitions between black and white for the horizontal or the vertical direction of an image.csvload
(String filename, VipsOption... args) Load a CSV (comma-separated values) file.csvloadSource
(VSource source, VipsOption... args) Exactly ascsvload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
csvsave
(String filename, VipsOption... args) Writes the pixels inin
to thefilename
as CSV (comma-separated values).void
csvsaveTarget
(VTarget target, VipsOption... args) Ascsvsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.dE00
(VImage right, VipsOption... args) Calculate dE 00.dE76
(VImage right, VipsOption... args) Calculate dE 76.dECMC
(VImage right, VipsOption... args) Calculate dE CMC.double
deviate
(VipsOption... args) This operation finds the standard deviation of all pixels inin
.divide
(VImage right, VipsOption... args) This operation calculatesin1
/in2
and writes the result toout
.void
drawCircle
(List<Double> ink, int cx, int cy, int radius, VipsOption... args) Draws a circle onimage
.void
drawFlood
(List<Double> ink, int x, int y, VipsOption... args) Flood-fillimage
withink
, starting at positionx
,y
.void
drawImage
(VImage sub, int x, int y, VipsOption... args) Drawsub
on top ofimage
at positionx
,y
.void
drawLine
(List<Double> ink, int x1, int y1, int x2, int y2, VipsOption... args) Draws a 1-pixel-wide line on an image.void
drawMask
(List<Double> ink, VImage mask, int x, int y, VipsOption... args) Drawmask
on the image.void
drawRect
(List<Double> ink, int left, int top, int width, int height, VipsOption... args) Paint pixels withinleft
,top
,width
,height
inimage
withink
.void
drawSmudge
(int left, int top, int width, int height, VipsOption... args) Smudge a section ofimage
.void
dzsave
(String filename, VipsOption... args) Save an image as a set of tiles at various resolutions.dzsaveBuffer
(VipsOption... args) Asdzsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
dzsaveTarget
(VTarget target, VipsOption... args) Asdzsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.embed
(int x, int y, int width, int height, VipsOption... args) The opposite ofextractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
: embedin
within an image of sizewidth
byheight
at positionx
,y
.boolean
extractArea
(int left, int top, int width, int height, VipsOption... args) Extract an area from an image.extractBand
(int band, VipsOption... args) Extract a band or bands from an image.eye
(int width, int height, VipsOption... args) Create a test pattern with increasing spatial frequency in X and amplitude in Y.falsecolour
(VipsOption... args) Forcein
to 1 band, 8-bit, then transform to a 3-band 8-bit image with a false colour map.fastcor
(VImage ref, VipsOption... args) Calculate a fast correlation surface.fillNearest
(VipsOption... args) Fill outwards from every non-zero pixel inin
, setting pixels indistance
andvalue
.int
findTrim
(VipsOption... args) Searchin
for the bounding box of the non-background area.fitsload
(String filename, VipsOption... args) Read a FITS image file into a VIPS image.fitsloadSource
(VSource source, VipsOption... args) Load FITS from a sourcevoid
fitssave
(String filename, VipsOption... args) Write a VIPS image to a file in FITS format.flatten
(VipsOption... args) Take the last band ofin
as an alpha and use it to blend the remaining channels withbackground
.flip
(VipsDirection direction, VipsOption... args) Flips an image left-right or up-down.float2rad
(VipsOption... args) Convert a three-band float image to Radiance 32-bit packed format.fractsurf
(int width, int height, double fractalDimension, VipsOption... args) Generate an image of sizewidth
byheight
and fractal dimensionfractalDimension
.freqmult
(VImage mask, VipsOption... args) Multiplyin
bymask
in Fourier space.fwfft
(VipsOption... args) Transform an image to Fourier space.gamma
(VipsOption... args) Calculatein
** (1 /exponent
), normalising to the maximum range of the input type.gaussblur
(double sigma, VipsOption... args) This operator runsgaussmat(double, double, app.photofox.vipsffm.VipsOption...)
andconvsep(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for you on an image.gaussmat
(double sigma, double minAmpl, VipsOption... args) Creates a circularly symmetric Gaussian image of radiussigma
.gaussnoise
(int width, int height, VipsOption... args) Make a one band float image of gaussian noise with the specified distribution.int
getpoint
(int x, int y, VipsOption... args) Reads a single pixel on an image.Deprecated, for removal: This API element is subject to removal in a future version.Gets the rawMemorySegment
(C pointer) for this VipsImage struct The memory address' lifetime is bound to the scope of thearena
Usage of the memory address is strongly discouraged, but it is available if some functionality is missing and you need to use it withVipsHelper
int
getWidth()
gifload
(String filename, VipsOption... args) Read a GIF file into a libvips image.gifloadBuffer
(VBlob buffer, VipsOption... args) Exactly asgifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.gifloadSource
(VSource source, VipsOption... args) Exactly asgifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
gifsave
(String filename, VipsOption... args) Write to a file in GIF format.gifsaveBuffer
(VipsOption... args) Asgifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
gifsaveTarget
(VTarget target, VipsOption... args) Asgifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.globalbalance
(VipsOption... args) globalbalance
can be used to remove contrast differences in an assembled mosaic.gravity
(VipsCompassDirection direction, int width, int height, VipsOption... args) The opposite ofextractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
: placein
within an image of sizewidth
byheight
at a certain gravity.grey
(int width, int height, VipsOption... args) Create a one-band float image with the left-most column zero and the right-most 1.grid
(int tileHeight, int across, int down, VipsOption... args) Chop a tall thin image up into a set of tiles, lay the tiles out in a grid.boolean
hasAlpha()
int
hashCode()
heifload
(String filename, VipsOption... args) Read a HEIF image file into a VIPS image.heifloadBuffer
(VBlob buffer, VipsOption... args) Read a HEIF image file into a VIPS image.heifloadSource
(VSource source, VipsOption... args) Exactly asheifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
heifsave
(String filename, VipsOption... args) Write a VIPS image to a file in HEIF format.heifsaveBuffer
(VipsOption... args) Asheifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
heifsaveTarget
(VTarget target, VipsOption... args) Asheifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.histCum
(VipsOption... args) Form cumulative histogram.double
histEntropy
(VipsOption... args) Estimate image entropy from a histogram.histEqual
(VipsOption... args) Histogram-equalisein
.histFind
(VipsOption... args) Find the histogram ofin
.histFindIndexed
(VImage index, VipsOption... args) Make a histogram ofin
, but use imageindex
to pick the bins.histFindNdim
(VipsOption... args) Make a one, two or three dimensional histogram of a 1, 2 or 3 band image.boolean
histIsmonotonic
(VipsOption... args) Testin
for monotonicity.histLocal
(int width, int height, VipsOption... args) Performs local histogram equalisation onin
using a window of sizewidth
byheight
centered on the input pixel.histMatch
(VImage ref, VipsOption... args) Adjustin
to matchref
.histNorm
(VipsOption... args) Normalise histogram.histPlot
(VipsOption... args) Plot a 1 by any or any by 1 image file as a max by any or any by max image using these rules:houghCircle
(VipsOption... args) Find the circular Hough transform of an image.houghLine
(VipsOption... args) Find the line Hough transform forin
.HSV2sRGB
(VipsOption... args) Convert HSV to sRGB.iccExport
(VipsOption... args) Export an image from D65 LAB to device space with an ICC profile.iccImport
(VipsOption... args) Import an image from device space to D65 LAB with an ICC profile.iccTransform
(String outputProfile, VipsOption... args) Transform an image with a pair of ICC profiles.identity
(VipsOption... args) Creates an identity lookup table, ie.ifthenelse
(VImage in1, VImage in2, VipsOption... args) This operation scans the condition imagecond
and uses it to select pixels from either the then imagein1
or the else imagein2
.insert
(VImage sub, int x, int y, VipsOption... args) Insertsub
intomain
at positionx
,y
.invert
(VipsOption... args) For unsigned formats, this operation calculates (max -in
), eg.invertlut
(VipsOption... args) Given a mask of target values and real values, generate a LUT which will map reals to targets.invfft
(VipsOption... args) Transform an image from Fourier space to real space.join
(VImage in2, VipsDirection direction, VipsOption... args) Joinin1
andin2
together, left-right or up-down depending on the value ofdirection
.jp2kload
(String filename, VipsOption... args) Read a JPEG2000 image.jp2kloadBuffer
(VBlob buffer, VipsOption... args) Exactly asjp2kload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a buffer.jp2kloadSource
(VSource source, VipsOption... args) Exactly asjp2kload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
jp2ksave
(String filename, VipsOption... args) Write a VIPS image to a file in JPEG2000 format.jp2ksaveBuffer
(VipsOption... args) Asjp2ksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.void
jp2ksaveTarget
(VTarget target, VipsOption... args) Asjp2ksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.jpegload
(String filename, VipsOption... args) Read a JPEG file into a VIPS image.jpegloadBuffer
(VBlob buffer, VipsOption... args) Read a JPEG-formatted memory block into a VIPS image.jpegloadSource
(VSource source, VipsOption... args) Read a JPEG-formatted memory block into a VIPS image.void
jpegsave
(String filename, VipsOption... args) Write a VIPS image to a file as JPEG.jpegsaveBuffer
(VipsOption... args) Asjpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
jpegsaveMime
(VipsOption... args) Asjpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save as a mime jpeg on stdout.void
jpegsaveTarget
(VTarget target, VipsOption... args) Asjpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.jxlload
(String filename, VipsOption... args) Read a JPEG-XL image.jxlloadBuffer
(VBlob buffer, VipsOption... args) Exactly asjxlload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a buffer.jxlloadSource
(VSource source, VipsOption... args) Exactly asjxlload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
jxlsave
(String filename, VipsOption... args) Write a VIPS image to a file in JPEG-XL format.jxlsaveBuffer
(VipsOption... args) Asjxlsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
jxlsaveTarget
(VTarget target, VipsOption... args) Asjxlsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.Lab2LabQ
(VipsOption... args) Convert a Lab three-band float image to LabQ (VipsCoding.CODING_LABQ
).Lab2LabS
(VipsOption... args) Turn Lab to LabS, signed 16-bit int fixed point.Lab2LCh
(VipsOption... args) Turn Lab to LCh.Lab2XYZ
(VipsOption... args) Turn Lab to XYZ.labelregions
(VipsOption... args) Repeatedly scansin
for regions of 4-connected pixels with the same pixel value.LabQ2Lab
(VipsOption... args) Unpack a LabQ (VipsCoding.CODING_LABQ
) image to a three-band float image.LabQ2LabS
(VipsOption... args) Unpack a LabQ (VipsCoding.CODING_LABQ
) image to a three-band short image.LabQ2sRGB
(VipsOption... args) Unpack a LabQ (VipsCoding.CODING_LABQ
) image to a three-band short image.LabS2Lab
(VipsOption... args) Convert a LabS three-band signed short image to a three-band float image.LabS2LabQ
(VipsOption... args) Convert a LabS three-band signed short image to LabQLCh2CMC
(VipsOption... args) Turn LCh to CMC.LCh2Lab
(VipsOption... args) Turn LCh to Lab.Pass an image through a linear transform, ie.linecache
(VipsOption... args) This operation behaves rather likecopy(app.photofox.vipsffm.VipsOption...)
between imagesin
andout
, except that it keeps a cache of computed scanlines.logmat
(double sigma, double minAmpl, VipsOption... args) Creates a circularly symmetric Laplacian of Gaussian mask of radiussigma
.magickload
(String filename, VipsOption... args) Read in an image using libMagick, the ImageMagick library.magickloadBuffer
(VBlob buffer, VipsOption... args) Read an image memory block using libMagick into a VIPS image.void
magicksave
(String filename, VipsOption... args) Write an image using libMagick.void
magicksaveBmp
(String filename, VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.magicksaveBmpBuffer
(VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.magicksaveBuffer
(VipsOption... args) Asmagicksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.mapim
(VImage index, VipsOption... args) This operator resamplesin
usingindex
to look up pixels.maplut
(VImage lut, VipsOption... args) Map an image through another image acting as a LUT (Look Up Table).maskButterworth
(int width, int height, double order, double frequencyCutoff, double amplitudeCutoff, VipsOption... args) Make an butterworth high- or low-pass filter, that is, one with a variable, smooth transition positioned atfrequencyCutoff
, wherefrequencyCutoff
is in range 0 - 1.maskButterworthBand
(int width, int height, double order, double frequencyCutoffX, double frequencyCutoffY, double radius, double amplitudeCutoff, VipsOption... args) Make an butterworth band-pass or band-reject filter, that is, one with a variable, smooth transition positioned atfrequencyCutoffX
,frequencyCutoffY
, of radiusradius
.maskButterworthRing
(int width, int height, double order, double frequencyCutoff, double amplitudeCutoff, double ringwidth, VipsOption... args) Make a butterworth ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned atfrequencyCutoff
of widthwidth
, wherefrequencyCutoff
is in the range 0 - 1.maskFractal
(int width, int height, double fractalDimension, VipsOption... args) This operation should be used to create fractal images by filtering the power spectrum of Gaussian white noise.maskGaussian
(int width, int height, double frequencyCutoff, double amplitudeCutoff, VipsOption... args) Make a gaussian high- or low-pass filter, that is, one with a variable, smooth transition positioned atfrequencyCutoff
.maskGaussianBand
(int width, int height, double frequencyCutoffX, double frequencyCutoffY, double radius, double amplitudeCutoff, VipsOption... args) Make a gaussian band-pass or band-reject filter, that is, one with a variable, smooth transition positioned atfrequencyCutoffX
,frequencyCutoffY
, of radiusradius
.maskGaussianRing
(int width, int height, double frequencyCutoff, double amplitudeCutoff, double ringwidth, VipsOption... args) Make a gaussian ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned atfrequencyCutoff
of widthringwidth
.maskIdeal
(int width, int height, double frequencyCutoff, VipsOption... args) Make an ideal high- or low-pass filter, that is, one with a sharp cutoff positioned atfrequencyCutoff
, wherefrequencyCutoff
is in the range 0 - 1.maskIdealBand
(int width, int height, double frequencyCutoffX, double frequencyCutoffY, double radius, VipsOption... args) Make an ideal band-pass or band-reject filter, that is, one with a sharp cutoff around the pointfrequencyCutoffX
,frequencyCutoffY
, of sizeradius
.maskIdealRing
(int width, int height, double frequencyCutoff, double ringwidth, VipsOption... args) Make an ideal ring-pass or ring-reject filter, that is, one with a sharp ring positioned atfrequencyCutoff
of widthwidth
, wherefrequencyCutoff
andwidth
are expressed as the range 0 - 1.match
(VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VipsOption... args) Scale, rotate and translatesec
so that the tie-points line up.math
(VipsOperationMath math, VipsOption... args) Perform various functions in -lm, the maths library, on images.math2
(VImage right, VipsOperationMath2 math2, VipsOption... args) This operation calculates a 2-ary maths operation on a pair of images and writes the result toout
.math2Const
(VipsOperationMath2 math2, List<Double> c, VipsOption... args) This operation calculates various 2-ary maths operations on an image and an array of constants and writes the result toout
.matload
(String filename, VipsOption... args) Read a Matlab save file into a VIPS image.matrixinvert
(VipsOption... args) This operation calculates the inverse of the matrix represented inm
.matrixload
(String filename, VipsOption... args) Reads a matrix from a file.matrixloadSource
(VSource source, VipsOption... args) Exactly asmatrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
matrixprint
(VipsOption... args) Printin
tostdout
in matrix format.void
matrixsave
(String filename, VipsOption... args) Writein
tofilename
in matrix format.void
matrixsaveTarget
(VTarget target, VipsOption... args) Asmatrixsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.double
max
(VipsOption... args) This operation finds the maximum value in an image.maxpair
(VImage right, VipsOption... args) For each pixel, pick the maximum of a pair of images.measure
(int h, int v, VipsOption... args) Analyse a grid of colour patches, producing an array of patch averages.merge
(VImage sec, VipsDirection direction, int dx, int dy, VipsOption... args) This operation joins two images left-right (withref
on the left) or up-down (withref
above) with a smooth seam.double
min
(VipsOption... args) This operation finds the minimum value in an image.minpair
(VImage right, VipsOption... args) For each pixel, pick the minimum of a pair of images.morph
(VImage mask, VipsOperationMorphology morph, VipsOption... args) Performs a morphological operation onin
usingmask
as a structuring element.mosaic
(VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VipsOption... args) This operation joins two images left-right (withref
on the left) or top-bottom (withref
above) given an approximate overlap.mosaic1
(VImage sec, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VipsOption... args) This operation joins two images top-bottom (withsec
on the right) or left-right (withsec
at the bottom) given an approximate pair of tie-points.msb
(VipsOption... args) Turn any integer image to 8-bit unsigned char by discarding all but the most significant byte.multiply
(VImage right, VipsOption... args) This operation calculatesleft
*right
and writes the result toout
.static VImage
newFromBytes
(Arena arena, byte[] bytes, VipsOption... options) static VImage
newFromBytes
(Arena arena, byte[] bytes, String optionString, VipsOption... options) Creates a new VImage from raw bytes.static VImage
newFromFile
(Arena arena, String path, VipsOption... options) static VImage
newFromSource
(Arena arena, VSource source, VipsOption... options) static VImage
newFromSource
(Arena arena, VSource source, String optionString, VipsOption... options) static VImage
newFromStream
(Arena arena, InputStream stream, VipsOption... options) static VImage
newFromStream
(Arena arena, InputStream stream, String optionString, VipsOption... options) Creates a new VImage from anInputStream
.static VImage
openexrload
(String filename, VipsOption... args) Read a OpenEXR file into a VIPS image.openslideload
(String filename, VipsOption... args) Read a virtual slide supported by the OpenSlide library into a VIPS image.openslideloadSource
(VSource source, VipsOption... args) Exactly asopenslideload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
pbmsaveTarget
(VTarget target, VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.pdfload
(String filename, VipsOption... args) Render a PDF file into a VIPS image.pdfloadBuffer
(VBlob buffer, VipsOption... args) Read a PDF-formatted memory buffer into a VIPS image.pdfloadSource
(VSource source, VipsOption... args) Exactly aspdfload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.int
percent
(double percent, VipsOption... args) percent
returns (through thethreshold
parameter) the threshold below which there arepercent
values ofin
.perlin
(int width, int height, VipsOption... args) Create a one-band float image of Perlin noise.void
pfmsaveTarget
(VTarget target, VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.void
pgmsaveTarget
(VTarget target, VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.phasecor
(VImage in2, VipsOption... args) Convert the two input images to Fourier space, calculate phase-correlation, back to real space.pngload
(String filename, VipsOption... args) Read a PNG file into a VIPS image.pngloadBuffer
(VBlob buffer, VipsOption... args) Exactly aspngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a PNG-formatted memory block.pngloadSource
(VSource source, VipsOption... args) Exactly aspngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
pngsave
(String filename, VipsOption... args) Write a VIPS image to a file as PNG.pngsaveBuffer
(VipsOption... args) Aspngsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
pngsaveTarget
(VTarget target, VipsOption... args) Aspngsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.void
pnmsaveTarget
(VTarget target, VipsOption... args) Deprecated, for removal: This API element is subject to removal in a future version.ppmload
(String filename, VipsOption... args) Read a PPM/PBM/PGM/PFM file into a VIPS image.ppmloadSource
(VSource source, VipsOption... args) Exactly asppmload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
ppmsave
(String filename, VipsOption... args) Write a VIPS image to a file as PPM.void
ppmsaveTarget
(VTarget target, VipsOption... args) Asppmsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.premultiply
(VipsOption... args) Premultiplies any alpha channel.prewitt
(VipsOption... args) Prewitt edge detector.profile
(VipsOption... args) profile
searches inward from the edge ofin
and finds the first non-zero pixel.project
(VipsOption... args) Find the horizontal and vertical projections of an image, ie.quadratic
(VImage coeff, VipsOption... args) This operation is unfinished and unusable, sorry.rad2float
(VipsOption... args) Unpack a RAD (VipsCoding.CODING_RAD
) image to a three-band float image.radload
(String filename, VipsOption... args) Read a Radiance (HDR) file into a VIPS image.radloadBuffer
(VBlob buffer, VipsOption... args) Exactly asradload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a HDR-formatted memory block.radloadSource
(VSource source, VipsOption... args) Exactly asradload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
radsave
(String filename, VipsOption... args) Write a VIPS image in Radiance (HDR) format.radsaveBuffer
(VipsOption... args) Asradsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
radsaveTarget
(VTarget target, VipsOption... args) Asradsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.rank
(int width, int height, int index, VipsOption... args) rank
does rank filtering on an image.rawload
(String filename, int width, int height, int bands, VipsOption... args) This operation mmaps the file, setting upout
so that access to that image will read from the file.void
rawsave
(String filename, VipsOption... args) Writes the pixels inin
to the filefilename
with no header or other metadata.rawsaveBuffer
(VipsOption... args) Asrawsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
rawsaveTarget
(VTarget target, VipsOption... args) Asrawsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.recomb
(VImage m, VipsOption... args) This operation recombines an image's bands.reduce
(double xshrink, double hshrink, double yshrink, double vshrink, VipsOption... args) Reducein
by a pair of factors with a pair of 1D kernels.reduceh
(double xshrink, double hshrink, VipsOption... args) Reducein
horizontally by a float factor.reducev
(double yshrink, double vshrink, VipsOption... args) Reducein
vertically by a float factor.relational
(VImage right, VipsOperationRelational relational, VipsOption... args) Perform various relational operations on pairs of images.relationalConst
(VipsOperationRelational relational, List<Double> c, VipsOption... args) Perform various relational operations on an image and an array of constants.remainder
(VImage right, VipsOption... args) This operation calculatesleft
%right
(remainder after integer division) and writes the result toout
.remainderConst
(List<Double> c, VipsOption... args) This operation calculatesin
%c
(remainder after division by an array of constants) and writes the result toout
.replicate
(int across, int down, VipsOption... args) Repeats an image many times.resize
(double scale, VipsOption... args) Resize an image.rot
(VipsAngle angle, VipsOption... args) Rotatein
by a multiple of 90 degrees.rot45
(VipsOption... args) Rotatein
by a multiple of 45 degrees.rotate
(double angle, VipsOption... args) This operator callsaffine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
for you, calculating the matrix for the affine transform fromscale
andangle
.round
(VipsOperationRound round, VipsOption... args) Round to an integral value.scale
(VipsOption... args) 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.scharr
(VipsOption... args) Scharr edge detector.scRGB2BW
(VipsOption... args) Convert an scRGB image to greyscale.scRGB2sRGB
(VipsOption... args) Convert an scRGB image to sRGB.scRGB2XYZ
(VipsOption... args) Turn XYZ to scRGB.sdf
(int width, int height, VipsSdfShape shape, VipsOption... args) Create a signed distance field (SDF) image of the given shape.sequential
(VipsOption... args) This operation behaves rather likecopy(app.photofox.vipsffm.VipsOption...)
between imagesin
andout
, except that it checks that pixels onin
are only requested top-to-bottom.sharpen
(VipsOption... args) Selectively sharpen the L channel of a LAB image.shrink
(double xshrink, double hshrink, double yshrink, double vshrink, VipsOption... args) Shrinkin
by a pair of factors with a simple box filter.shrinkh
(int xshrink, int hshrink, VipsOption... args) Shrinkin
horizontally by an integer factor.shrinkv
(int yshrink, int vshrink, VipsOption... args) Shrinkin
vertically by an integer factor.sign
(VipsOption... args) Finds the unit vector in the direction of the pixel value.similarity
(VipsOption... args) This operator callsaffine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
for you, calculating the matrix for the affine transform fromscale
andangle
.sines
(int width, int height, VipsOption... args) Creates a float one band image of the a sine waveform in two dimensions.smartcrop
(int width, int height, VipsOption... args) Crop an image down to a specified width and height by removing boring parts.sobel
(VipsOption... args) Sobel edge detector.spcor
(VImage ref, VipsOption... args) Calculate a correlation surface.spectrum
(VipsOption... args) Make a displayable (ie.sRGB2HSV
(VipsOption... args) Convert to HSV.sRGB2scRGB
(VipsOption... args) Convert an sRGB image to scRGB.stats
(VipsOption... args) Find many image statistics in a single pass through the data.stdif
(int width, int height, VipsOption... args) 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
(int xfac, int yfac, VipsOption... args) Subsample an image by an integer fraction.subtract
(VImage right, VipsOption... args) This operation calculatesin1
-in2
and writes the result toout
.sum
(List<VImage> in, VipsOption... args) This operation sums all images inin
and writes the result toout
.svgload
(String filename, VipsOption... args) Render a SVG file into a VIPS image.svgloadBuffer
(VBlob buffer, VipsOption... args) Read a SVG-formatted memory block into a VIPS image.svgloadSource
(VSource source, VipsOption... args) Exactly assvgload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.switch1
(List<VImage> tests, VipsOption... args) Thetests
images are evaluated and at each point the index of the first non-zero value is written toout
.text
(String text, VipsOption... args) Draw the stringtext
to an image.thumbnail
(String filename, int width, VipsOption... args) Make a thumbnail from a file.thumbnailBuffer
(VBlob buffer, int width, VipsOption... args) Exactly asthumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.thumbnailImage
(int width, VipsOption... args) Exactly asthumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
, but read from an existing image.thumbnailSource
(VSource source, int width, VipsOption... args) Exactly asthumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
, but read from a source.tiffload
(String filename, VipsOption... args) Read a TIFF file into a VIPS image.tiffloadBuffer
(VBlob buffer, VipsOption... args) Read a TIFF-formatted memory block into a VIPS image.tiffloadSource
(VSource source, VipsOption... args) Exactly astiffload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
tiffsave
(String filename, VipsOption... args) Write a VIPS image to a file as TIFF.tiffsaveBuffer
(VipsOption... args) Astiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
tiffsaveTarget
(VTarget target, VipsOption... args) Astiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.tilecache
(VipsOption... args) This operation behaves rather likecopy(app.photofox.vipsffm.VipsOption...)
between imagesin
andout
, except that it keeps a cache of computed pixels.tonelut
(VipsOption... args) tonelut
generates a tone curve for the adjustment of image levels.transpose3d
(VipsOption... args) Transpose a volumetric image.unpremultiply
(VipsOption... args) Unpremultiplies any alpha channel.vipsload
(String filename, VipsOption... args) Read in a vips image.vipsloadSource
(VSource source, VipsOption... args) Exactly asvipsload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
vipssave
(String filename, VipsOption... args) Writein
tofilename
in VIPS format.void
vipssaveTarget
(VTarget target, VipsOption... args) Asvipssave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.webpload
(String filename, VipsOption... args) Read a WebP file into a VIPS image.webploadBuffer
(VBlob buffer, VipsOption... args) Read a WebP-formatted memory block into a VIPS image.webploadSource
(VSource source, VipsOption... args) Exactly aswebpload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.void
webpsave
(String filename, VipsOption... args) Write an image to a file in WebP format.webpsaveBuffer
(VipsOption... args) Aswebpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.void
webpsaveMime
(VipsOption... args) Aswebpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save as a mime webp on stdout.void
webpsaveTarget
(VTarget target, VipsOption... args) Aswebpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.worley
(int width, int height, VipsOption... args) Create a one-band float image of Worley noise.wrap
(VipsOption... args) Slice an image up and move the segments about so that the pixel that was at 0, 0 is now atx
,y
.void
writeToFile
(String path, VipsOption... options) void
writeToStream
(OutputStream stream, String suffix, VipsOption... options) Writes this VImage to anOutputStream
.void
writeToTarget
(VTarget target, String suffix, VipsOption... options) xyz
(int width, int height, VipsOption... args) 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.XYZ2CMYK
(VipsOption... args) Turn XYZ to CMYK.XYZ2Lab
(VipsOption... args) Turn XYZ to Lab, optionally specifying the colour temperature.XYZ2scRGB
(VipsOption... args) Turn XYZ to scRGB.XYZ2Yxy
(VipsOption... args) Turn XYZ to Yxy.Yxy2XYZ
(VipsOption... args) Turn XYZ to Yxy.zone
(int width, int height, VipsOption... args) Create a one-band image of a zone plate.zoom
(int xfac, int yfac, VipsOption... args) Zoom an image by repeating pixels.
-
Method Details
-
hashCode
-
equals
-
getUnsafeAddress
Deprecated, for removal: This API element is subject to removal in a future version. -
getUnsafeStructAddress
Gets the rawMemorySegment
(C pointer) for this VipsImage struct The memory address' lifetime is bound to the scope of thearena
Usage of the memory address is strongly discouraged, but it is available if some functionality is missing and you need to use it withVipsHelper
-
CMC2LCh
Turn LCh to CMC.
See also:
LCh2CMC(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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.
Conversion is to D65 XYZ with relative intent. If you need more control over the process, use
iccImport(app.photofox.vipsffm.VipsOption...)
instead.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
HSV2sRGB
Convert HSV to sRGB.
HSV is a crude polar coordinate system for RGB images. It is provided for compatibility with other image processing systems. See
Lab2LCh(app.photofox.vipsffm.VipsOption...)
for a much better colour space.See also:
sRGB2HSV(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
LCh2CMC
Turn LCh to CMC.
The CMC colourspace is described in "Uniform Colour Space Based on the CMC(l:c) Colour-difference Formula", M R Luo and B Rigg, Journal of the Society of Dyers and Colourists, vol 102, 1986. Distances in this colourspace approximate, within 10% or so, differences in the CMC(l:c) colour difference formula.
This operation generates CMC(1:1). For CMC(2:1), halve Lucs and double Cucs.
See also:
CMC2LCh(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
LCh2Lab
Turn LCh to Lab.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
Lab2LCh
Turn Lab to LCh.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
Lab2LabQ
Convert a Lab three-band float image to LabQ (
VipsCoding.CODING_LABQ
).See also:
LabQ2Lab(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
Lab2LabS
Turn Lab to LabS, signed 16-bit int fixed point.
See also:
LabQ2Lab(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
Lab2XYZ
Turn Lab to XYZ. The colour temperature defaults to D65, but can be specified with
temp
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- temp
VipsOption.ArrayDouble
Color temperature
-
LabQ2Lab
Unpack a LabQ (
VipsCoding.CODING_LABQ
) image to a three-band float image.See also:
LabQ2Lab
,LabQ2LabS(app.photofox.vipsffm.VipsOption...)
,rad2float(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
LabQ2LabS
Unpack a LabQ (
VipsCoding.CODING_LABQ
) image to a three-band short image.See also:
LabS2LabQ(app.photofox.vipsffm.VipsOption...)
,LabQ2LabS
,rad2float(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
LabQ2sRGB
Unpack a LabQ (
VipsCoding.CODING_LABQ
) image to a three-band short image.See also:
LabS2LabQ(app.photofox.vipsffm.VipsOption...)
,LabQ2sRGB
,rad2float(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
LabS2Lab
Convert a LabS three-band signed short image to a three-band float image.
See also:
LabS2Lab
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
LabS2LabQ
Convert a LabS three-band signed short image to LabQ
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
XYZ2CMYK
Turn XYZ to CMYK.
Conversion is from D65 XYZ with relative intent. If you need more control over the process, use
iccExport(app.photofox.vipsffm.VipsOption...)
instead.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
XYZ2Lab
Turn XYZ to Lab, optionally specifying the colour temperature.
temp
defaults to D65.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- temp
VipsOption.ArrayDouble
Colour temperature
-
XYZ2Yxy
Turn XYZ to Yxy.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
XYZ2scRGB
Turn XYZ to scRGB.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
Yxy2XYZ
Turn XYZ to Yxy.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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(3)
for float types, and calculates modulus for complex types.See also:
sign(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
add
This operation calculates
in1
+in2
and writes the result toout
.If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), then the following table is used to determine the output type:<table> <title>VipsAdd type promotion</title> <tgroup cols='2' align='left' colsep='1' rowsep='1'> <thead> <row> <entry>input type</entry> <entry>output type</entry> </row> </thead> <tbody> <row> <entry>uchar</entry> <entry>ushort</entry> </row> <row> <entry>char</entry> <entry>short</entry> </row> <row> <entry>ushort</entry> <entry>uint</entry> </row> <row> <entry>short</entry> <entry>int</entry> </row> <row> <entry>uint</entry> <entry>uint</entry> </row> <row> <entry>int</entry> <entry>int</entry> </row> <row> <entry>float</entry> <entry>float</entry> </row> <row> <entry>double</entry> <entry>double</entry> </row> <row> <entry>complex</entry> <entry>complex</entry> </row> <row> <entry>double complex</entry> <entry>double complex</entry> </row> </tbody> </tgroup> </table>
In other words, the output type is just large enough to hold the whole range of possible values.
See also:
subtract(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,linear(java.util.List<java.lang.Double>, java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
addalpha
Append an alpha channel.
See also:
vips_image_hasalpha
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
affine
This operator performs an affine transform on an image using
interpolate
.The transform is:
X = {@code a} * (x + {@code idx}) + {@code b} * (y + {@code idy}) + {@code odx} Y = {@code c} * (x + {@code idx}) + {@code d} * (y + {@code idy}) + {@code doy} where: x and y are the coordinates in input image. X and Y are the coordinates in output image. (0,0) is the upper left corner.
The section of the output space defined by
oarea
is written toout
.oarea
is a four-element int array of left, top, width, height. By defaultoarea
is just large enough to cover the whole of the transformed input image.By default, new pixels are filled with
background
. This defaults to zero (black). You can set other extend types withextend
.VipsExtend.EXTEND_COPY
is better for image upsizing.interpolate
defaults to bilinear.idx
,idy
,odx
,ody
default to zero.Image are normally treated as unpremultiplied, so this operation can be used directly on PNG images. If your images have been through
premultiply(app.photofox.vipsffm.VipsOption...)
, setpremultiplied
.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,VipsInterpolate
.- Parameters:
matrix
- Transformation matrixargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- interpolate
VipsOption.Interpolate
Interpolate pixels with this, oareaVipsOption.ArrayInt
Area of output to generate, odxVipsOption.Double
Horizontal output displacement, odyVipsOption.Double
Vertical output displacement, idxVipsOption.Double
Horizontal input displacement, idyVipsOption.Double
Vertical input displacement, backgroundVipsOption.ArrayDouble
Background value, premultipliedVipsOption.Boolean
Images have premultiplied alpha, extendVipsOption.Enum
VipsExtend
How to generate the extra pixels
-
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".Images are loaded lazilly and byte-swapped, if necessary. The Analyze metadata is read and attached.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
arrayjoin
Lay out the images in
in
in a grid. The grid isacross
images across and however high is necessary to use up all ofin
. Images are set down left-to-right and top-to-bottom.across
defaults ton
.Each input image is placed with a box of size
hspacing
byvspacing
pixels and cropped. These default to the largest width and largest height of the input images.Space between images is filled with
background
. This defaults to 0 (black).Images are positioned within their
hspacing
byvspacing
box at low, centre or high coordinate values, controlled byhalign
andvalign
. These default to left-top.Boxes are joined and separated by
shim
pixels. This defaults to 0.If the number of bands in the input images differs, all but one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the n-band images are operated upon.
The input images are cast up to the smallest common type (see table Smallest common format in
arithmetic
).colourspace(app.photofox.vipsffm.enums.VipsInterpretation, app.photofox.vipsffm.VipsOption...)
can be useful for moving the images to a common colourspace for compositing.See also:
join(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
,colourspace(app.photofox.vipsffm.enums.VipsInterpretation, app.photofox.vipsffm.VipsOption...)
.- Parameters:
in
- Array of input imagesargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- across
VipsOption.Int
Number of images across grid, shimVipsOption.Int
Pixels between images, backgroundVipsOption.ArrayDouble
Colour for new pixels, halignVipsOption.Enum
VipsAlign
Align on the left, centre or right, valignVipsOption.Enum
VipsAlign
Align on the top, centre or bottom, hspacingVipsOption.Int
Horizontal spacing between images, vspacingVipsOption.Int
Vertical spacing between images
-
autorot
Look at the image metadata and rotate and flip the image to make it upright. The
VIPS_META_ORIENTATION
tag is removed fromout
to prevent accidental double rotation.Read
angle
to find the amount the image was rotated by. Readflip
to see if the image was also flipped.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- angle
VipsOption.Enum
VipsAngle
Angle image was rotated by, flipVipsOption.Boolean
Whether the image was flipped or not
-
avg
This operation finds the average value in an image. It operates on all bands of the input image: use
stats(app.photofox.vipsffm.VipsOption...)
if you need to calculate an average for each band. For complex images, return the average modulus.See also:
stats(app.photofox.vipsffm.VipsOption...)
,bandmean(app.photofox.vipsffm.VipsOption...)
,deviate(app.photofox.vipsffm.VipsOption...)
,rank(int, int, int, app.photofox.vipsffm.VipsOption...)
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
avifsaveTarget
@Deprecated(forRemoval=true) public void avifsaveTarget(VTarget target, VipsOption... args) throws VipsError Deprecated, for removal: This API element is subject to removal in a future version.Save image in AVIF format- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, bitdepthVipsOption.Int
Number of bits per pixel, losslessVipsOption.Boolean
Enable lossless compression, compressionVipsOption.Enum
VipsForeignHeifCompression
Compression format, effortVipsOption.Int
CPU effort, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, speedVipsOption.Int
CPU effort, encoderVipsOption.Enum
VipsForeignHeifEncoder
Select encoder to use, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
bandbool
Perform various boolean operations across the bands of an image. For example, a three-band uchar image operated on with
VipsOperationBoolean.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.The output image is the same format as the input image for integer types. Float types are cast to int before processing. Complex types are not supported.
The output image always has one band.
This operation is useful in conjunction with
relational(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationRelational, app.photofox.vipsffm.VipsOption...)
. You can use it to see if all image bands match exactly.- Parameters:
boolean1
-VipsOperationBoolean
Boolean to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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.See also:
csvload(java.lang.String, app.photofox.vipsffm.VipsOption...)
,bandunfold(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- factor
VipsOption.Int
Fold by this factor
-
bandjoin
Join a set of images together, bandwise.
If the images have n and m bands, then the output image will have n + m bands, with the first n coming from the first image and the last m from the second.
If the images differ in size, the smaller images are enlarged to match the larger by adding zero pixels along the bottom and right.
The input images are cast up to the smallest common type (see table Smallest common format in
arithmetic
).See also:
insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
in
- Array of input imagesargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
bandjoinConst
Append a set of constant bands to an image.
See also:
bandjoin(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
c
- Array of constants to addargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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.
See also:
add(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,avg(app.photofox.vipsffm.VipsOption...)
,recomb(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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, ifindex
is zero, then each output band element will be the minimum of all the corresponding input band elements.By default,
index
is -1, meaning pick the median value.It works for any uncoded, non-complex image type. Images are cast up to the smallest common-format.
Any image can have either 1 band or n bands, where n is the same for all the non-1-band images. Single band images are then effectively copied to make n-band images.
Smaller input images are expanded by adding black pixels.
See also:
rank(int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
in
- Array of input imagesargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- index
VipsOption.Int
Select this band element from sorted list
-
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.See also:
csvload(java.lang.String, app.photofox.vipsffm.VipsOption...)
,bandfold(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- factor
VipsOption.Int
Unfold by this factor
-
black
Make a black unsigned char image of a specified size.
See also:
xyz(int, int, app.photofox.vipsffm.VipsOption...)
,text(java.lang.String, app.photofox.vipsffm.VipsOption...)
,gaussnoise(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- bands
VipsOption.Int
Number of bands in image
-
boolean1
public VImage boolean1(VImage right, VipsOperationBoolean boolean1, VipsOption... args) throws VipsError Perform various boolean operations on pairs of images.
The output image is the same format as the upcast input images for integer types. Float types are cast to int before processing. Complex types are not supported.
If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
).- Parameters:
right
- Right-hand image argumentboolean1
-VipsOperationBoolean
Boolean to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
booleanConst
public VImage booleanConst(VipsOperationBoolean boolean1, List<Double> c, VipsOption... args) throws VipsError Perform various boolean operations on an image against an array of constants.
The output type is always uchar, with 0 for FALSE and 255 for TRUE.
If the array of constants has just one element, that constant is used for all image bands. If the array has more than one element and they have the same number of elements as there are bands in the image, then one array element is used for each band. If the arrays have more than one element and the image only has a single band, the result is a many-band image where each band corresponds to one array element.
See also:
boolean1(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationBoolean, app.photofox.vipsffm.VipsOption...)
,vips_boolean_const1
.- Parameters:
boolean1
-VipsOperationBoolean
Boolean to performc
- Array of constantsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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
VipsBandFormat.FORMAT_DOUBLE
, usecast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)
to change it to the type you need.For example, consider this 2 x 2 matrix of (x, y) coordinates: <tgroup cols='2' align='left' colsep='1' rowsep='1'> <tbody> <row> <entry>0</entry> <entry>0</entry> </row> <row> <entry>255</entry> <entry>100</entry> </row> </tbody> </tgroup>
We then generate a 1 x 256 element LUT like this: <tgroup cols='2' align='left' colsep='1' rowsep='1'> <thead> <row> <entry>Index</entry> <entry>Value</entry> </row> </thead> <tbody> <row> <entry>0</entry> <entry>0</entry> </row> <row> <entry>1</entry> <entry>0.4</entry> </row> <row> <entry>etc.</entry> <entry>0.4</entry> </row> <row> <entry>255</entry> <entry>100</entry> </row> </tbody> </tgroup>
This is then written as the output image, with the left column giving the index in the image to place the value.
The (x, y) points don't need to be sorted: we do that. You can have several Ys, each becomes a band in the output LUT. You don't need to start at zero, any integer will do, including negatives.
See also:
identity(app.photofox.vipsffm.VipsOption...)
,invertlut(app.photofox.vipsffm.VipsOption...)
,cast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)
,maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
byteswap
Swap the byte order in an image.
See also:
rawload(java.lang.String, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
cache
Deprecated, for removal: This API element is subject to removal in a future version.Cache an image- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- max-tiles
VipsOption.Int
Maximum number of tiles to cache, tile-heightVipsOption.Int
Tile height in pixels, tile-widthVipsOption.Int
Tile width in pixels
-
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.
Use
sigma
to control the scale over which gradient is measured. 1.4 is usually a good value.Use
precision
to set the precision of edge detection. For uchar images, setting this toVipsPrecision.PRECISION_INTEGER
will make edge detection much faster, but sacrifice some sensitivity.You will probably need to process the output further to eliminate weak edges.
See also:
sobel(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- sigma
VipsOption.Double
Sigma of Gaussian, precisionVipsOption.Enum
VipsPrecision
Convolve with this precision
-
case1
Use values in
index
to select pixels fromcases
.index
must have one band.cases
can have up to 256 elements. Values inindex
greater than or equal ton
use the final image incases
. The images incases
must have either one band or the same number of bands. The output image is the same size asindex
. Images incases
are expanded to the smallest common format and number of bands.Combine this with
switch1(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
to make something like a case statement or a multi-wayifthenelse(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.See also:
maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,switch1(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
,ifthenelse(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
cases
- Array of case imagesargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
cast
Convert
in
toformat
. You can convert between any pair of formats. Floats are truncated (not rounded). Out of range values are clipped.Casting from complex to real returns the real part.
If
shift
isTRUE
, integer values are shifted up and down. For example, casting from unsigned 8 bit to unsigned 16 bit would shift every value left by 8 bits. The bottom bit is copied into the new bits, so 255 would become 65535.See also:
scale(app.photofox.vipsffm.VipsOption...)
,complexform(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,vips_real
,vips_imag
,vips_cast_uchar
,msb(app.photofox.vipsffm.VipsOption...)
.- Parameters:
format
-VipsBandFormat
Format to cast toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- shift
VipsOption.Boolean
Shift integer values up and down
-
clamp
This operation clamps pixel values to a range, by default 0 - 1.
Use
min
andmax
to change the range.See also:
sign(app.photofox.vipsffm.VipsOption...)
,abs(app.photofox.vipsffm.VipsOption...)
,sdf(int, int, app.photofox.vipsffm.enums.VipsSdfShape, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- min
VipsOption.Double
Minimum value, maxVipsOption.Double
Maximum value
-
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 tospace
.For example, given an image tagged as
VipsInterpretation.INTERPRETATION_YXY
, runningcolourspace
withspace
set toVipsInterpretation.INTERPRETATION_LAB
will convert withYxy2XYZ(app.photofox.vipsffm.VipsOption...)
andXYZ2Lab(app.photofox.vipsffm.VipsOption...)
.See also:
vips_colourspace_issupported
,vips_image_guess_interpretation
.- Parameters:
space
-VipsInterpretation
Destination color spaceargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- source-space
VipsOption.Enum
VipsInterpretation
Source color space
-
compass
This convolves
in
withmask
times
times, rotatingmask
byangle
each time. By default, it comvolves twice, rotating by 90 degrees, taking the maximum result.See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- times
VipsOption.Int
Rotate and convolve this many times, angleVipsOption.Enum
VipsAngle45
Rotate mask by this much between convolutions, combineVipsOption.Enum
VipsCombine
Combine convolution results like this, precisionVipsOption.Enum
VipsPrecision
Convolve with this precision, layersVipsOption.Int
Use this many layers in approximation, clusterVipsOption.Int
Cluster lines closer than this in approximation
-
complex
Perform various operations on complex images.
Angles are expressed in degrees. The output type is complex unless the input is double or dpcomplex, in which case the output is dpcomplex.
- Parameters:
cmplx
-VipsOperationComplex
Complex to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
complex2
public VImage complex2(VImage right, VipsOperationComplex2 cmplx, VipsOption... args) throws VipsError Perform various binary operations on complex images.
Angles are expressed in degrees. The output type is complex unless the input is double or dpcomplex, in which case the output is dpcomplex.
- Parameters:
right
- Right-hand image argumentcmplx
-VipsOperationComplex2
Binary complex operation to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
complexform
Compose two real images to make a complex image. If either
left
orright
areVipsBandFormat.FORMAT_DOUBLE
,out
isVipsBandFormat.FORMAT_DPCOMPLEX
. Otherwiseout
isVipsBandFormat.FORMAT_COMPLEX
.left
becomes the real component ofout
andright
the imaginary.If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
See also:
complexget(app.photofox.vipsffm.enums.VipsOperationComplexget, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
complexget
Get components of complex images.
The output type is the same as the input type, except
VipsBandFormat.FORMAT_COMPLEX
becomesVipsBandFormat.FORMAT_FLOAT
andVipsBandFormat.FORMAT_DPCOMPLEX
becomesVipsBandFormat.FORMAT_DOUBLE
.- Parameters:
get
-VipsOperationComplexget
Complex to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
composite
Composite an array of images together.
Images are placed in a stack, with
in
[0] at the bottom andin
[n
- 1] at the top. Pixels are blended together working from the bottom upwards, with the blend mode at each step being set by the correspondingVipsBlendMode
inmode
.Images are transformed to a compositing space before processing. This is
VipsInterpretation.INTERPRETATION_sRGB
,VipsInterpretation.INTERPRETATION_B_W
,VipsInterpretation.INTERPRETATION_RGB16
, orVipsInterpretation.INTERPRETATION_GREY16
by default, depending on how many bands and bits the input images have. You can select any other space, such asVipsInterpretation.INTERPRETATION_LAB
orVipsInterpretation.INTERPRETATION_scRGB
.The output image is in the compositing space. It will always be
VipsBandFormat.FORMAT_FLOAT
unless one of the inputs isVipsBandFormat.FORMAT_DOUBLE
, in which case the output will be double as well.Complex images are not supported.
The output image will always have an alpha band. A solid alpha is added to any input missing an alpha.
The images do not need to match in size or format. The output image is always the size of
in
[0], with other images being positioned with thex
andy
parameters and clipped against that rectangle.Image are normally treated as unpremultiplied, so this operation can be used directly on PNG images. If your images have been through
premultiply(app.photofox.vipsffm.VipsOption...)
, setpremultiplied
.See also:
insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
in
- Array of input imagesmode
- Array of VipsBlendMode to join withargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- x
VipsOption.ArrayInt
Array of x coordinates to join at, yVipsOption.ArrayInt
Array of y coordinates to join at, compositing-spaceVipsOption.Enum
VipsInterpretation
Composite images in this colour space, premultipliedVipsOption.Boolean
Images have premultiplied alpha
-
composite2
Composite
overlay
on top ofbase
withmode
. Seecomposite(java.util.List<app.photofox.vipsffm.VImage>, java.util.List<java.lang.Integer>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
overlay
- Overlay imagemode
-VipsBlendMode
VipsBlendMode to join withargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- x
VipsOption.Int
X position of overlay, yVipsOption.Int
Y position of overlay, compositing-spaceVipsOption.Enum
VipsInterpretation
Composite images in this colour space, premultipliedVipsOption.Boolean
Images have premultiplied alpha
-
conv
Convolution.
Perform a convolution of
in
withmask
. Each output pixel is calculated as:sigma[i]{pixel[i] * mask[i]} / scale + offset
where scale and offset are part of
mask
.By default,
precision
isVipsPrecision.PRECISION_FLOAT
. The output image is alwaysVipsBandFormat.FORMAT_FLOAT
unlessin
isVipsBandFormat.FORMAT_DOUBLE
, in which caseout
is alsoVipsBandFormat.FORMAT_DOUBLE
.If
precision
isVipsPrecision.PRECISION_INTEGER
, then elements ofmask
are converted to integers before convolution, using rint(), and the output image always has the sameVipsBandFormat
as the input image.For
VipsBandFormat.FORMAT_UCHAR
images andVipsPrecision.PRECISION_INTEGER
precision
,conv
uses a fast vector path based on half-float arithmetic. This can produce slightly different results. Disable the vector path with `--vips-novector` or `VIPS_NOVECTOR` orvips_vector_set_enabled
.If
precision
isVipsPrecision.PRECISION_APPROXIMATE
then, likeVipsPrecision.PRECISION_INTEGER
,mask
is converted to int before convolution, and the output image always has the sameVipsBandFormat
as the input image.Larger values for
layers
give more accurate results, but are slower. Aslayers
approaches the mask radius, the accuracy will become close to exact convolution and the speed will drop to match. For many large masks, such as Gaussian,n_layers
need be only 10% of this value and accuracy will still be good.Smaller values of
cluster
will give more accurate results, but be slower and use more memory. 10% of the mask radius is a good rule of thumb.See also:
convsep(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- precision
VipsOption.Enum
VipsPrecision
Convolve with this precision, layersVipsOption.Int
Use this many layers in approximation, clusterVipsOption.Int
Cluster lines closer than this in approximation
-
conva
Perform an approximate integer convolution of
in
withmask
. This is a low-level operation, seeconv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for something more convenient.The output image always has the same
VipsBandFormat
as the input image. Elements ofmask
are converted to integers before convolution.Larger values for
layers
give more accurate results, but are slower. Aslayers
approaches the mask radius, the accuracy will become close to exact convolution and the speed will drop to match. For many large masks, such as Gaussian,layers
need be only 10% of this value and accuracy will still be good.Smaller values of
cluster
will give more accurate results, but be slower and use more memory. 10% of the mask radius is a good rule of thumb.See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- layers
VipsOption.Int
Use this many layers in approximation, clusterVipsOption.Int
Cluster lines closer than this in approximation
-
convasep
Approximate separable integer convolution. This is a low-level operation, see
convsep(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for something more convenient.The image is convolved twice: once with
mask
and then again withmask
rotated by 90 degrees.mask
must be 1xn or nx1 elements. Elements ofmask
are converted to integers before convolution.Larger values for
layers
give more accurate results, but are slower. Aslayers
approaches the mask radius, the accuracy will become close to exact convolution and the speed will drop to match. For many large masks, such as Gaussian,layers
need be only 10% of this value and accuracy will still be good.The output image always has the same
VipsBandFormat
as the input image.See also:
convsep(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- layers
VipsOption.Int
Use this many layers in approximation
-
convf
Convolution. This is a low-level operation, see
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for something more convenient.Perform a convolution of
in
withmask
. Each output pixel is calculated as sigma[i]{pixel[i] * mask[i]} / scale + offset, where scale and offset are part ofmask
.The convolution is performed with floating-point arithmetic. The output image is always
VipsBandFormat.FORMAT_FLOAT
unlessin
isVipsBandFormat.FORMAT_DOUBLE
, in which caseout
is alsoVipsBandFormat.FORMAT_DOUBLE
.See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
convi
Integer convolution. This is a low-level operation, see
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for something more convenient.mask
is converted to an integer mask with rint() of each element, rint of scale and rint of offset. Each output pixel is then calculated assigma[i]{pixel[i] * mask[i]} / scale + offset
The output image always has the same
VipsBandFormat
as the input image.For
VipsBandFormat.FORMAT_UCHAR
images,convi
uses a fast vector path based on half-float arithmetic. This can produce slightly different results. Disable the vector path with `--vips-novector` or `VIPS_NOVECTOR` orvips_vector_set_enabled
.See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
convsep
Perform a separable convolution of
in
withmask
. Seeconv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for a detailed description.The mask must be 1xn or nx1 elements.
The image is convolved twice: once with
mask
and then again withmask
rotated by 90 degrees. This is much faster for certain types of mask (gaussian blur, for example) than doing a full 2D convolution.See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,gaussmat(double, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input matrix imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- precision
VipsOption.Enum
VipsPrecision
Convolve with this precision, layersVipsOption.Int
Use this many layers in approximation, clusterVipsOption.Int
Cluster lines closer than this in approximation
-
copy
Copy an image, optionally modifying the header. VIPS copies images by copying pointers, so this operation is instant, even for very large images.
You can optionally change any or all header fields during the copy. You can make any change which does not change the size of a pel, so for example you can turn a 4-band uchar image into a 2-band ushort image, but you cannot change a 100 x 100 RGB image into a 300 x 100 mono image.
See also:
byteswap(app.photofox.vipsffm.VipsOption...)
,bandfold(app.photofox.vipsffm.VipsOption...)
,bandunfold(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- swap
VipsOption.Boolean
Swap bytes in image between little and big-endian, widthVipsOption.Int
Image width in pixels, heightVipsOption.Int
Image height in pixels, bandsVipsOption.Int
Number of bands in image, formatVipsOption.Enum
VipsBandFormat
Pixel format in image, codingVipsOption.Enum
VipsCoding
Pixel coding, interpretationVipsOption.Enum
VipsInterpretation
Pixel interpretation, xresVipsOption.Double
Horizontal resolution in pixels/mm, yresVipsOption.Double
Vertical resolution in pixels/mm, xoffsetVipsOption.Int
Horizontal offset of origin, yoffsetVipsOption.Int
Vertical offset of origin
-
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.
See also:
morph(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationMorphology, app.photofox.vipsffm.VipsOption...)
,conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
direction
-VipsDirection
Countlines left-right or up-downargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
csvload
Load a CSV (comma-separated values) file. The output image is always 1 band (monochrome),
VipsBandFormat.FORMAT_DOUBLE
. Usebandfold(app.photofox.vipsffm.VipsOption...)
to turn RGBRGBRGB mono images into colour images.Items in lines can be either floating point numbers in the C locale, or strings enclosed in double-quotes ("), or empty. You can use a backslash (\) within the quotes to escape special characters, such as quote marks.
skip
sets the number of lines to skip at the start of the file. Default zero.lines
sets the number of lines to read from the file. Default -1, meaning read all lines to end of file.whitespace
sets the skippable whitespace characters. Default <b>space</b>. Whitespace characters are always run together.separator
sets the characters that separate fields. Default ;,<b>tab</b>. Separators are never run together.Use
fail-on
to set the type of error that will cause load to fail. By default, loaders are permissive, that is,VipsFailOn.FAIL_ON_NONE
.See also:
vips_image_new_from_file
,bandfold(app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- skip
VipsOption.Int
Skip this many lines at the start of the file, linesVipsOption.Int
Read this many lines from the file, whitespaceVipsOption.String
Set of whitespace characters, separatorVipsOption.String
Set of separator characters, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
csvloadSource
Exactly as
csvload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
csvload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- skip
VipsOption.Int
Skip this many lines at the start of the file, linesVipsOption.Int
Read this many lines from the file, whitespaceVipsOption.String
Set of whitespace characters, separatorVipsOption.String
Set of separator characters, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
csvsave
Writes the pixels in
in
to thefilename
as CSV (comma-separated values). The image is written one line of text per scanline. Complex numbers are written as "(real,imaginary)" and will need extra parsing I guess. Only the first band is written.separator
gives the string to use to separate numbers in the output. The default is "\\t" (tab).See also:
vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- separator
VipsOption.String
Separator characters, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
csvsaveTarget
As
csvsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
csvsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- separator
VipsOption.String
Separator characters, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
dE00
Calculate dE 00.
- Parameters:
right
- Right-hand input imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
dE76
Calculate dE 76.
- Parameters:
right
- Right-hand input imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
dECMC
Calculate dE CMC. The input images are transformed to CMC colour space and the euclidean distance between corresponding pixels calculated.
To calculate a colour difference with values for (l:c) other than (1:1), transform the two source images to CMC yourself, scale the channels appropriately, and call this function.
See also:
colourspace(app.photofox.vipsffm.enums.VipsInterpretation, app.photofox.vipsffm.VipsOption...)
- Parameters:
right
- Right-hand input imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
deviate
This operation finds the standard deviation of all pixels in
in
. It operates on all bands of the input image: usestats(app.photofox.vipsffm.VipsOption...)
if you need to calculate an average for each band.Non-complex images only.
See also:
avg(app.photofox.vipsffm.VipsOption...)
,stats(app.photofox.vipsffm.VipsOption...)
..- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
divide
This operation calculates
in1
/in2
and writes the result toout
. If any pixels inin2
are zero, the corresponding pixel inout
is also zero.If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), then the following table is used to determine the output type:<table> <title>{@code divide} type promotion</title> <tgroup cols='2' align='left' colsep='1' rowsep='1'> <thead> <row> <entry>input type</entry> <entry>output type</entry> </row> </thead> <tbody> <row> <entry>uchar</entry> <entry>float</entry> </row> <row> <entry>char</entry> <entry>float</entry> </row> <row> <entry>ushort</entry> <entry>float</entry> </row> <row> <entry>short</entry> <entry>float</entry> </row> <row> <entry>uint</entry> <entry>float</entry> </row> <row> <entry>int</entry> <entry>float</entry> </row> <row> <entry>float</entry> <entry>float</entry> </row> <row> <entry>double</entry> <entry>double</entry> </row> <row> <entry>complex</entry> <entry>complex</entry> </row> <row> <entry>double complex</entry> <entry>double complex</entry> </row> </tbody> </tgroup> </table>
In other words, the output type is just large enough to hold the whole range of possible values.
See also:
multiply(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,linear(java.util.List<java.lang.Double>, java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,vips_pow
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
drawCircle
public void drawCircle(List<Double> ink, int cx, int cy, int radius, VipsOption... args) throws VipsError Draws a circle on
image
. Iffill
isTRUE
then the circle is filled, otherwise a 1-pixel-wide perimeter is drawn.ink
is an array of double containing values to draw.See also:
vips_draw_circle1
,drawLine(java.util.List<java.lang.Double>, int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
ink
- Color for pixelscx
- Centre of draw_circlecy
- Centre of draw_circleradius
- Radius in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- fill
VipsOption.Boolean
Draw a solid object
-
drawFlood
Flood-fill
image
withink
, starting at positionx
,y
. The filled area is bounded by pixels that are equal to the ink colour, in other words, it searches for pixels enclosed by an edge ofink
.If
equal
is set, it instead searches for pixels which are equal to the start point and fills them withink
.Normally it will test and set pixels in
image
. Iftest
is set, it will test pixels intest
and set pixels inimage
. This lets you search an image (test
) for continuous areas of pixels without modifying it.left
,top
,width
,height
output the bounding box of the modified pixels.ink
is an array of double containing values to draw.See also:
vips_draw_flood1
.- Parameters:
ink
- Color for pixelsx
- DrawFlood start pointy
- DrawFlood start pointargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- test
VipsOption.Image
Test pixels in this image, equalVipsOption.Boolean
DrawFlood while equal to edge, leftVipsOption.Int
Left edge of modified area, topVipsOption.Int
Top edge of modified area, widthVipsOption.Int
Width of modified area, heightVipsOption.Int
Height of modified area
-
drawImage
Draw
sub
on top ofimage
at positionx
,y
. The two images must have the same Coding. Ifsub
has 1 band, the bands will be duplicated to match the number of bands inimage
.sub
will be converted toimage
's format, seecast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)
.Use
mode
to set how pixels are combined. If you useVipsCombineMode.COMBINE_MODE_ADD
, both images muct be uncoded.See also:
drawMask(java.util.List<java.lang.Double>, app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sub
- Sub-image to insert into main imagex
- Draw image herey
- Draw image hereargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- mode
VipsOption.Enum
VipsCombineMode
Combining mode
-
drawLine
public void drawLine(List<Double> ink, int x1, int y1, int x2, int y2, VipsOption... args) throws VipsError Draws a 1-pixel-wide line on an image.
ink
is an array of double containing values to draw.See also:
vips_draw_line1
,drawCircle(java.util.List<java.lang.Double>, int, int, int, app.photofox.vipsffm.VipsOption...)
,drawMask(java.util.List<java.lang.Double>, app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
ink
- Color for pixelsx1
- Start of draw_liney1
- Start of draw_linex2
- End of draw_liney2
- End of draw_lineargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
drawMask
public void drawMask(List<Double> ink, VImage mask, int x, int y, VipsOption... args) throws VipsError Draw
mask
on the image.mask
is a monochrome 8-bit image with 0/255 for transparent orink
coloured points. Intermediate values blend the ink with the pixel. Use withtext(java.lang.String, app.photofox.vipsffm.VipsOption...)
to draw text on an image. Use in adrawLine(java.util.List<java.lang.Double>, int, int, int, int, app.photofox.vipsffm.VipsOption...)
subclass to draw an object along a line.ink
is an array of double containing values to draw.See also:
text(java.lang.String, app.photofox.vipsffm.VipsOption...)
,drawLine(java.util.List<java.lang.Double>, int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
ink
- Color for pixelsmask
- Mask of pixels to drawx
- Draw mask herey
- Draw mask hereargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
drawRect
public void drawRect(List<Double> ink, int left, int top, int width, int height, VipsOption... args) throws VipsError Paint pixels within
left
,top
,width
,height
inimage
withink
. Iffill
is zero, just paint a 1-pixel-wide outline.See also:
drawCircle(java.util.List<java.lang.Double>, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
ink
- Color for pixelsleft
- Rect to filltop
- Rect to fillwidth
- Rect to fillheight
- Rect to fillargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- fill
VipsOption.Boolean
Draw a solid object
-
drawSmudge
public void drawSmudge(int left, int top, int width, int height, VipsOption... args) throws VipsError Smudge a section of
image
. Each pixel in the arealeft
,top
,width
,height
is replaced by the average of the surrounding 3x3 pixels.See also:
drawLine(java.util.List<java.lang.Double>, int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
left
- Rect to filltop
- Rect to fillwidth
- Rect to fillheight
- Rect to fillargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
dzsave
Save an image as a set of tiles at various resolutions. By default dzsave uses DeepZoom layout -- use
layout
to pick other conventions.dzsave
creates a directory calledname
to hold the tiles. Ifname
ends `.zip`,dzsave
will create a zip file calledname
to hold the tiles. You can usecontainer
to force zip file output.Use
basename
to set the name of the image we are creating. The default value is set fromname
.By default, tiles are written as JPEGs. Use
Q
set set the JPEG quality factor.You can set
suffix
to something like `".png[bitdepth=4]"` to write tiles in another format.In Google layout mode, edge tiles are expanded to
tile-size
bytile-size
pixels. Normally they are filled with white, but you can set another colour withbackground
. Images are usually placed at the top-left of the tile, but you can have them centred by turning oncentre
.You can set the size and overlap of tiles with
tile-size
andoverlap
. They default to the correct settings for the selectedlayout
. The deepzoom defaults produce 256x256 jpeg files for centre tiles, the most efficient size.Use
depth
to control how low the pyramid goes. This defaults to the correct setting for thelayout
you select.You can rotate the image during write with the
angle
argument. However, this will only work for images which support random access, like openslide, and not for things like JPEG. You'll need to rotate those images yourself withrot(app.photofox.vipsffm.enums.VipsAngle, app.photofox.vipsffm.VipsOption...)
. Note that the `autorotate` option to the loader may do what you need.By default, all tiles are stripped since usually you do not want a copy of all metadata in every tile. Set
keep
if you want to keep metadata.If
container
is set to `zip`, you can set a compression level from -1 (use zlib default), 0 (store, compression disabled) to 9 (max compression). If no value is given, the default is to store files without compression.You can use
region-shrink
to control the method for shrinking each 2x2 region. This defaults to using the average of the 4 input pixels but you can also use the median in cases where you want to preserve the range of values.If you set
skip-blanks
to a value greater than or equal to zero, tiles which are all within that many pixel values to the background are skipped. This can save a lot of space for some image types. This option defaults to 5 in Google layout mode, -1 otherwise.In IIIF layout, you can set the base of the `id` property in `info.json` with
id
. The default is `https://example.com/iiif`.Use
layout
VipsForeignDzLayout.FOREIGN_DZ_LAYOUT_IIIF3
for IIIF v3 layout.See also:
tiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dirname
VipsOption.String
Directory name to save to, imagenameVipsOption.String
Image name, layoutVipsOption.Enum
VipsForeignDzLayout
Directory layout, suffixVipsOption.String
Filename suffix for tiles, overlapVipsOption.Int
Tile overlap in pixels, tile-sizeVipsOption.Int
Tile size in pixels, tile-heightVipsOption.Int
Tile height in pixels, tile-widthVipsOption.Int
Tile width in pixels, centreVipsOption.Boolean
Center image in tile, depthVipsOption.Enum
VipsForeignDzDepth
Pyramid depth, angleVipsOption.Enum
VipsAngle
Rotate image during save, containerVipsOption.Enum
VipsForeignDzContainer
Pyramid container type, propertiesVipsOption.Boolean
Write a properties file to the output directory, compressionVipsOption.Int
ZIP deflate compression level, region-shrinkVipsOption.Enum
VipsRegionShrink
Method to shrink regions, skip-blanksVipsOption.Int
Skip tiles which are nearly equal to the background, idVipsOption.String
Resource ID, QVipsOption.Int
Q factor, no-stripVipsOption.Boolean
Don't strip tile metadata, basenameVipsOption.String
Base name to save to, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
dzsaveBuffer
As
dzsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.Output is always in a zip container. Use
basename
to set the name of the directory that the zip will create when unzipped.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
dzsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dirname
VipsOption.String
Directory name to save to, imagenameVipsOption.String
Image name, layoutVipsOption.Enum
VipsForeignDzLayout
Directory layout, suffixVipsOption.String
Filename suffix for tiles, overlapVipsOption.Int
Tile overlap in pixels, tile-sizeVipsOption.Int
Tile size in pixels, tile-heightVipsOption.Int
Tile height in pixels, tile-widthVipsOption.Int
Tile width in pixels, centreVipsOption.Boolean
Center image in tile, depthVipsOption.Enum
VipsForeignDzDepth
Pyramid depth, angleVipsOption.Enum
VipsAngle
Rotate image during save, containerVipsOption.Enum
VipsForeignDzContainer
Pyramid container type, propertiesVipsOption.Boolean
Write a properties file to the output directory, compressionVipsOption.Int
ZIP deflate compression level, region-shrinkVipsOption.Enum
VipsRegionShrink
Method to shrink regions, skip-blanksVipsOption.Int
Skip tiles which are nearly equal to the background, idVipsOption.String
Resource ID, QVipsOption.Int
Q factor, no-stripVipsOption.Boolean
Don't strip tile metadata, basenameVipsOption.String
Base name to save to, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
dzsaveTarget
As
dzsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
dzsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dirname
VipsOption.String
Directory name to save to, imagenameVipsOption.String
Image name, layoutVipsOption.Enum
VipsForeignDzLayout
Directory layout, suffixVipsOption.String
Filename suffix for tiles, overlapVipsOption.Int
Tile overlap in pixels, tile-sizeVipsOption.Int
Tile size in pixels, tile-heightVipsOption.Int
Tile height in pixels, tile-widthVipsOption.Int
Tile width in pixels, centreVipsOption.Boolean
Center image in tile, depthVipsOption.Enum
VipsForeignDzDepth
Pyramid depth, angleVipsOption.Enum
VipsAngle
Rotate image during save, containerVipsOption.Enum
VipsForeignDzContainer
Pyramid container type, propertiesVipsOption.Boolean
Write a properties file to the output directory, compressionVipsOption.Int
ZIP deflate compression level, region-shrinkVipsOption.Enum
VipsRegionShrink
Method to shrink regions, skip-blanksVipsOption.Int
Skip tiles which are nearly equal to the background, idVipsOption.String
Resource ID, QVipsOption.Int
Q factor, no-stripVipsOption.Boolean
Don't strip tile metadata, basenameVipsOption.String
Base name to save to, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
embed
The opposite of
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
: embedin
within an image of sizewidth
byheight
at positionx
,y
.extend
controls what appears in the new pels, seeVipsExtend
.See also:
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
x
- Left edge of input in outputy
- Top edge of input in outputwidth
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- extend
VipsOption.Enum
VipsExtend
How to generate the extra pixels, backgroundVipsOption.ArrayDouble
Color for background pixels
-
extractArea
public VImage extractArea(int left, int top, int width, int height, VipsOption... args) throws VipsError Extract an area from an image. The area must fit within
in
.See also:
vips_extract_bands
,smartcrop(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
left
- Left edge of extract areatop
- Top edge of extract areawidth
- Width of extract areaheight
- Height of extract areaargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
extractBand
Extract a band or bands from an image. Extracting out of range is an error.
See also:
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
band
- Band to extractargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- n
VipsOption.Int
Number of bands to extract
-
eye
Create a test pattern with increasing spatial frequency in X and amplitude in Y.
factor
should be between 0 and 1 and determines the maximum spatial frequency.Set
uchar
to output a uchar image.See also:
zone(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, factorVipsOption.Double
Maximum spatial frequency
-
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.See also:
maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
fastcor
Calculate a fast correlation surface.
ref
is placed at every position inin
and the sum of squares of differences calculated.The output image is the same size as the input. Extra input edge pixels are made by copying the existing edges outwards.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The output type is uint if both inputs are integer, float if both are float or complex, and double if either is double or double complex. In other words, the output type is just large enough to hold the whole range of possible values.
See also:
spcor(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
ref
- Input reference imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
fillNearest
Fill outwards from every non-zero pixel in
in
, setting pixels indistance
andvalue
.At the position of zero pixels in
in
,distance
contains the distance to the nearest non-zero pixel inin
, andvalue
contains the value of that pixel.distance
is a one-band float image.value
has the same number of bands and format asin
.See also:
histFindIndexed(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- distance
VipsOption.Image
Distance to nearest non-zero pixel
-
findTrim
Search
in
for the bounding box of the non-background area.Any alpha is flattened out, then the image is median-filtered (unless
line-art
is set, see below). The absolute difference frombackground
is computed and binarized according tothreshold
. Row and column sums of the absolute difference are calculated from this binary image and searched for the first row or column in each direction to obtain the bounding box.If the image is entirely background,
findTrim
returnswidth
== 0 andheight
== 0.background
defaults to 255, or 65535 for 16-bit images. Set another value, or usegetpoint(int, int, app.photofox.vipsffm.VipsOption...)
to pick a value from an edge. You'll need to flatten beforegetpoint(int, int, app.photofox.vipsffm.VipsOption...)
to get a correct background value.threshold
defaults to 10.The detector is designed for photographic or compressed images where there is a degree of noise that needs filtering. If your images are synthetic (eg. rendered from vector art, perhaps), set
line-art
to disable this filtering.The image needs to be at least 3x3 pixels in size.
See also:
getpoint(int, int, app.photofox.vipsffm.VipsOption...)
,extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
,smartcrop(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- threshold
VipsOption.Double
Object threshold, backgroundVipsOption.ArrayDouble
Color for background pixels, line-artVipsOption.Boolean
Enable line art mode
-
fitsload
Read a FITS image file into a VIPS image.
This operation can read images with up to three dimensions. Any higher dimensions must be empty.
It can read 8, 16 and 32-bit integer images, signed and unsigned, float and double.
FITS metadata is attached with the "fits-" prefix.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
fitsloadSource
Load FITS from a source- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
fitssave
Write a VIPS image to a file in FITS format.
See also:
vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
flatten
Take the last band of
in
as an alpha and use it to blend the remaining channels withbackground
.The alpha channel is 0 -
max-alpha
, wheremax-alpha
means 100% image and 0 means 100% background.background
defaults to zero (black).max-alpha
has the default value 255, or 65535 for images tagged asVipsInterpretation.INTERPRETATION_RGB16
orVipsInterpretation.INTERPRETATION_GREY16
.Useful for flattening PNG images to RGB.
Non-complex images only.
See also:
premultiply(app.photofox.vipsffm.VipsOption...)
,pngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- background
VipsOption.ArrayDouble
Background value, max-alphaVipsOption.Double
Maximum value of alpha channel
-
flip
Flips an image left-right or up-down.
See also:
rot(app.photofox.vipsffm.enums.VipsAngle, app.photofox.vipsffm.VipsOption...)
.- Parameters:
direction
-VipsDirection
Direction to flip imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
float2rad
Convert a three-band float image to Radiance 32-bit packed format.
See also:
rad2float(app.photofox.vipsffm.VipsOption...)
,VipsCoding.CODING_RAD
,LabQ2Lab(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
fractsurf
public VImage fractsurf(int width, int height, double fractalDimension, VipsOption... args) throws VipsError Generate an image of size
width
byheight
and fractal dimensionfractalDimension
. The dimension should be between 2 and 3.See also:
gaussnoise(int, int, app.photofox.vipsffm.VipsOption...)
,maskFractal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfractalDimension
- Fractal dimensionargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
freqmult
Multiply
in
bymask
in Fourier space.in
is transformed to Fourier space, multiplied withmask
, then transformed back to real space. Ifin
is already a complex image, just multiply then inverse transform.See also:
invfft(app.photofox.vipsffm.VipsOption...)
,maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
mask
- Input mask imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
fwfft
Transform an image to Fourier space.
VIPS uses the fftw Fourier Transform library. If this library was not available when VIPS was configured, these functions will fail.
See also:
invfft(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
gamma
Calculate
in
** (1 /exponent
), normalising to the maximum range of the input type. For float types use 1.0 as the maximum.See also:
identity(app.photofox.vipsffm.VipsOption...)
,vips_pow_const1
,maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- exponent
VipsOption.Double
Gamma factor
-
gaussblur
This operator runs
gaussmat(double, double, app.photofox.vipsffm.VipsOption...)
andconvsep(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for you on an image. Setmin-ampl
smaller to generate a larger, more accurate mask. Setsigma
larger to make the blur more blurry.See also:
gaussmat(double, double, app.photofox.vipsffm.VipsOption...)
,convsep(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sigma
- Sigma of Gaussianargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- min-ampl
VipsOption.Double
Minimum amplitude of Gaussian, precisionVipsOption.Enum
VipsPrecision
Convolve with this precision
-
gaussmat
Creates a circularly symmetric Gaussian image of radius
sigma
. The size of the mask is determined by the variableminAmpl
; if for instance the value .1 is entered this means that the produced mask is clipped at values less than 10 percent of the maximum amplitude.The program uses the following equation: H(r) = exp(-(r * r) / (2 *
sigma
*sigma
))The generated image has odd size and its maximum value is normalised to 1.0, unless
precision
isVipsPrecision.PRECISION_INTEGER
.If
separable
is set, only the centre horizontal is generated. This is useful for separable convolutions.If
precision
isVipsPrecision.PRECISION_INTEGER
, an integer gaussian is generated. This is useful for integer convolutions."scale" is set to the sum of all the mask elements.
See also:
logmat(double, double, app.photofox.vipsffm.VipsOption...)
,conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sigma
- Sigma of GaussianminAmpl
- Minimum amplitude of Gaussianargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- separable
VipsOption.Boolean
Generate separable Gaussian, integerVipsOption.Boolean
Generate integer Gaussian, precisionVipsOption.Enum
VipsPrecision
Generate with this precision
-
gaussnoise
Make a one band float image of gaussian noise with the specified distribution. The noise distribution is created by averaging 12 random numbers with the appropriate weights.
See also:
black(int, int, app.photofox.vipsffm.VipsOption...)
,xyz(int, int, app.photofox.vipsffm.VipsOption...)
,text(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- sigma
VipsOption.Double
Standard deviation of pixels in generated image, meanVipsOption.Double
Mean of pixels in generated image, seedVipsOption.Int
Random number seed
-
getpoint
Reads a single pixel on an image.
The pixel values are returned in
vector
, the length of the array inn
. You must free the array with g_free() when you are done with it.The result array has an element for each band. If
unpack-complex
is set, pixels in complex images are returned as double-length arrays.See also:
vips_draw_point
.- Parameters:
x
- Point to ready
- Point to readargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- unpack-complex
VipsOption.Boolean
Complex pixels should be unpacked
-
gifload
Read a GIF file into a libvips image.
Use
page
to select a page to render, numbering from zero.Use
n
to select the number of pages to render. The default is 1. Pages are rendered in a vertical column. Set to -1 to mean "until the end of the document". Usegrid(int, int, int, app.photofox.vipsffm.VipsOption...)
to change page layout.Use
fail-on
to set the type of error that will cause load to fail. By default, loaders are permissive, that is,VipsFailOn.FAIL_ON_NONE
.The output image is RGBA for GIFs containing transparent elements, RGB otherwise.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- n
VipsOption.Int
Number of pages to load, -1 for all, pageVipsOption.Int
First page to load, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
gifloadBuffer
Exactly as
gifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
gifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- n
VipsOption.Int
Number of pages to load, -1 for all, pageVipsOption.Int
First page to load, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
gifloadSource
Exactly as
gifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
gifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- n
VipsOption.Int
Number of pages to load, -1 for all, pageVipsOption.Int
First page to load, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
gifsave
Write to a file in GIF format.
Use
dither
to set the degree of Floyd-Steinberg dithering andeffort
to control the CPU effort (1 is the fastest, 10 is the slowest, 7 is the default).Use
bitdepth
(from 1 to 8, default 8) to control the number of colours in the palette. The first entry in the palette is always reserved for transparency. For example, a bitdepth of 4 will allow the output to contain up to 15 colours.Use
interframe-maxerror
to set the threshold below which pixels are considered equal. Pixels which don't change from frame to frame can be made transparent, improving the compression rate. Default 0.Use
interpalette-maxerror
to set the threshold below which the previously generated palette will be reused.If
reuse
is TRUE, the GIF will be saved with a single global palette taken from the metadata inin
, and no new palette optimisation will be done.If
interlace
is TRUE, the GIF file will be interlaced (progressive GIF). These files may be better for display over a slow network connection, but need more memory to encode.See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dither
VipsOption.Double
Amount of dithering, effortVipsOption.Int
Quantisation effort, bitdepthVipsOption.Int
Number of bits per pixel, interframe-maxerrorVipsOption.Double
Maximum inter-frame error for transparency, reuseVipsOption.Boolean
Reuse palette from input, interpalette-maxerrorVipsOption.Double
Maximum inter-palette error for palette reusage, interlaceVipsOption.Boolean
Generate an interlaced (progressive) GIF, reoptimiseVipsOption.Boolean
Reoptimise colour palettes, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
gifsaveBuffer
As
gifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
gifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dither
VipsOption.Double
Amount of dithering, effortVipsOption.Int
Quantisation effort, bitdepthVipsOption.Int
Number of bits per pixel, interframe-maxerrorVipsOption.Double
Maximum inter-frame error for transparency, reuseVipsOption.Boolean
Reuse palette from input, interpalette-maxerrorVipsOption.Double
Maximum inter-palette error for palette reusage, interlaceVipsOption.Boolean
Generate an interlaced (progressive) GIF, reoptimiseVipsOption.Boolean
Reoptimise colour palettes, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
gifsaveTarget
As
gifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
gifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dither
VipsOption.Double
Amount of dithering, effortVipsOption.Int
Quantisation effort, bitdepthVipsOption.Int
Number of bits per pixel, interframe-maxerrorVipsOption.Double
Maximum inter-frame error for transparency, reuseVipsOption.Boolean
Reuse palette from input, interpalette-maxerrorVipsOption.Double
Maximum inter-palette error for palette reusage, interlaceVipsOption.Boolean
Generate an interlaced (progressive) GIF, reoptimiseVipsOption.Boolean
Reoptimise colour palettes, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
globalbalance
globalbalance
can be used to remove contrast differences in an assembled mosaic.It reads the History field attached to
in
and builds a list of the source images that were used to make the mosaic and the position that each ended up at in the final image.It opens each of the source images in turn and extracts all parts which overlap with any of the other images. It finds the average values in the overlap areas and uses least-mean-square to find a set of correction factors which will minimise overlap differences. It uses
gamma
to gamma-correct the source images before calculating the factors. A value of 1.0 will stop this.Each of the source images is transformed with the appropriate correction factor, then the mosaic is reassembled.
out
isVipsBandFormat.FORMAT_FLOAT
, but ifint-output
is set, the output image is the same format as the input images.There are some conditions that must be met before this operation can work: the source images must all be present under the filenames recorded in the history on
in
, and the mosaic must have been built using only operations in this package.See also:
vips_remosaic
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- gamma
VipsOption.Double
Image gamma, int-outputVipsOption.Boolean
Integer output
-
gravity
public VImage gravity(VipsCompassDirection direction, int width, int height, VipsOption... args) throws VipsError The opposite of
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
: placein
within an image of sizewidth
byheight
at a certain gravity.extend
controls what appears in the new pels, seeVipsExtend
.See also:
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
direction
-VipsCompassDirection
Direction to place image within width/heightwidth
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- extend
VipsOption.Enum
VipsExtend
How to generate the extra pixels, backgroundVipsOption.ArrayDouble
Color for background pixels
-
grey
Create a one-band float image with the left-most column zero and the right-most 1. Intermediate pixels are a linear ramp.
Set
uchar
to output a uchar image with the leftmost pixel 0 and the rightmost 255.See also:
xyz(int, int, app.photofox.vipsffm.VipsOption...)
,identity(app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image
-
grid
Chop a tall thin image up into a set of tiles, lay the tiles out in a grid.
The input image should be a very tall, thin image containing a list of smaller images. Volumetric or time-sequence images are often laid out like this. This image is chopped into a series of tiles, each
tileHeight
pixels high and the width ofin
. The tiles are then rearranged into a gridacross
tiles across anddown
tiles down in row-major order.Supplying
tileHeight
,across
anddown
is not strictly necessary, we only really need two of these. Requiring three is a double-check that the image has the expected geometry.See also:
embed(int, int, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
,join(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, app.photofox.vipsffm.VipsOption...)
.- Parameters:
tileHeight
- Chop into tiles this highacross
- Number of tiles acrossdown
- Number of tiles downargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
heifload
Read a HEIF image file into a VIPS image.
Use
page
to select a page to render, numbering from zero. If neithern
norpage
are set,page
defaults to the primary page, otherwise to 0.Use
n
to select the number of pages to render. The default is 1. Pages are rendered in a vertical column. Set to -1 to mean "until the end of the document". Usegrid(int, int, int, app.photofox.vipsffm.VipsOption...)
to reorganise pages.HEIF images have a primary image. The metadata item `heif-primary` gives the page number of the primary.
If
thumbnail
isTRUE
, then fetch a stored thumbnail rather than the image.By default, input image dimensions are limited to 16384x16384. If
unlimited
isTRUE
, this increases to the maximum of 65535x65535.The bitdepth of the heic image is recorded in the metadata item `heif-bitdepth`.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, thumbnailVipsOption.Boolean
Fetch thumbnail image, autorotateVipsOption.Boolean
Rotate image using exif orientation, unlimitedVipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
heifloadBuffer
Read a HEIF image file into a VIPS image. Exactly as
heifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
heifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, thumbnailVipsOption.Boolean
Fetch thumbnail image, autorotateVipsOption.Boolean
Rotate image using exif orientation, unlimitedVipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
heifloadSource
Exactly as
heifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
heifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, thumbnailVipsOption.Boolean
Fetch thumbnail image, autorotateVipsOption.Boolean
Rotate image using exif orientation, unlimitedVipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
heifsave
Write a VIPS image to a file in HEIF format.
Use
Q
to set the compression factor. Default 50, which seems to be roughly what the iphone uses. Q 30 gives about the same quality as JPEG Q 75.Set
lossless
TRUE
to switch to lossless compression.Use
compression
to set the compression format e.g. HEVC, AVC, AV1 to use. It defaults to AV1 if the target filename ends with ".avif", otherwise HEVC.Use
effort
to control the CPU effort spent improving compression. This is currently only applicable to AV1 encoders. Defaults to 4, 0 is fastest, 9 is slowest.Chroma subsampling is normally automatically disabled for Q >= 90. You can force the subsampling mode with
subsample-mode
.Use
bitdepth
to set the bitdepth of the output file. HEIC supports at least 8, 10 and 12 bits; other codecs may support more or fewer options.Use
encoder
to set the encode library to use, e.g. aom, SVT-AV1, rav1e etc.See also:
vips_image_write_to_file
,heifload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, bitdepthVipsOption.Int
Number of bits per pixel, losslessVipsOption.Boolean
Enable lossless compression, compressionVipsOption.Enum
VipsForeignHeifCompression
Compression format, effortVipsOption.Int
CPU effort, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, speedVipsOption.Int
CPU effort, encoderVipsOption.Enum
VipsForeignHeifEncoder
Select encoder to use, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
heifsaveBuffer
As
heifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
obuf
, the length of the buffer inolen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
heifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, bitdepthVipsOption.Int
Number of bits per pixel, losslessVipsOption.Boolean
Enable lossless compression, compressionVipsOption.Enum
VipsForeignHeifCompression
Compression format, effortVipsOption.Int
CPU effort, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, speedVipsOption.Int
CPU effort, encoderVipsOption.Enum
VipsForeignHeifEncoder
Select encoder to use, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
heifsaveTarget
As
heifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
heifsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, bitdepthVipsOption.Int
Number of bits per pixel, losslessVipsOption.Boolean
Enable lossless compression, compressionVipsOption.Enum
VipsForeignHeifCompression
Compression format, effortVipsOption.Int
CPU effort, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, speedVipsOption.Int
CPU effort, encoderVipsOption.Enum
VipsForeignHeifEncoder
Select encoder to use, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
histCum
Form cumulative histogram.
See also:
histNorm(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
histEntropy
Estimate image entropy from a histogram. Entropy is calculated as:
-sum(p * log2(p))
where p is histogram-value / sum-of-histogram-values.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
histEqual
Histogram-equalise
in
. Equalise using bandbandno
, or ifbandno
is -1, equalise bands independently. The output format is always the same as the input format.See also:
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- band
VipsOption.Int
Equalise with this band
-
histFind
Find the histogram of
in
. Find the histogram for bandband
(producing a one-band histogram), or for all bands (producing an n-band histogram) ifband
is -1.char and uchar images are cast to uchar before histogramming, all other image types are cast to ushort.
See also:
histFindNdim(app.photofox.vipsffm.VipsOption...)
,histFindIndexed(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- band
VipsOption.Int
Find histogram of band
-
histFindIndexed
Make a histogram of
in
, but use imageindex
to pick the bins. In other words, element zero inout
contains the combination of all the pixels inin
whose corresponding pixel inindex
is zero.char and uchar
index
images are cast to uchar before histogramming, all other image types are cast to ushort.index
must have just one band.in
must be non-complex.out
always has the same size and format asin
.Normally, bins are summed, but you can use
combine
to set other combine modes.This operation is useful in conjunction with
labelregions(app.photofox.vipsffm.VipsOption...)
. You can use it to find the centre of gravity of blobs in an image, for example.See also:
histFind(app.photofox.vipsffm.VipsOption...)
,labelregions(app.photofox.vipsffm.VipsOption...)
.- Parameters:
index
- Index imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- combine
VipsOption.Enum
VipsCombine
Combine bins like this
-
histFindNdim
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.char and uchar images are cast to uchar before histogramming, all other image types are cast to ushort.
See also:
histFind(app.photofox.vipsffm.VipsOption...)
,histFindIndexed(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- bins
VipsOption.Int
Number of bins in each dimension
-
histIsmonotonic
Test
in
for monotonicity.out
is set non-zero ifin
is monotonic.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
histLocal
Performs local histogram equalisation on
in
using a window of sizewidth
byheight
centered on the input pixel.The output image is the same size as the input image. The edge pixels are created by mirroring the input image outwards.
If
max-slope
is greater than 0, it sets the maximum value for the slope of the cumulative histogram, that is, the maximum brightening that is performed. A value of 3 is often used. Local histogram equalization with contrast limiting is usually called CLAHE.- Parameters:
width
- Window width in pixelsheight
- Window height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- max-slope
VipsOption.Int
Maximum slope (CLAHE)
-
histMatch
Adjust
in
to matchref
. Ifin
andref
are normalised cumulative histograms,out
will be a LUT that adjusts the PDF of the image from whichin
was made to match the PDF ofref
's image.See also:
maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,histFind(app.photofox.vipsffm.VipsOption...)
,histNorm(app.photofox.vipsffm.VipsOption...)
,histCum(app.photofox.vipsffm.VipsOption...)
.- Parameters:
ref
- Reference histogramargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
histNorm
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.
See also:
histCum(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
histPlot
Plot a 1 by any or any by 1 image file as a max by any or any by max image using these rules:
<b>unsigned char</b> max is always 256
<b>other unsigned integer types</b> output 0 - maximum value of
in
.<b>signed int types</b> min moved to 0, max moved to max + min.
<b>float types</b> min moved to 0, max moved to any (square output)
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
houghCircle
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.The output pixel at (x, y, band) is the strength of the circle centred on (x, y) and with radius (band).
Use
max-radius
andmin-radius
to set the range of radii to search for.Use
scale
to set howin
coordinates are scaled toout
coordinates. Ascale
of 3, for example, will makeout
1/3rd of the width and height ofin
, and reduce the number of radii tested (and hence the number of bands intout
) by a factor of three as well.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- scale
VipsOption.Int
Scale down dimensions by this factor, min-radiusVipsOption.Int
Smallest radius to search for, max-radiusVipsOption.Int
Largest radius to search for
-
houghLine
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 ofout
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.Use
width
height
to set the size of the parameter space image (out
), that is, how accurate the line determination should be.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- width
VipsOption.Int
Horizontal size of parameter space, heightVipsOption.Int
Vertical size of parameter space
-
iccExport
Export an image from D65 LAB to device space with an ICC profile. If
pcs
is set toVipsPCS.PCS_XYZ
, use CIE XYZ PCS instead. Ifoutput-profile
is not set, use the embedded profile, if any. Ifoutput-profile
is set, export with that and attach it to the output image.If
black-point-compensation
is set, LCMS black point compensation is enabled.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- pcs
VipsOption.Enum
VipsPCS
Set Profile Connection Space, intentVipsOption.Enum
VipsIntent
Rendering intent, black-point-compensationVipsOption.Boolean
Enable black point compensation, output-profileVipsOption.String
Filename to load output profile from, depthVipsOption.Int
Output device space depth in bits
-
iccImport
Import an image from device space to D65 LAB with an ICC profile. If
pcs
is set toVipsPCS.PCS_XYZ
, use CIE XYZ PCS instead.The input profile is searched for in three places: 1. If
embedded
is set, libvips will try to use any profile in the input image metadata. You can test for the presence of an embedded profile withvips_image_get_typeof
withVIPS_META_ICC_NAME
as an argument. This will returnGType
0 if there is no profile. 2. Otherwise, ifinput-profile
is set, libvips will try to load a profile from the named file. This can aslso be the name of one of the built-in profiles. 3. Otherwise, libvips will try to pick a compatible profile from the set of built-in profiles.If
black-point-compensation
is set, LCMS black point compensation is enabled.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- pcs
VipsOption.Enum
VipsPCS
Set Profile Connection Space, intentVipsOption.Enum
VipsIntent
Rendering intent, black-point-compensationVipsOption.Boolean
Enable black point compensation, embeddedVipsOption.Boolean
Use embedded input profile, if available, input-profileVipsOption.String
Filename to load input profile from
-
iccTransform
Transform an image with a pair of ICC profiles. The input image is moved to profile-connection space with the input profile and then to the output space with the output profile.
The input profile is searched for in three places: 1. If
embedded
is set, libvips will try to use any profile in the input image metadata. You can test for the presence of an embedded profile withvips_image_get_typeof
withVIPS_META_ICC_NAME
as an argument. This will returnGType
0 if there is no profile. 2. Otherwise, ifinput-profile
is set, libvips will try to load a profile from the named file. This can aslso be the name of one of the built-in profiles. 3. Otherwise, libvips will try to pick a compatible profile from the set of built-in profiles.If
black-point-compensation
is set, LCMS black point compensation is enabled.depth
defaults to 8, or 16 ifin
is a 16-bit image.The output image has the output profile attached to the
VIPS_META_ICC_NAME
field.Use
iccImport(app.photofox.vipsffm.VipsOption...)
andiccExport(app.photofox.vipsffm.VipsOption...)
to do either the first or second half of this operation in isolation.- Parameters:
outputProfile
- Filename to load output profile fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- pcs
VipsOption.Enum
VipsPCS
Set Profile Connection Space, intentVipsOption.Enum
VipsIntent
Rendering intent, black-point-compensationVipsOption.Boolean
Enable black point compensation, embeddedVipsOption.Boolean
Use embedded input profile, if available, input-profileVipsOption.String
Filename to load input profile from, depthVipsOption.Int
Output device space depth in bits
-
identity
Creates an identity lookup table, ie. one which will leave an image unchanged when applied with
maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
. Each entry in the table has a value equal to its position.Use the arithmetic operations on these tables to make LUTs representing arbitrary functions.
Normally LUTs are 8-bit. Set
ushort
to create a 16-bit table.Normally 16-bit tables have 65536 entries. You can set this smaller with
size
.See also:
xyz(int, int, app.photofox.vipsffm.VipsOption...)
,maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- bands
VipsOption.Int
Number of bands in LUT, ushortVipsOption.Boolean
Create a 16-bit LUT, sizeVipsOption.Int
Size of 16-bit LUT
-
ifthenelse
This operation scans the condition image
cond
and uses it to select pixels from either the then imagein1
or the else imagein2
. Non-zero meansin1
, 0 meansin2
.Any image can have either 1 band or n bands, where n is the same for all the non-1-band images. Single band images are then effectively copied to make n-band images.
Images
in1
andin2
are cast up to the smallest common format.cond
is cast to uchar.If the images differ in size, the smaller images are enlarged to match the largest by adding zero pixels along the bottom and right.
If
blend
isTRUE
, then values inout
are smoothly blended betweenin1
andin2
using the formula:out
= (cond
/ 255) *in1
+ (1 -cond
/ 255) *in2
See also:
vips_equal
.- Parameters:
in1
- Source for TRUE pixelsin2
- Source for FALSE pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- blend
VipsOption.Boolean
Blend smoothly between then and else parts
-
insert
Insert
sub
intomain
at positionx
,y
.Normally
out
shows the whole ofmain
. Ifexpand
isTRUE
thenout
is made large enough to hold all ofmain
andsub
. Any areas ofout
not coming from eithermain
orsub
are set tobackground
(default 0).If
sub
overlapsmain
,sub
will appear on top ofmain
.If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common type (see table Smallest common format in
arithmetic
).See also:
join(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, app.photofox.vipsffm.VipsOption...)
,embed(int, int, int, int, app.photofox.vipsffm.VipsOption...)
,extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sub
- Sub-image to insert into main imagex
- Left edge of sub in mainy
- Top edge of sub in mainargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- expand
VipsOption.Boolean
Expand output to hold all of both inputs, backgroundVipsOption.ArrayDouble
Color for new pixels
-
invert
For unsigned formats, this operation calculates (max -
in
), eg. (255 -in
) for uchar. For signed and float formats, this operation calculates (-1in
).For complex images, only the real part is inverted. See also
vips_conj
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
invertlut
Given a mask of target values and real values, generate a LUT which will map reals to targets. Handy for linearising images from measurements of a colour chart. All values in [0,1]. Piecewise linear interpolation, extrapolate head and tail to 0 and 1.
Eg. input like this: <tgroup cols='4' align='left' colsep='1' rowsep='1'> <tbody> <row> <entry>4</entry> <entry>3</entry> </row> <row> <entry>0.1</entry> <entry>0.2</entry> <entry>0.3</entry> <entry>0.1</entry> </row> <row> <entry>0.2</entry> <entry>0.4</entry> <entry>0.4</entry> <entry>0.2</entry> </row> <row> <entry>0.7</entry> <entry>0.5</entry> <entry>0.6</entry> <entry>0.3</entry> </row> </tbody> </tgroup>
Means a patch with 10% reflectance produces an image with 20% in channel 1, 30% in channel 2, and 10% in channel 3, and so on.
Inputs don't need to be sorted (we do that). Generate any precision LUT, default to 256 elements.
It won't work too well for non-monotonic camera responses (we should fix this). Interpolation is simple piecewise linear; we ought to do something better really.
See also:
buildlut(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- size
VipsOption.Int
LUT size to generate
-
invfft
Transform an image from Fourier space to real space. The result is complex. If you are OK with a real result, set
real
, it's quicker.VIPS uses the fftw Fourier Transform library. If this library was not available when VIPS was configured, these functions will fail.
See also:
fwfft(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- real
VipsOption.Boolean
Output only the real part of the transform
-
join
Join
in1
andin2
together, left-right or up-down depending on the value ofdirection
.If one is taller or wider than the other,
out
will be has high as the smaller. Ifexpand
isTRUE
, then the output will be expanded to contain all of the input pixels.Use
align
to set the edge that the images align on. By default, they align on the edge with the lower value coordinate.Use
background
to set the colour of any pixels inout
which are not present in eitherin1
orin2
.Use
shim
to set the spacing between the images. By default this is 0.If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common type (see table Smallest common format in
arithmetic
).If you are going to be joining many thousands of images in a regular grid,
arrayjoin(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
is a better choice.See also:
arrayjoin(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
in2
- Second input imagedirection
-VipsDirection
Join left-right or up-downargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- expand
VipsOption.Boolean
Expand output to hold all of both inputs, shimVipsOption.Int
Pixels between images, backgroundVipsOption.ArrayDouble
Colour for new pixels, alignVipsOption.Enum
VipsAlign
Align on the low, centre or high coordinate edge
-
jp2kload
Read a JPEG2000 image. The loader supports 8, 16 and 32-bit int pixel values, signed and unsigned. It supports greyscale, RGB, YCC, CMYK and multispectral colour spaces. It will read any ICC profile on the image.
It will only load images where all channels have the same format.
Use
page
to set the page to load, where page 0 is the base resolution image and higher-numbered pages are x2 reductions. Use the metadata item "n-pages" to find the number of pyramid layers.Use
fail-on
to set the type of error that will cause load to fail. By default, loaders are permissive, that is,VipsFailOn.FAIL_ON_NONE
.See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
Load this page from the image, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jp2kloadBuffer
Exactly as
jp2kload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a buffer.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
Load this page from the image, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jp2kloadSource
Exactly as
jp2kload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
Load this page from the image, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jp2ksave
Write a VIPS image to a file in JPEG2000 format. The saver supports 8, 16 and 32-bit int pixel values, signed and unsigned. It supports greyscale, RGB, CMYK and multispectral images.
Use
Q
to set the compression quality factor. The default value produces file with approximately the same size as regular JPEG Q 75.Set
lossless
to enable lossless compression.Use
tile-width
andtile-height
to set the tile size. The default is 512.Chroma subsampling is normally disabled for compatibility. Set
subsample-mode
to auto to enable chroma subsample for Q < 90. Subsample mode uses YCC rather than RGB colourspace, and many jpeg2000 decoders do not support this.This operation always writes a pyramid.
See also:
vips_image_write_to_file
,jp2kload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tile-width
VipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, losslessVipsOption.Boolean
Enable lossless compression, QVipsOption.Int
Q factor, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jp2ksaveBuffer
As
jp2ksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
jp2ksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tile-width
VipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, losslessVipsOption.Boolean
Enable lossless compression, QVipsOption.Int
Q factor, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jp2ksaveTarget
As
jp2ksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
jp2ksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tile-width
VipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, losslessVipsOption.Boolean
Enable lossless compression, QVipsOption.Int
Q factor, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jpegload
Read a JPEG file into a VIPS image. It can read most 8-bit JPEG images, including CMYK and YCbCr.
shrink
means shrink by this integer factor during load. Possible values are 1, 2, 4 and 8. Shrinking during read is very much faster than decompressing the whole image and then shrinking later.Use
fail-on
to set the type of error that will cause load to fail. By default, loaders are permissive, that is,VipsFailOn.FAIL_ON_NONE
.Setting
autorotate
toTRUE
will make the loader interpret the orientation tag and automatically rotate the image appropriately during load.If
autorotate
isFALSE
, the metadata fieldVIPS_META_ORIENTATION
is set to the value of the orientation tag. Applications may read and interpret this field as they wish later in processing. Seeautorot(app.photofox.vipsffm.VipsOption...)
. Save operations will useVIPS_META_ORIENTATION
, if present, to set the orientation of output images.Example:
vips_jpegload("fred.jpg", &out, "shrink", 8, "fail_on", VIPS_FAIL_ON_TRUNCATED, NULL);
Any embedded ICC profiles are ignored: you always just get the RGB from the file. Instead, the embedded profile will be attached to the image as
VIPS_META_ICC_NAME
. You need to use something likeiccImport(app.photofox.vipsffm.VipsOption...)
to get CIE values from the file.EXIF metadata is attached as
VIPS_META_EXIF_NAME
, IPTC asVIPS_META_IPTC_NAME
, and XMP asVIPS_META_XMP_NAME
.The int metadata item "jpeg-multiscan" is set to the result of jpeg_has_multiple_scans(). Interlaced jpeg images need a large amount of memory to load, so this field gives callers a chance to handle these images differently.
The string-valued field "jpeg-chroma-subsample" gives the chroma subsample in standard notation. 4:4:4 means no subsample, 4:2:0 means YCbCr with Cb and Cr subsampled horizontally and vertically, 4:4:4:4 means a CMYK image with no subsampling.
The EXIF thumbnail, if present, is attached to the image as "jpeg-thumbnail-data". See
vips_image_get_blob
.See also:
jpegloadBuffer(app.photofox.vipsffm.VBlob, app.photofox.vipsffm.VipsOption...)
,vips_image_new_from_file
,autorot(app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- shrink
VipsOption.Int
Shrink factor on load, autorotateVipsOption.Boolean
Rotate image using exif orientation, unlimitedVipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jpegloadBuffer
Read a JPEG-formatted memory block into a VIPS image. Exactly as
jpegload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
jpegload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- shrink
VipsOption.Int
Shrink factor on load, autorotateVipsOption.Boolean
Rotate image using exif orientation, unlimitedVipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jpegloadSource
Read a JPEG-formatted memory block into a VIPS image. Exactly as
jpegload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
jpegload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- shrink
VipsOption.Int
Shrink factor on load, autorotateVipsOption.Boolean
Rotate image using exif orientation, unlimitedVipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jpegsave
Write a VIPS image to a file as JPEG.
Use
Q
to set the JPEG compression factor. Default 75.If
optimize-coding
is set, the Huffman tables are optimized. This is slightly slower and produces slightly smaller files.If
interlace
is set, the jpeg files will be interlaced (progressive jpeg, in jpg parlance). These files may be better for display over a slow network connection, but need much more memory to encode and decode.Chroma subsampling is normally automatically disabled for Q >= 90. You can force the subsampling mode with
subsample-mode
.If
trellis-quant
is set and the version of libjpeg supports it (e.g. mozjpeg >= 3.0), apply trellis quantisation to each 8x8 block. Reduces file size but increases compression time.If
overshoot-deringing
is set and the version of libjpeg supports it (e.g. mozjpeg >= 3.0), apply overshooting to samples with extreme values for example 0 and 255 for 8-bit. Overshooting may reduce ringing artifacts from compression, in particular in areas where black text appears on a white background.If
optimize-scans
is set and the version of libjpeg supports it (e.g. mozjpeg >= 3.0), split the spectrum of DCT coefficients into separate scans. Reduces file size but increases compression time.If
quant-table
is set and the version of libjpeg supports it (e.g. mozjpeg >= 3.0) it selects the quantization table to use:* 0 — Tables from JPEG Annex K (vips and libjpeg default) * 1 — Flat table * 2 — Table tuned for MSSIM on Kodak image set * 3 — Table from ImageMagick by N. Robidoux (current mozjpeg default) * 4 — Table tuned for PSNR-HVS-M on Kodak image set * 5 — Table from Relevance of Human Vision to JPEG-DCT Compression (1992) * 6 — Table from DCTune Perceptual Optimization of Compressed Dental X-Rays (1997) * 7 — Table from A Visual Detection Model for DCT Coefficient Quantization (1993) * 8 — Table from An Improved Detection Model for DCT Coefficient Quantization (1993)
Quantization table 0 is the default in vips and libjpeg(-turbo), but it tends to favor detail over color accuracy, producing colored patches and stripes as well as heavy banding in flat areas at high compression ratios. Quantization table 2 is a good candidate to try if the default quantization table produces banding or color shifts and is well suited for hires images. Quantization table 3 is the default in mozjpeg and has been tuned to produce good results at the default quality setting; banding at high compression. Quantization table 4 is the most accurate at the cost of compression ratio. Tables 5-7 are based on older research papers, but generally achieve worse compression ratios and/or quality than 2 or 4.
For maximum compression with mozjpeg, a useful set of options is `strip, optimize-coding, interlace, optimize-scans, trellis-quant, quant_table=3`.
By default, the output stream won't have restart markers. If a non-zero restart_interval is specified, a restart marker will be added after each specified number of MCU blocks. This makes the stream more recoverable if there are transmission errors, but also allows for some decoders to read part of the JPEG without decoding the whole stream.
The image is automatically converted to RGB, Monochrome or CMYK before saving.
EXIF data is constructed from
VIPS_META_EXIF_NAME
, then modified with any other related tags on the image before being written to the file.VIPS_META_RESOLUTION_UNIT
is used to set the EXIF resolution unit.VIPS_META_ORIENTATION
is used to set the EXIF orientation tag.IPTC as
VIPS_META_IPTC_NAME
and XMP asVIPS_META_XMP_NAME
are coded and attached.See also:
jpegsaveBuffer(app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, optimize-codingVipsOption.Boolean
Compute optimal Huffman coding tables, interlaceVipsOption.Boolean
Generate an interlaced (progressive) jpeg, no-subsampleVipsOption.Boolean
Disable chroma subsample, trellis-quantVipsOption.Boolean
Apply trellis quantisation to each 8x8 block, overshoot-deringingVipsOption.Boolean
Apply overshooting to samples with extreme values, optimize-scansVipsOption.Boolean
Split spectrum of DCT coefficients into separate scans, quant-tableVipsOption.Int
Use predefined quantization table with given index, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, restart-intervalVipsOption.Int
Add restart markers every specified number of mcu, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jpegsaveBuffer
As
jpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
obuf
, the length of the buffer inolen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
jpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, optimize-codingVipsOption.Boolean
Compute optimal Huffman coding tables, interlaceVipsOption.Boolean
Generate an interlaced (progressive) jpeg, no-subsampleVipsOption.Boolean
Disable chroma subsample, trellis-quantVipsOption.Boolean
Apply trellis quantisation to each 8x8 block, overshoot-deringingVipsOption.Boolean
Apply overshooting to samples with extreme values, optimize-scansVipsOption.Boolean
Split spectrum of DCT coefficients into separate scans, quant-tableVipsOption.Int
Use predefined quantization table with given index, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, restart-intervalVipsOption.Int
Add restart markers every specified number of mcu, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jpegsaveMime
As
jpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save as a mime jpeg on stdout.See also:
jpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, optimize-codingVipsOption.Boolean
Compute optimal Huffman coding tables, interlaceVipsOption.Boolean
Generate an interlaced (progressive) jpeg, no-subsampleVipsOption.Boolean
Disable chroma subsample, trellis-quantVipsOption.Boolean
Apply trellis quantisation to each 8x8 block, overshoot-deringingVipsOption.Boolean
Apply overshooting to samples with extreme values, optimize-scansVipsOption.Boolean
Split spectrum of DCT coefficients into separate scans, quant-tableVipsOption.Int
Use predefined quantization table with given index, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, restart-intervalVipsOption.Int
Add restart markers every specified number of mcu, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jpegsaveTarget
As
jpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
jpegsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, optimize-codingVipsOption.Boolean
Compute optimal Huffman coding tables, interlaceVipsOption.Boolean
Generate an interlaced (progressive) jpeg, no-subsampleVipsOption.Boolean
Disable chroma subsample, trellis-quantVipsOption.Boolean
Apply trellis quantisation to each 8x8 block, overshoot-deringingVipsOption.Boolean
Apply overshooting to samples with extreme values, optimize-scansVipsOption.Boolean
Split spectrum of DCT coefficients into separate scans, quant-tableVipsOption.Int
Use predefined quantization table with given index, subsample-modeVipsOption.Enum
VipsForeignSubsample
Select chroma subsample operation mode, restart-intervalVipsOption.Int
Add restart markers every specified number of mcu, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jxlload
Read a JPEG-XL image.
The JPEG-XL loader and saver are experimental features and may change in future libvips versions.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jxlloadBuffer
Exactly as
jxlload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a buffer.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jxlloadSource
Exactly as
jxlload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
jxlsave
Write a VIPS image to a file in JPEG-XL format.
The JPEG-XL loader and saver are experimental features and may change in future libvips versions.
tier
sets the overall decode speed the encoder will target. Minimum is 0 (highest quality), and maximum is 4 (lowest quality). Default is 0.distance
sets the target maximum encoding error. Minimum is 0 (highest quality), and maximum is 15 (lowest quality). Default is 1.0 (visually lossless).As a convenience, you can also use
Q
to setdistance
.Q
uses approximately the same scale as regular JPEG.Set
lossless
to enable lossless compression.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tier
VipsOption.Int
Decode speed tier, distanceVipsOption.Double
Target butteraugli distance, effortVipsOption.Int
Encoding effort, losslessVipsOption.Boolean
Enable lossless compression, QVipsOption.Int
Quality factor, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jxlsaveBuffer
As
jxlsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.See also:
jxlsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tier
VipsOption.Int
Decode speed tier, distanceVipsOption.Double
Target butteraugli distance, effortVipsOption.Int
Encoding effort, losslessVipsOption.Boolean
Enable lossless compression, QVipsOption.Int
Quality factor, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
jxlsaveTarget
As
jxlsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
jxlsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tier
VipsOption.Int
Decode speed tier, distanceVipsOption.Double
Target butteraugli distance, effortVipsOption.Int
Encoding effort, losslessVipsOption.Boolean
Enable lossless compression, QVipsOption.Int
Quality factor, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
labelregions
Repeatedly scans
in
for regions of 4-connected pixels with the same pixel value. Every time a region is discovered, those pixels are marked inmask
with a unique serial number. Once all pixels have been labelled, the operation returns, settingsegments
to the number of discrete regions which were detected.mask
is always a 1-bandVipsBandFormat.FORMAT_INT
image of the same dimensions asin
.This operation is useful for, for example, blob counting. You can use the morphological operators to detect and isolate a series of objects, then use
labelregions
to number them all.Use
histFindIndexed(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
to (for example) find blob coordinates.See also:
histFindIndexed(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- segments
VipsOption.Int
Number of discrete contiguous regions
-
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. Setuchar
to output uchar pixels.If the arrays of constants have just one element, that constant is used for all image bands. If the arrays have more than one element and they have the same number of elements as there are bands in the image, then one array element is used for each band. If the arrays have more than one element and the image only has a single band, the result is a many-band image where each band corresponds to one array element.
See also:
vips_linear1
,add(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
a
- Multiply by thisb
- Add thisargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output should be uchar
-
linecache
This operation behaves rather like
copy(app.photofox.vipsffm.VipsOption...)
between imagesin
andout
, except that it keeps a cache of computed scanlines.The number of lines cached is enough for a small amount of non-local access.
Each cache tile is made with a single call to
vips_region_prepare
.When the cache fills, a tile is chosen for reuse. If
access
isVipsAccess.ACCESS_RANDOM
, then the least-recently-used tile is reused. Ifaccess
isVipsAccess.ACCESS_SEQUENTIAL
, then the top-most tile is reused.access
defaults toVipsAccess.ACCESS_RANDOM
.tile-height
can be used to set the size of the strips thatlinecache
uses. The default is 1 (a single scanline).Normally, only a single thread at once is allowed to calculate tiles. If you set
threaded
toTRUE
,linecache
will allow many threads to calculate tiles at once and share the cache between them.See also:
vips_cache
,tilecache(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tile-height
VipsOption.Int
Tile height in pixels, accessVipsOption.Enum
VipsAccess
Expected access pattern, threadedVipsOption.Boolean
Allow threaded access, persistentVipsOption.Boolean
Keep cache between evaluations
-
logmat
Creates a circularly symmetric Laplacian of Gaussian mask of radius
sigma
. The size of the mask is determined by the variableminAmpl
; if for instance the value .1 is entered this means that the produced mask is clipped at values within 10 percent of zero, and where the change between mask elements is less than 10%.The program uses the following equation: (from Handbook of Pattern Recognition and image processing by Young and Fu, AP 1986 pages 220-221): H(r) = (1 / (2 * M_PI * s4)) * (2 - (r2 / s2)) * exp(-r2 / (2 * s2))
where s2 =
sigma
*sigma
, s4 = s2 * s2, r2 = r * r.The generated mask has odd size and its maximum value is normalised to 1.0, unless
precision
isVipsPrecision.PRECISION_INTEGER
.If
separable
is set, only the centre horizontal is generated. This is useful for separable convolutions.If
precision
isVipsPrecision.PRECISION_INTEGER
, an integer mask is generated. This is useful for integer convolutions."scale" is set to the sum of all the mask elements.
See also:
gaussmat(double, double, app.photofox.vipsffm.VipsOption...)
,conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sigma
- Radius of GaussianminAmpl
- Minimum amplitude of Gaussianargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- separable
VipsOption.Boolean
Generate separable Gaussian, integerVipsOption.Boolean
Generate integer Gaussian, precisionVipsOption.Enum
VipsPrecision
Generate with this precision
-
magickload
Read in an image using libMagick, the ImageMagick library. This library can read more than 80 file formats, including SVG, BMP, EPS, DICOM and many others. The reader can handle any ImageMagick image, including the float and double formats. It will work with any quantum size, including HDR. Any metadata attached to the libMagick image is copied on to the VIPS image.
The reader should also work with most versions of GraphicsMagick. See the "--with-magickpackage" configure option.
The file format is usually guessed from the filename suffix, or sniffed from the file contents.
Normally it will only load the first image in a many-image sequence (such as a GIF or a PDF). Use
page
andn
to set the start page and number of pages to load. Setn
to -1 to load all pages frompage
onwards.density
is "WxH" in DPI, e.g. "600x300" or "600" (default is "72x72"). See the [density docs](http://www.imagemagick.org/script/command-line-options.phpdensity
) on the imagemagick website.See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- density
VipsOption.String
Canvas resolution for rendering vector formats like SVG, pageVipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, all-framesVipsOption.Boolean
Read all frames from an image, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
magickloadBuffer
Read an image memory block using libMagick into a VIPS image. Exactly as
magickload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory source.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
magickload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- density
VipsOption.String
Canvas resolution for rendering vector formats like SVG, pageVipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, all-framesVipsOption.Boolean
Read all frames from an image, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
magicksave
Write an image using libMagick.
Use
quality
to set the quality factor. Default 0.Use
format
to explicitly set the save format, for example, "BMP". Otherwise the format is guessed from the filename suffix.If
optimize-gif-frames
is set, GIF frames are cropped to the smallest size while preserving the results of the GIF animation. This takes some time for computation but saves some time on encoding and produces smaller files in some cases.If
optimize-gif-transparency
is set, pixels that don't change the image through animation are made transparent. This takes some time for computation but saves some time on encoding and produces smaller files in some cases.bitdepth
specifies the number of bits per pixel. The image will be quantized and dithered if the value is within the valid range (1 to 8).See also:
magicksaveBuffer(app.photofox.vipsffm.VipsOption...)
,magickload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.String
Format to save in, qualityVipsOption.Int
Quality to use, optimize-gif-framesVipsOption.Boolean
Apply GIF frames optimization, optimize-gif-transparencyVipsOption.Boolean
Apply GIF transparency optimization, bitdepthVipsOption.Int
Number of bits per pixel, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
magicksaveBmp
@Deprecated(forRemoval=true) public void magicksaveBmp(String filename, VipsOption... args) throws VipsError Deprecated, for removal: This API element is subject to removal in a future version.Save bmp image with ImageMagick- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.String
Format to save in, qualityVipsOption.Int
Quality to use, optimize-gif-framesVipsOption.Boolean
Apply GIF frames optimization, optimize-gif-transparencyVipsOption.Boolean
Apply GIF transparency optimization, bitdepthVipsOption.Int
Number of bits per pixel, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
magicksaveBmpBuffer
Deprecated, for removal: This API element is subject to removal in a future version.Save bmp image to magick buffer- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.String
Format to save in, qualityVipsOption.Int
Quality to use, optimize-gif-framesVipsOption.Boolean
Apply GIF frames optimization, optimize-gif-transparencyVipsOption.Boolean
Apply GIF transparency optimization, bitdepthVipsOption.Int
Number of bits per pixel, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
magicksaveBuffer
As
magicksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
obuf
, the length of the buffer inolen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
magicksave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.String
Format to save in, qualityVipsOption.Int
Quality to use, optimize-gif-framesVipsOption.Boolean
Apply GIF frames optimization, optimize-gif-transparencyVipsOption.Boolean
Apply GIF transparency optimization, bitdepthVipsOption.Int
Number of bits per pixel, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
mapim
This operator resamples
in
usingindex
to look up pixels.out
is the same size asindex
, with each pixel being fetched from that position inin
. That is:out[x, y] = in[index[x, y]]
If
index
has one band, that band must be complex. Otherwise,index
must have two bands of any format.Coordinates in
index
are in pixels, with (0, 0) being the top-left corner ofin
, and with y increasing down the image. Usexyz(int, int, app.photofox.vipsffm.VipsOption...)
to build index images.interpolate
defaults to bilinear.By default, new pixels are filled with
background
. This defaults to zero (black). You can set other extend types withextend
.VipsExtend.EXTEND_COPY
is better for image upsizing.Image are normally treated as unpremultiplied, so this operation can be used directly on PNG images. If your images have been through
premultiply(app.photofox.vipsffm.VipsOption...)
, setpremultiplied
.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See
maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
for a 1D equivalent of this operation.See also:
xyz(int, int, app.photofox.vipsffm.VipsOption...)
,affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,VipsInterpolate
.- Parameters:
index
- Index pixels with thisargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- interpolate
VipsOption.Interpolate
Interpolate pixels with this, backgroundVipsOption.ArrayDouble
Background value, premultipliedVipsOption.Boolean
Images have premultiplied alpha, extendVipsOption.Enum
VipsExtend
How to generate the extra pixels
-
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.
The input image will be cast to one of the unsigned integer types, that is, VIPS_FORMAT_UCHAR, VIPS_FORMAT_USHORT or VIPS_FORMAT_UINT.
If
lut
is too small for the input type (for example, ifin
is VIPS_FORMAT_UCHAR butlut
only has 100 elements), the lut is padded out by copying the last element. Overflows are reported at the end of computation. Iflut
is too large, extra values are ignored.If
lut
has one band andband
is -1 (the default), then all bands ofin
pass throughlut
. Ifband
is >= 0, then just that band ofin
passes throughlut
and other bands are just copied.If
lut
has same number of bands asin
, then each band is mapped separately. Ifin
has one band, thenlut
may have many bands and the output will have the same number of bands aslut
.See also:
histFind(app.photofox.vipsffm.VipsOption...)
,identity(app.photofox.vipsffm.VipsOption...)
.- Parameters:
lut
- Look-up table imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- band
VipsOption.Int
Apply one-band lut to this band of in
-
maskButterworth
public VImage maskButterworth(int width, int height, double order, double frequencyCutoff, double amplitudeCutoff, VipsOption... args) throws VipsError Make an butterworth high- or low-pass filter, that is, one with a variable, smooth transition positioned at
frequencyCutoff
, wherefrequencyCutoff
is in range 0 - 1. The shape of the curve is controlled byorder
--- higher values give a sharper transition. See Gonzalez and Wintz, Digital Image Processing, 1987.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsorder
- Filter orderfrequencyCutoff
- Frequency cutoffamplitudeCutoff
- Amplitude cutoffargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskButterworthBand
public VImage maskButterworthBand(int width, int height, double order, double frequencyCutoffX, double frequencyCutoffY, double radius, double amplitudeCutoff, VipsOption... args) throws VipsError Make an butterworth band-pass or band-reject filter, that is, one with a variable, smooth transition positioned at
frequencyCutoffX
,frequencyCutoffY
, of radiusradius
. The shape of the curve is controlled byorder
--- higher values give a sharper transition. See Gonzalez and Wintz, Digital Image Processing, 1987.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsorder
- Filter orderfrequencyCutoffX
- Frequency cutoff xfrequencyCutoffY
- Frequency cutoff yradius
- Radius of circleamplitudeCutoff
- Amplitude cutoffargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskButterworthRing
public VImage maskButterworthRing(int width, int height, double order, double frequencyCutoff, double amplitudeCutoff, double ringwidth, VipsOption... args) throws VipsError Make a butterworth ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at
frequencyCutoff
of widthwidth
, wherefrequencyCutoff
is in the range 0 - 1. The shape of the curve is controlled byorder
--- higher values give a sharper transition. See Gonzalez and Wintz, Digital Image Processing, 1987.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsorder
- Filter orderfrequencyCutoff
- Frequency cutoffamplitudeCutoff
- Amplitude cutoffringwidth
- Ringwidthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskFractal
public VImage maskFractal(int width, int height, double fractalDimension, VipsOption... args) throws VipsError This operation should be used to create fractal images by filtering the power spectrum of Gaussian white noise. See
gaussnoise(int, int, app.photofox.vipsffm.VipsOption...)
.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfractalDimension
- Fractal dimensionargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskGaussian
public VImage maskGaussian(int width, int height, double frequencyCutoff, double amplitudeCutoff, VipsOption... args) throws VipsError Make a gaussian high- or low-pass filter, that is, one with a variable, smooth transition positioned at
frequencyCutoff
.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfrequencyCutoff
- Frequency cutoffamplitudeCutoff
- Amplitude cutoffargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskGaussianBand
public VImage maskGaussianBand(int width, int height, double frequencyCutoffX, double frequencyCutoffY, double radius, double amplitudeCutoff, VipsOption... args) throws VipsError Make a gaussian band-pass or band-reject filter, that is, one with a variable, smooth transition positioned at
frequencyCutoffX
,frequencyCutoffY
, of radiusradius
.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfrequencyCutoffX
- Frequency cutoff xfrequencyCutoffY
- Frequency cutoff yradius
- Radius of circleamplitudeCutoff
- Amplitude cutoffargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskGaussianRing
public VImage maskGaussianRing(int width, int height, double frequencyCutoff, double amplitudeCutoff, double ringwidth, VipsOption... args) throws VipsError Make a gaussian ring-pass or ring-reject filter, that is, one with a variable, smooth transition positioned at
frequencyCutoff
of widthringwidth
.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfrequencyCutoff
- Frequency cutoffamplitudeCutoff
- Amplitude cutoffringwidth
- Ringwidthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskIdeal
public VImage maskIdeal(int width, int height, double frequencyCutoff, VipsOption... args) throws VipsError Make an ideal high- or low-pass filter, that is, one with a sharp cutoff positioned at
frequencyCutoff
, wherefrequencyCutoff
is in the range 0 - 1.This operation creates a one-band float image of the specified size. The image has values in the range [0, 1] and is typically used for multiplying against frequency domain images to filter them. Masks are created with the DC component at (0, 0). The DC pixel always has the value 1.0.
Set
nodc
to not set the DC pixel.Set
optical
to position the DC component in the centre of the image. This makes the mask suitable for multiplying against optical Fourier transforms. Seewrap(app.photofox.vipsffm.VipsOption...)
.Set
reject
to invert the sense of the filter. For example, low-pass becomes low-reject.Set
uchar
to output an 8-bit unsigned char image rather than a float image. In this case, pixels are in the range [0 - 255].See also:
maskIdeal
,maskIdealRing(int, int, double, double, app.photofox.vipsffm.VipsOption...)
,maskIdealBand(int, int, double, double, double, app.photofox.vipsffm.VipsOption...)
,maskButterworth(int, int, double, double, double, app.photofox.vipsffm.VipsOption...)
,maskButterworthRing(int, int, double, double, double, double, app.photofox.vipsffm.VipsOption...)
,maskButterworthBand(int, int, double, double, double, double, double, app.photofox.vipsffm.VipsOption...)
,maskGaussian(int, int, double, double, app.photofox.vipsffm.VipsOption...)
,maskGaussianRing(int, int, double, double, double, app.photofox.vipsffm.VipsOption...)
,maskGaussianBand(int, int, double, double, double, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfrequencyCutoff
- Frequency cutoffargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskIdealBand
public VImage maskIdealBand(int width, int height, double frequencyCutoffX, double frequencyCutoffY, double radius, VipsOption... args) throws VipsError Make an ideal band-pass or band-reject filter, that is, one with a sharp cutoff around the point
frequencyCutoffX
,frequencyCutoffY
, of sizeradius
.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfrequencyCutoffX
- Frequency cutoff xfrequencyCutoffY
- Frequency cutoff yradius
- Radius of circleargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
maskIdealRing
public VImage maskIdealRing(int width, int height, double frequencyCutoff, double ringwidth, VipsOption... args) throws VipsError Make an ideal ring-pass or ring-reject filter, that is, one with a sharp ring positioned at
frequencyCutoff
of widthwidth
, wherefrequencyCutoff
andwidth
are expressed as the range 0 - 1.See also:
maskIdeal(int, int, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsfrequencyCutoff
- Frequency cutoffringwidth
- Ringwidthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, nodcVipsOption.Boolean
Remove DC component, rejectVipsOption.Boolean
Invert the sense of the filter, opticalVipsOption.Boolean
Rotate quadrants to optical space
-
match
public VImage match(VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VipsOption... args) throws VipsError Scale, rotate and translate
sec
so that the tie-points line up.If
search
isTRUE
, before performing the transformation, the tie-points are improved by searching an area ofsec
of sizeharea
for a match of sizehwindow
toref
.This function will only work well for small rotates and scales.
- Parameters:
sec
- Secondary imagexr1
- Position of first reference tie-pointyr1
- Position of first reference tie-pointxs1
- Position of first secondary tie-pointys1
- Position of first secondary tie-pointxr2
- Position of second reference tie-pointyr2
- Position of second reference tie-pointxs2
- Position of second secondary tie-pointys2
- Position of second secondary tie-pointargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- hwindow
VipsOption.Int
Half window size, hareaVipsOption.Int
Half area size, searchVipsOption.Boolean
Search to improve tie-points, interpolateVipsOption.Interpolate
Interpolate pixels with this
-
math
Perform various functions in -lm, the maths library, on images.
Angles are expressed in degrees. The output type is float unless the input is double, in which case the output is double.
Non-complex images only.
- Parameters:
math
-VipsOperationMath
Math to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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 ofleft
orright
are double, in which caseout
is also double.It detects division by zero, setting those pixels to zero in the output. Beware: it does this silently!
If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), and that format is the result type.- Parameters:
right
- Right-hand image argumentmath2
-VipsOperationMath2
Math to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
math2Const
public VImage math2Const(VipsOperationMath2 math2, List<Double> c, VipsOption... args) throws VipsError 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 thatin
is double, in which caseout
is also double.It detects division by zero, setting those pixels to zero in the output. Beware: it does this silently!
If the array of constants has just one element, that constant is used for all image bands. If the array has more than one element and they have the same number of elements as there are bands in the image, then one array element is used for each band. If the arrays have more than one element and the image only has a single band, the result is a many-band image where each band corresponds to one array element.
See also:
math2(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationMath2, app.photofox.vipsffm.VipsOption...)
,math(app.photofox.vipsffm.enums.VipsOperationMath, app.photofox.vipsffm.VipsOption...)
.- Parameters:
math2
-VipsOperationMath2
Math to performc
- Array of constantsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
matload
Read a Matlab save file into a VIPS image.
This operation searches the save file for the first array variable with between 1 and 3 dimensions and loads it as an image. It will not handle complex images. It does not handle sparse matrices.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
matrixinvert
This operation calculates the inverse of the matrix represented in
m
. The scale and offset members of the input matrix are ignored.See also:
matrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
matrixload
Reads a matrix from a file.
Matrix files have a simple format that's supposed to be easy to create with a text editor or a spreadsheet.
The first line has four numbers for width, height, scale and offset (scale and offset may be omitted, in which case they default to 1.0 and 0.0). Scale must be non-zero. Width and height must be positive integers. The numbers are separated by any mixture of spaces, commas, tabs and quotation marks ("). The scale and offset fields may be floating-point, and must use '.' as a decimal separator.
Subsequent lines each hold one row of matrix data, with numbers again separated by any mixture of spaces, commas, tabs and quotation marks ("). The numbers may be floating-point, and must use '.' as a decimal separator.
Extra characters at the ends of lines or at the end of the file are ignored.
See also:
matrixload
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
matrixloadSource
Exactly as
matrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
matrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
matrixprint
Print
in
tostdout
in matrix format. Seematrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
for a description of the format.See also:
matrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
matrixsave
Write
in
tofilename
in matrix format. Seematrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
for a description of the format.See also:
matrixload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
matrixsaveTarget
As
matrixsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
matrixsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
max
This operation finds the maximum value in an image.
By default it finds the single largest value. If
size
is set >1, it will find thesize
largest values. It will stop searching early if has found enough values. Equal values will be sorted by y then x.It operates on all bands of the input image: use
stats(app.photofox.vipsffm.VipsOption...)
if you need to find an maximum for each band.For complex images, this operation finds the maximum modulus.
You can read out the position of the maximum with
x
andy
. You can read out arrays of the values and positions of the topsize
maxima without-array
,x-array
andy-array
. These values are returned sorted from largest to smallest.If there are more than
size
maxima, the maxima returned will be a random selection of the maxima in the image.See also:
min(app.photofox.vipsffm.VipsOption...)
,stats(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- x
VipsOption.Int
Horizontal position of maximum, yVipsOption.Int
Vertical position of maximum, sizeVipsOption.Int
Number of maximum values to find, out-arrayVipsOption.ArrayDouble
Array of output values, x-arrayVipsOption.ArrayInt
Array of horizontal positions, y-arrayVipsOption.ArrayInt
Array of vertical positions
-
maxpair
For each pixel, pick the maximum of a pair of images.
See also:
minpair(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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.
If the chart does not fill the whole image, use the optional
left
,top
,width
,height
arguments to indicate the position of the chart.See also:
avg(app.photofox.vipsffm.VipsOption...)
,deviate(app.photofox.vipsffm.VipsOption...)
.- Parameters:
h
- Number of patches across chartv
- Number of patches down chartargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- left
VipsOption.Int
Left edge of extract area, topVipsOption.Int
Top edge of extract area, widthVipsOption.Int
Width of extract area, heightVipsOption.Int
Height of extract area
-
merge
public VImage merge(VImage sec, VipsDirection direction, int dx, int dy, VipsOption... args) throws VipsError This operation joins two images left-right (with
ref
on the left) or up-down (withref
above) with a smooth seam.If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common type (see table Smallest common format in
arithmetic
).dx
anddy
give the displacement ofsec
relative toref
, in other words, the vector to get from the origin ofsec
to the origin ofref
, in other words,dx
will generally be a negative number.mblend
limits the maximum width of the blend area. A value of "-1" means "unlimited". The two images are blended with a raised cosine.Pixels with all bands equal to zero are "transparent", that is, zero pixels in the overlap area do not contribute to the merge. This makes it possible to join non-rectangular images.
See also:
mosaic(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, int, int, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sec
- Secondary imagedirection
-VipsDirection
Horizontal or vertical mergedx
- Horizontal displacement from sec to refdy
- Vertical displacement from sec to refargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- mblend
VipsOption.Int
Maximum blend size
-
min
This operation finds the minimum value in an image.
By default it finds the single smallest value. If
size
is set >1, it will find thesize
smallest values. It will stop searching early if has found enough values. Equal values will be sorted by y then x.It operates on all bands of the input image: use
stats(app.photofox.vipsffm.VipsOption...)
if you need to find an minimum for each band.For complex images, this operation finds the minimum modulus.
You can read out the position of the minimum with
x
andy
. You can read out arrays of the values and positions of the topsize
minima without-array
,x-array
andy-array
. These values are returned sorted from smallest to largest.If there are more than
size
minima, the minima returned will be a random selection of the minima in the image.See also:
min
,stats(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- x
VipsOption.Int
Horizontal position of minimum, yVipsOption.Int
Vertical position of minimum, sizeVipsOption.Int
Number of minimum values to find, out-arrayVipsOption.ArrayDouble
Array of output values, x-arrayVipsOption.ArrayInt
Array of horizontal positions, y-arrayVipsOption.ArrayInt
Array of vertical positions
-
minpair
For each pixel, pick the minimum of a pair of images.
See also:
minpair
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
morph
public VImage morph(VImage mask, VipsOperationMorphology morph, VipsOption... args) throws VipsError Performs a morphological operation on
in
usingmask
as a structuring element.The image should have 0 (black) for no object and 255 (non-zero) for an object. Note that this is the reverse of the usual convention for these operations, but more convenient when combined with the boolean operators. The output image is the same size as the input image: edge pxels are made by expanding the input image as necessary.
Mask coefficients can be either 0 (for object) or 255 (for background) or 128 (for do not care). The origin of the mask is at location (m.xsize / 2, m.ysize / 2), integer division. All algorithms have been based on the book "Fundamentals of Digital Image Processing" by A. Jain, pp 384-388, Prentice-Hall, 1989.
For
VipsOperationMorphology.OPERATION_MORPHOLOGY_ERODE
, the whole mask must match for the output pixel to be set, that is, the result is the logical AND of the selected input pixels.For
VipsOperationMorphology.OPERATION_MORPHOLOGY_DILATE
, the output pixel is set if any part of the mask matches, that is, the result is the logical OR of the selected input pixels.See the boolean operations
vips_andimage
,vips_orimage
andvips_eorimage
for analogues of the usual set difference and set union operations.Operations are performed using the processor's vector unit, if possible. Disable this with `--vips-novector` or `VIPS_NOVECTOR` or
vips_vector_set_enabled
- Parameters:
mask
- Input matrix imagemorph
-VipsOperationMorphology
Morphological operation to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
mosaic
public VImage mosaic(VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VipsOption... args) throws VipsError This operation joins two images left-right (with
ref
on the left) or top-bottom (withref
above) given an approximate overlap.sec
is positioned so that the pixel (xsec
,ysec
) insec
lies on top of the pixel (xref
,yref
) inref
. The overlap area is divided into three sections, 20 high-contrast points in bandbandno
of imageref
are found in each, and a window of pixels of sizehwindow
around each high-contrast point is searched for insec
over an area ofharea
.A linear model is fitted to the 60 tie-points, points a long way from the fit are discarded, and the model refitted until either too few points remain or the model reaches good agreement.
The detected displacement is used with
merge(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, int, int, app.photofox.vipsffm.VipsOption...)
to join the two images together.You can read out the detected transform with
dx0
,dy0
,scale1
,angle1
,dx1
,dy1
.See also:
merge(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
sec
- Secondary imagedirection
-VipsDirection
Horizontal or vertical mosaicxref
- Position of reference tie-pointyref
- Position of reference tie-pointxsec
- Position of secondary tie-pointysec
- Position of secondary tie-pointargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- hwindow
VipsOption.Int
Half window size, hareaVipsOption.Int
Half area size, mblendVipsOption.Int
Maximum blend size, bandnoVipsOption.Int
Band to search for features on, dx0VipsOption.Int
Detected integer offset, dy0VipsOption.Int
Detected integer offset, scale1VipsOption.Double
Detected scale, angle1VipsOption.Double
Detected rotation, dy1VipsOption.Double
Detected first-order displacement, dx1VipsOption.Double
Detected first-order displacement
-
mosaic1
public VImage mosaic1(VImage sec, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VipsOption... args) throws VipsError This operation joins two images top-bottom (with
sec
on the right) or left-right (withsec
at the bottom) given an approximate pair of tie-points.sec
is scaled and rotated as necessary before the join.If
search
isTRUE
, before performing the transformation, the tie-points are improved by searching an area ofsec
of sizeharea
for a object of sizehwindow
inref
.mblend
limits the maximum size of the blend area. A value of "-1" means "unlimited". The two images are blended with a raised cosine.Pixels with all bands equal to zero are "transparent", that is, zero pixels in the overlap area do not contribute to the merge. This makes it possible to join non-rectangular images.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common type (see table Smallest common format in
arithmetic
).See also:
merge(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsDirection, int, int, app.photofox.vipsffm.VipsOption...)
,insert(app.photofox.vipsffm.VImage, int, int, app.photofox.vipsffm.VipsOption...)
,globalbalance(app.photofox.vipsffm.VipsOption...)
.- Parameters:
sec
- Secondary imagedirection
-VipsDirection
Horizontal or vertical mosaicxr1
- Position of first reference tie-pointyr1
- Position of first reference tie-pointxs1
- Position of first secondary tie-pointys1
- Position of first secondary tie-pointxr2
- Position of second reference tie-pointyr2
- Position of second reference tie-pointxs2
- Position of second secondary tie-pointys2
- Position of second secondary tie-pointargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- hwindow
VipsOption.Int
Half window size, hareaVipsOption.Int
Half area size, searchVipsOption.Boolean
Search to improve tie-points, interpolateVipsOption.Interpolate
Interpolate pixels with this, mblendVipsOption.Int
Maximum blend size, bandnoVipsOption.Int
Band to search for features on
-
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.
Use
band
to make a one-band 8-bit image.This operator also works for LABQ coding.
See also:
scale(app.photofox.vipsffm.VipsOption...)
,cast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- band
VipsOption.Int
Band to msb
-
multiply
This operation calculates
left
*right
and writes the result toout
.If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), then the following table is used to determine the output type:<table> <title>VipsMultiply type promotion</title> <tgroup cols='2' align='left' colsep='1' rowsep='1'> <thead> <row> <entry>input type</entry> <entry>output type</entry> </row> </thead> <tbody> <row> <entry>uchar</entry> <entry>ushort</entry> </row> <row> <entry>char</entry> <entry>short</entry> </row> <row> <entry>ushort</entry> <entry>uint</entry> </row> <row> <entry>short</entry> <entry>int</entry> </row> <row> <entry>uint</entry> <entry>uint</entry> </row> <row> <entry>int</entry> <entry>int</entry> </row> <row> <entry>float</entry> <entry>float</entry> </row> <row> <entry>double</entry> <entry>double</entry> </row> <row> <entry>complex</entry> <entry>complex</entry> </row> <row> <entry>double complex</entry> <entry>double complex</entry> </row> </tbody> </tgroup> </table>
In other words, the output type is just large enough to hold the whole range of possible values.
See also:
add(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,linear(java.util.List<java.lang.Double>, java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
openexrload
Read a OpenEXR file into a VIPS image.
The reader can handle scanline and tiled OpenEXR images. It can't handle OpenEXR colour management, image attributes, many pixel formats, anything other than RGBA.
This reader uses the rather limited OpenEXR C API. It should really be redone in C++.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
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.
To facilitate zooming, virtual slide formats include multiple scaled-down versions of the high-resolution image. These are typically called "levels". By default,
openslideload
reads the highest-resolution level (level 0). Setlevel
to the level number you want.In addition to the slide image itself, virtual slide formats sometimes include additional images, such as a scan of the slide's barcode. OpenSlide calls these "associated images". To read an associated image, set
associated
to the image's name. A slide's associated images are listed in the "slide-associated-images" metadata item.If you set
attach-associated
, then all associated images are attached as metadata items. Usevips_image_get_image
onout
to retrieve them. Images are attached as "openslide-associated-XXXXX", where XXXXX is the name of the associated image.By default, the output of this operator is RGBA. Set
rgb
to enable RGB output.See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- level
VipsOption.Int
Load this level from the file, autocropVipsOption.Boolean
Crop to image bounds, associatedVipsOption.String
Load this associated image, attach-associatedVipsOption.Boolean
Attach all associated images, rgbVipsOption.Boolean
Output RGB (not RGBA), flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
openslideloadSource
Exactly as
openslideload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- level
VipsOption.Int
Load this level from the file, autocropVipsOption.Boolean
Crop to image bounds, associatedVipsOption.String
Load this associated image, attach-associatedVipsOption.Boolean
Attach all associated images, rgbVipsOption.Boolean
Output RGB (not RGBA), flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
pbmsaveTarget
@Deprecated(forRemoval=true) public void pbmsaveTarget(VTarget target, VipsOption... args) throws VipsError Deprecated, for removal: This API element is subject to removal in a future version.Save image in pbm format- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.Enum
VipsForeignPpmFormat
Format to save in, asciiVipsOption.Boolean
Save as ascii, squashVipsOption.Boolean
Save as one bit, bitdepthVipsOption.Int
Set to 1 to write as a 1 bit image, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
pdfload
Render a PDF file into a VIPS image.
The output image is always RGBA --- CMYK PDFs will be converted. If you need CMYK bitmaps, you should use
magickload(java.lang.String, app.photofox.vipsffm.VipsOption...)
instead.Use
page
to select a page to render, numbering from zero.Use
n
to select the number of pages to render. The default is 1. Pages are rendered in a vertical column, with each individual page aligned to the left. Set to -1 to mean "until the end of the document". Usegrid(int, int, int, app.photofox.vipsffm.VipsOption...)
to change page layout.Use
dpi
to set the rendering resolution. The default is 72. Additionally, you can scale by settingscale
. If you set both, they combine.Use
background
to set the background RGBA colour. The default is 255 (solid white), use eg. 0 for a transparent background.Use
password
to supply a decryption password.The operation fills a number of header fields with metadata, for example "pdf-author". They may be useful.
This function only reads the image header and does not render any pixel data. Rendering occurs when pixels are accessed.
See also:
vips_image_new_from_file
,magickload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, dpiVipsOption.Double
DPI to render at, scaleVipsOption.Double
Factor to scale by, backgroundVipsOption.ArrayDouble
Background colour, passwordVipsOption.String
Password to decrypt with, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
pdfloadBuffer
Read a PDF-formatted memory buffer into a VIPS image. Exactly as
pdfload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from memory.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
pdfload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, dpiVipsOption.Double
DPI to render at, scaleVipsOption.Double
Factor to scale by, backgroundVipsOption.ArrayDouble
Background colour, passwordVipsOption.String
Password to decrypt with, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
pdfloadSource
Exactly as
pdfload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
pdfload(java.lang.String, app.photofox.vipsffm.VipsOption...)
- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, dpiVipsOption.Double
DPI to render at, scaleVipsOption.Double
Factor to scale by, backgroundVipsOption.ArrayDouble
Background colour, passwordVipsOption.String
Password to decrypt with, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
percent
percent
returns (through thethreshold
parameter) the threshold below which there arepercent
values ofin
. For example:$ vips percent k2.jpg 90 214
Means that 90% of pixels in `k2.jpg` have a value less than 214.
The function works for uchar and ushort images only. It can be used to threshold the scaled result of a filtering operation.
See also:
histFind(app.photofox.vipsffm.VipsOption...)
,profile(app.photofox.vipsffm.VipsOption...)
.- Parameters:
percent
- Percent of pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
perlin
Create a one-band float image of Perlin noise. See:
https://en.wikipedia.org/wiki/Perlin_noise
Use
cell-size
to set the size of the cells from which the image is constructed. The default is 256 x 256.If
width
andheight
are multiples ofcell-size
, the image will tessellate.Normally, output pixels are
VipsBandFormat.FORMAT_FLOAT
in the range [-1, +1]. Setuchar
to output a uchar image with pixels in [0, 255].See also:
worley(int, int, app.photofox.vipsffm.VipsOption...)
,fractsurf(int, int, double, app.photofox.vipsffm.VipsOption...)
,gaussnoise(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- cell-size
VipsOption.Int
Size of Perlin cells, ucharVipsOption.Boolean
Output an unsigned char image, seedVipsOption.Int
Random number seed
-
pfmsaveTarget
@Deprecated(forRemoval=true) public void pfmsaveTarget(VTarget target, VipsOption... args) throws VipsError Deprecated, for removal: This API element is subject to removal in a future version.Save image in pfm format- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.Enum
VipsForeignPpmFormat
Format to save in, asciiVipsOption.Boolean
Save as ascii, squashVipsOption.Boolean
Save as one bit, bitdepthVipsOption.Int
Set to 1 to write as a 1 bit image, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
pgmsaveTarget
@Deprecated(forRemoval=true) public void pgmsaveTarget(VTarget target, VipsOption... args) throws VipsError Deprecated, for removal: This API element is subject to removal in a future version.Save image in pgm format- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.Enum
VipsForeignPpmFormat
Format to save in, asciiVipsOption.Boolean
Save as ascii, squashVipsOption.Boolean
Save as one bit, bitdepthVipsOption.Int
Set to 1 to write as a 1 bit image, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
phasecor
Convert the two input images to Fourier space, calculate phase-correlation, back to real space.
See also:
fwfft(app.photofox.vipsffm.VipsOption...)
,vips_cross_phase
,- Parameters:
in2
- Second input imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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.
Any ICC profile is read and attached to the VIPS image. It also supports XMP metadata.
Use
fail-on
to set the type of error that will cause load to fail. By default, loaders are permissive, that is,VipsFailOn.FAIL_ON_NONE
.By default, the PNG loader limits the number of text and data chunks to block some denial of service attacks. Set
unlimited
to disable these limits.See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- unlimited
VipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
pngloadBuffer
Exactly as
pngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a PNG-formatted memory block.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
pngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- unlimited
VipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
pngloadSource
Exactly as
pngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
pngload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- unlimited
VipsOption.Boolean
Remove all denial of service limits, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
pngsave
Write a VIPS image to a file as PNG.
compression
means compress with this much effort (0 - 9). Default 6.Set
interlace
toTRUE
to interlace the image with ADAM7 interlacing. Beware than an interlaced PNG can be up to 7 times slower to write than a non-interlaced image.Use
filter
to specify one or more filters, defaults to none, seeVipsForeignPngFilter
.The image is automatically converted to RGB, RGBA, Monochrome or Mono + alpha before saving. Images with more than one byte per band element are saved as 16-bit PNG, others are saved as 8-bit PNG.
Set
palette
toTRUE
to enable palette mode for RGB or RGBA images. A palette will be computed with enough space forbitdepth
(1, 2, 4 or 8) bits. UseQ
to set the optimisation effort,dither
to set the degree of Floyd-Steinberg dithering andeffort
to control the CPU effort (1 is the fastest, 10 is the slowest, 7 is the default). This feature requires libvips to be compiled with libimagequant.The default
bitdepth
is either 8 or 16 depending on the interpretation. You can also setbitdepth
for mono and mono + alpha images, and the image will be quantized.XMP metadata is written to the XMP chunk. PNG comments are written to separate text chunks.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- compression
VipsOption.Int
Compression factor, interlaceVipsOption.Boolean
Interlace image, filterVipsOption.Int
Libspng row filter flag(s), paletteVipsOption.Boolean
Quantise to 8bpp palette, coloursVipsOption.Int
Max number of palette colours, QVipsOption.Int
Quantisation quality, ditherVipsOption.Double
Amount of dithering, bitdepthVipsOption.Int
Write as a 1, 2, 4, 8 or 16 bit image, effortVipsOption.Int
Quantisation CPU effort, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
pngsaveBuffer
As
pngsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
pngsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- compression
VipsOption.Int
Compression factor, interlaceVipsOption.Boolean
Interlace image, filterVipsOption.Int
Libspng row filter flag(s), paletteVipsOption.Boolean
Quantise to 8bpp palette, coloursVipsOption.Int
Max number of palette colours, QVipsOption.Int
Quantisation quality, ditherVipsOption.Double
Amount of dithering, bitdepthVipsOption.Int
Write as a 1, 2, 4, 8 or 16 bit image, effortVipsOption.Int
Quantisation CPU effort, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
pngsaveTarget
As
pngsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
pngsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- compression
VipsOption.Int
Compression factor, interlaceVipsOption.Boolean
Interlace image, filterVipsOption.Int
Libspng row filter flag(s), paletteVipsOption.Boolean
Quantise to 8bpp palette, coloursVipsOption.Int
Max number of palette colours, QVipsOption.Int
Quantisation quality, ditherVipsOption.Double
Amount of dithering, bitdepthVipsOption.Int
Write as a 1, 2, 4, 8 or 16 bit image, effortVipsOption.Int
Quantisation CPU effort, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
pnmsaveTarget
@Deprecated(forRemoval=true) public void pnmsaveTarget(VTarget target, VipsOption... args) throws VipsError Deprecated, for removal: This API element is subject to removal in a future version.Save image in pnm format- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.Enum
VipsForeignPpmFormat
Format to save in, asciiVipsOption.Boolean
Save as ascii, squashVipsOption.Boolean
Save as one bit, bitdepthVipsOption.Int
Set to 1 to write as a 1 bit image, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
ppmload
Read a PPM/PBM/PGM/PFM file into a VIPS image.
It can read 1, 8, 16 and 32 bit images, colour or monochrome, stored in binary or in ASCII. One bit images become 8 bit VIPS images, with 0 and 255 for 0 and 1.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
ppmloadSource
Exactly as
ppmload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
ppmload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
ppmsave
Write a VIPS image to a file as PPM. It can write 1, 8, 16 or 32 bit unsigned integer images, float images, colour or monochrome, stored as binary or ASCII. Integer images of more than 8 bits can only be stored in ASCII.
When writing float (PFM) images the scale factor is set from the "pfm-scale" metadata.
Set
ascii
toTRUE
to write as human-readable ASCII. Normally data is written in binary.Set
bitdepth
to 1 to write a one-bit image.format
defaults to the sub-type for this filename suffix.See also:
vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.Enum
VipsForeignPpmFormat
Format to save in, asciiVipsOption.Boolean
Save as ascii, squashVipsOption.Boolean
Save as one bit, bitdepthVipsOption.Int
Set to 1 to write as a 1 bit image, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
ppmsaveTarget
As
ppmsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
ppmsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- format
VipsOption.Enum
VipsForeignPpmFormat
Format to save in, asciiVipsOption.Boolean
Save as ascii, squashVipsOption.Boolean
Save as one bit, bitdepthVipsOption.Int
Set to 1 to write as a 1 bit image, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
premultiply
Premultiplies any alpha channel. The final band is taken to be the alpha and the bands are transformed as:
alpha = clip(0, in[in.bands - 1], {@code max-alpha}); norm = alpha / {@code max-alpha}; out = [in[0] * norm, ..., in[in.bands - 1] * norm, alpha];
So for an N-band image, the first N - 1 bands are multiplied by the clipped and normalised final band, the final band is clipped. If there is only a single band, the image is passed through unaltered.
The result is
VipsBandFormat.FORMAT_FLOAT
unless the input format isVipsBandFormat.FORMAT_DOUBLE
, in which case the output is double as well.max-alpha
has the default value 255, or 65535 for images tagged asVipsInterpretation.INTERPRETATION_RGB16
orVipsInterpretation.INTERPRETATION_GREY16
.Non-complex images only.
See also:
unpremultiply(app.photofox.vipsffm.VipsOption...)
,flatten(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- max-alpha
VipsOption.Double
Maximum value of alpha channel
-
prewitt
Prewitt edge detector.
uchar images are computed using a fast, low-precision path. Cast to float for a high-precision implementation.
See also:
canny(app.photofox.vipsffm.VipsOption...)
,sobel(app.photofox.vipsffm.VipsOption...)
,prewitt
,scharr(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
profile
profile
searches inward from the edge ofin
and finds the first non-zero pixel. Pixels incolumns
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.See also:
project(app.photofox.vipsffm.VipsOption...)
,histFind(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
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.
Non-complex images only.
See also:
histFind(app.photofox.vipsffm.VipsOption...)
,profile(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
quadratic
This operation is unfinished and unusable, sorry.
See also:
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
coeff
- Coefficient matrixargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- interpolate
VipsOption.Interpolate
Interpolate values with this
-
rad2float
Unpack a RAD (
VipsCoding.CODING_RAD
) image to a three-band float image.See also:
float2rad(app.photofox.vipsffm.VipsOption...)
,LabQ2LabS(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
radload
Read a Radiance (HDR) file into a VIPS image.
Radiance files are read as
VipsCoding.CODING_RAD
. They have one byte for each of red, green and blue, and one byte of shared exponent. Some operations (likeextractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
) can work directly with images in this format, but mmany (all the arithmetic operations, for example) will not. UnpackVipsCoding.CODING_RAD
images to 3 band float withrad2float(app.photofox.vipsffm.VipsOption...)
if you want to do arithmetic on them.This operation ignores some header fields, like VIEW and DATE. It will not rotate/flip as the FORMAT string asks.
Sections of this reader from Greg Ward and Radiance with kind permission.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
radloadBuffer
Exactly as
radload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a HDR-formatted memory block.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
radload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
radloadSource
Exactly as
radload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
radload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
radsave
Write a VIPS image in Radiance (HDR) format.
Sections of this reader from Greg Ward and Radiance with kind permission.
See also:
vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
radsaveBuffer
As
radsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
radsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
radsaveTarget
As
radsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
radsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
rank
rank
does rank filtering on an image. A window of sizewidth
byheight
is passed over the image. At each position, the pixels inside the window are sorted into ascending order and the pixel at positionindex
is output.index
numbers from 0.It works for any non-complex image type, with any number of bands. The input is expanded by copying edge pixels before performing the operation so that the output image has the same size as the input. Edge pixels in the output image are therefore only approximate.
For a median filter with mask size m (3 for 3x3, 5 for 5x5, etc.) use vips_rank(in, out, m, m, m * m / 2);
The special cases n == 0 and n == m * m - 1 are useful dilate and expand operators.
See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,vips_median
,spcor(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Window width in pixelsheight
- Window height in pixelsindex
- Select pixel at indexargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
rawload
public VImage rawload(String filename, int width, int height, int bands, VipsOption... args) throws VipsError This operation mmaps the file, setting up
out
so that access to that image will read from the file.By default, it assumes uchar pixels. Use
format
to select something else.The image will be tagged as
VipsInterpretation.INTERPRETATION_MULTIBAND
. Useinterpretation
to select something else.Use
byteswap(app.photofox.vipsffm.VipsOption...)
to reverse the byte ordering if necessary.See also:
vips_image_new_from_file
,copy(app.photofox.vipsffm.VipsOption...)
,byteswap(app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to load fromwidth
- Image width in pixelsheight
- Image height in pixelsbands
- Number of bands in imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- offset
VipsOption.Long
Offset in bytes from start of file, formatVipsOption.Enum
VipsBandFormat
Pixel format in image, interpretationVipsOption.Enum
VipsInterpretation
Pixel interpretation, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
rawsave
Writes the pixels in
in
to the filefilename
with no header or other metadata.See also:
vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
rawsaveBuffer
As
rawsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
rawsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_memory
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
rawsaveTarget
As
rawsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
rawsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
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 inin
, and multiplied by the n x m matrixm
to produce the m-band imageout
.out
is always float, unlessin
is double, in which caseout
is double too. No complex images allowed.It's useful for various sorts of colour space conversions.
See also:
bandmean(app.photofox.vipsffm.VipsOption...)
.- Parameters:
m
- Matrix of coefficientsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
reduce
public VImage reduce(double xshrink, double hshrink, double yshrink, double vshrink, VipsOption... args) throws VipsError Reduce
in
by a pair of factors with a pair of 1D kernels. This will not work well for shrink factors greater than three.Set
gap
to speed up reducing by havingshrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
to shrink with a box filter first. The biggergap
, the closer the result to the fair resampling. The smallergap
, the faster resizing. The default value is 0.0 (no optimization).This is a very low-level operation: see
resize(double, app.photofox.vipsffm.VipsOption...)
for a more convenient way to resize images.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
xshrink
- Horizontal shrink factorhshrink
- Horizontal shrink factoryshrink
- Vertical shrink factorvshrink
- Vertical shrink factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- kernel
VipsOption.Enum
VipsKernel
Resampling kernel, gapVipsOption.Double
Reducing gap, centreVipsOption.Boolean
Use centre sampling convention
-
reduceh
Reduce
in
horizontally by a float factor. The pixels inout
are interpolated with a 1D mask generated bykernel
.Set
gap
to speed up reducing by havingshrinkh(int, int, app.photofox.vipsffm.VipsOption...)
to shrink with a box filter first. The biggergap
, the closer the result to the fair resampling. The smallergap
, the faster resizing. The default value is 0.0 (no optimization).This is a very low-level operation: see
resize(double, app.photofox.vipsffm.VipsOption...)
for a more convenient way to resize images.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
xshrink
- Horizontal shrink factorhshrink
- Horizontal shrink factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- kernel
VipsOption.Enum
VipsKernel
Resampling kernel, gapVipsOption.Double
Reducing gap, centreVipsOption.Boolean
Use centre sampling convention
-
reducev
Reduce
in
vertically by a float factor. The pixels inout
are interpolated with a 1D mask generated bykernel
.Set
gap
to speed up reducing by havingshrinkv(int, int, app.photofox.vipsffm.VipsOption...)
to shrink with a box filter first. The biggergap
, the closer the result to the fair resampling. The smallergap
, the faster resizing. The default value is 0.0 (no optimization).This is a very low-level operation: see
resize(double, app.photofox.vipsffm.VipsOption...)
for a more convenient way to resize images.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
yshrink
- Vertical shrink factorvshrink
- Vertical shrink factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- kernel
VipsOption.Enum
VipsKernel
Resampling kernel, gapVipsOption.Double
Reducing gap, centreVipsOption.Boolean
Use centre sampling convention
-
relational
public VImage relational(VImage right, VipsOperationRelational relational, VipsOption... args) throws VipsError Perform various relational operations on pairs of images.
The output type is always uchar, with 0 for FALSE and 255 for TRUE.
Less-than and greater-than for complex images compare the modulus.
If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
).To decide if pixels match exactly, that is have the same value in every band, use
bandbool(app.photofox.vipsffm.enums.VipsOperationBoolean, app.photofox.vipsffm.VipsOption...)
after this operation to AND or OR image bands together.See also:
boolean1(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationBoolean, app.photofox.vipsffm.VipsOption...)
,bandbool(app.photofox.vipsffm.enums.VipsOperationBoolean, app.photofox.vipsffm.VipsOption...)
,relationalConst(app.photofox.vipsffm.enums.VipsOperationRelational, java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentrelational
-VipsOperationRelational
Relational to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
relationalConst
public VImage relationalConst(VipsOperationRelational relational, List<Double> c, VipsOption... args) throws VipsError Perform various relational operations on an image and an array of constants.
The output type is always uchar, with 0 for FALSE and 255 for TRUE.
If the array of constants has just one element, that constant is used for all image bands. If the array has more than one element and they have the same number of elements as there are bands in the image, then one array element is used for each band. If the arrays have more than one element and the image only has a single band, the result is a many-band image where each band corresponds to one array element.
See also:
boolean1(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationBoolean, app.photofox.vipsffm.VipsOption...)
,relational(app.photofox.vipsffm.VImage, app.photofox.vipsffm.enums.VipsOperationRelational, app.photofox.vipsffm.VipsOption...)
.- Parameters:
relational
-VipsOperationRelational
Relational to performc
- Array of constantsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
remainder
This operation calculates
left
%right
(remainder after integer division) and writes the result toout
. The images may have any non-complex format. For float formats,remainder
calculatesin1
-in2
* floor (in1
/in2
).If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), and that format is the result type.See also:
remainderConst(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,divide(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,round(app.photofox.vipsffm.enums.VipsOperationRound, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
remainderConst
This operation calculates
in
%c
(remainder after division by an array of constants) and writes the result toout
. The image may have any non-complex format. For float formats,remainderConst
calculatesin
-c
* floor (in
/c
).If the array of constants has just one element, that constant is used for all image bands. If the array has more than one element and they have the same number of elements as there are bands in the image, then one array element is used for each band. If the arrays have more than one element and the image only has a single band, the result is a many-band image where each band corresponds to one array element.
See also:
remainder(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,divide(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,round(app.photofox.vipsffm.enums.VipsOperationRound, app.photofox.vipsffm.VipsOption...)
.- Parameters:
c
- Array of constantsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
replicate
Repeats an image many times.
See also:
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
across
- Repeat this many times horizontallydown
- Repeat this many times verticallyargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
resize
Resize an image.
Set
gap
to speed up downsizing by havingshrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
to shrink with a box filter first. The biggergap
, the closer the result to the fair resampling. The smallergap
, the faster resizing. The default value is 2.0 (very close to fair resampling while still being faster in many cases).resize
normally usesVipsKernel.KERNEL_LANCZOS3
for the final reduce, you can change this withkernel
. Downsizing is done with centre convention.When upsizing (
scale
> 1), the operation usesaffine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
with aVipsInterpolate
selected depending onkernel
. It will useVipsInterpolateBicubic
forVipsKernel.KERNEL_CUBIC
and above. It adds a 0.5 pixel displacement to the input pixels to get centre convention scaling.resize
normally maintains the image aspect ratio. If you setvscale
, that factor is used for the vertical scale andscale
for the horizontal.If either axis would drop below 1px in size, the shrink in that dimension is limited. This breaks the image aspect ratio, but prevents errors due to fractional pixel sizes.
This operation does not change xres or yres. The image resolution needs to be updated by the application.
This operation does not premultiply alpha. If your image has an alpha channel, you should use
premultiply(app.photofox.vipsffm.VipsOption...)
on it first.See also:
premultiply(app.photofox.vipsffm.VipsOption...)
,shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,reduce(double, double, double, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
scale
- Scale image by this factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- interpolate
VipsOption.Interpolate
Interpolate pixels with this, kernelVipsOption.Enum
VipsKernel
Resampling kernel, gapVipsOption.Double
Reducing gap, centreVipsOption.Boolean
Use centre sampling convention, vscaleVipsOption.Double
Vertical scale image by this factor, idxVipsOption.Double
Horizontal input displacement, idyVipsOption.Double
Vertical input displacement
-
rot
Rotate
in
by a multiple of 90 degrees.Use
similarity(app.photofox.vipsffm.VipsOption...)
to rotate by an arbitrary angle.rot45(app.photofox.vipsffm.VipsOption...)
is useful for rotating convolution masks by 45 degrees.See also:
flip(app.photofox.vipsffm.enums.VipsDirection, app.photofox.vipsffm.VipsOption...)
,similarity(app.photofox.vipsffm.VipsOption...)
,rot45(app.photofox.vipsffm.VipsOption...)
. -
rot45
Rotate
in
by a multiple of 45 degrees. Odd-length sides and square images only.This operation is useful for rotating convolution masks. Use
similarity(app.photofox.vipsffm.VipsOption...)
to rotate images by arbitrary angles.See also:
rot(app.photofox.vipsffm.enums.VipsAngle, app.photofox.vipsffm.VipsOption...)
,similarity(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- angle
VipsOption.Enum
VipsAngle45
Angle to rotate image
-
rotate
This operator calls
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
for you, calculating the matrix for the affine transform fromscale
andangle
. Other parameters are passed on toaffine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
unaltered.See also:
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,VipsInterpolate
.- Parameters:
angle
- Rotate clockwise by this many degreesargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- interpolate
VipsOption.Interpolate
Interpolate pixels with this, backgroundVipsOption.ArrayDouble
Background value, odxVipsOption.Double
Horizontal output displacement, odyVipsOption.Double
Vertical output displacement, idxVipsOption.Double
Horizontal input displacement, idyVipsOption.Double
Vertical input displacement
-
round
Round to an integral value.
Copy for integer types, round float and complex types.
The format of
out
is always the same asin
, so you may wish to cast to an integer format afterwards.See also:
cast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)
- Parameters:
round
-VipsOperationRound
Rounding operation to performargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
sRGB2HSV
Convert to HSV.
HSV is a crude polar coordinate system for RGB images. It is provided for compatibility with other image processing systems. See
Lab2LCh(app.photofox.vipsffm.VipsOption...)
for a much better colour space.See also:
HSV2sRGB(app.photofox.vipsffm.VipsOption...)
,Lab2LCh(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
sRGB2scRGB
Convert an sRGB image to scRGB. The input image can be 8 or 16-bit.
If the input image is tagged as
VipsInterpretation.INTERPRETATION_RGB16
, any extra channels after RGB are divided by 256. Thus, scRGB alpha is always 0 - 255.99.See also:
scRGB2XYZ(app.photofox.vipsffm.VipsOption...)
,scRGB2sRGB(app.photofox.vipsffm.VipsOption...)
,rad2float(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
scRGB2BW
Convert an scRGB image to greyscale. Set
depth
to 16 to get 16-bit output.If
depth
is 16, any extra channels after RGB are multiplied by 256.See also:
LabS2LabQ(app.photofox.vipsffm.VipsOption...)
,sRGB2scRGB(app.photofox.vipsffm.VipsOption...)
,rad2float(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- depth
VipsOption.Int
Output device space depth in bits
-
scRGB2XYZ
Turn XYZ to scRGB.
- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
scRGB2sRGB
Convert an scRGB image to sRGB. Set
depth
to 16 to get 16-bit output.If
depth
is 16, any extra channels after RGB are multiplied by 256.See also:
LabS2LabQ(app.photofox.vipsffm.VipsOption...)
,sRGB2scRGB(app.photofox.vipsffm.VipsOption...)
,rad2float(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- depth
VipsOption.Int
Output device space depth in bits
-
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.
If
log
is set, transform with log10(1.0 + pow(x,exp
)) + .5, then scale so max == 255. By default,exp
is 0.25.See also:
cast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- exp
VipsOption.Double
Exponent for log scale, logVipsOption.Boolean
Log scale
-
scharr
Scharr edge detector.
uchar images are computed using a fast, low-precision path. Cast to float for a high-precision implementation.
See also:
canny(app.photofox.vipsffm.VipsOption...)
,sobel(app.photofox.vipsffm.VipsOption...)
,prewitt(app.photofox.vipsffm.VipsOption...)
,scharr
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
sdf
Create a signed distance field (SDF) image of the given shape. Different shapes use different combinations of the optional arguments, see below.
shape
VipsSdfShape.SDF_SHAPE_CIRCLE
: create a circle centred ona
, radiusr
.shape
VipsSdfShape.SDF_SHAPE_BOX
: create a box with top-left cornera
and bottom-right cornerb
.shape
VipsSdfShape.SDF_SHAPE_ROUNDED_BOX
: create a box with top-left cornera
and bottom-right cornerb
, whose four corners are rounded by the four-element float arraycorners
.corners
will default to 0.0.shape
VipsSdfShape.SDF_SHAPE_LINE
: draw a line froma
tob
.See also:
grey(int, int, app.photofox.vipsffm.VipsOption...)
,grid(int, int, int, app.photofox.vipsffm.VipsOption...)
,xyz(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsshape
-VipsSdfShape
SDF shape to createargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- r
VipsOption.Double
Radius, aVipsOption.ArrayDouble
Point a, bVipsOption.ArrayDouble
Point b, cornersVipsOption.ArrayDouble
Corner radii
-
sequential
This operation behaves rather like
copy(app.photofox.vipsffm.VipsOption...)
between imagesin
andout
, except that it checks that pixels onin
are only requested top-to-bottom. This operation is useful for loading file formats which are strictly top-to-bottom, like PNG.tile-height
can be used to set the size of the tiles thatsequential
uses. The default value is 1.See also:
vips_cache
,linecache(app.photofox.vipsffm.VipsOption...)
,tilecache(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- trace
VipsOption.Boolean
Trace pixel requests, tile-heightVipsOption.Int
Tile height in pixels, accessVipsOption.Enum
VipsAccess
Expected access pattern
-
sharpen
Selectively sharpen the L channel of a LAB image. The input image is transformed to
VipsInterpretation.INTERPRETATION_LABS
.The operation performs a gaussian blur and subtracts from
in
to generate a high-frequency signal. This signal is passed through a lookup table formed from the five parameters and added back toin
.The lookup table is formed like this:
. ^ . y2 |- - - - - ----------- . | / . | / slope m2 . | .../ . -x1 | ... | . -------------------...----------------------> . | ... | x1 . |... slope m1 . / | . / m2 | . / | . / | . / | . / | . ______/ _ _ _ _ _ _ | -y3 . |
For screen output, we suggest the following settings (the defaults):
sigma == 0.5 x1 == 2 y2 == 10 (don't brighten by more than 10 L*) y3 == 20 (can darken by up to 20 L*) m1 == 0 (no sharpening in flat areas) m2 == 3 (some sharpening in jaggy areas)
If you want more or less sharpening, we suggest you just change the m2 parameter.
The
sigma
parameter changes the width of the fringe and can be adjusted according to the output printing resolution. As an approximate guideline, use 0.5 for 4 pixels/mm (display resolution), 1.0 for 12 pixels/mm and 1.5 for 16 pixels/mm (300 dpi == 12 pixels/mm). These figures refer to the image raster, not the half-tone resolution.See also:
conv(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- radius
VipsOption.Int
Radius of Gaussian, sigmaVipsOption.Double
Sigma of Gaussian, x1VipsOption.Double
Flat/jaggy threshold, y2VipsOption.Double
Maximum brightening, y3VipsOption.Double
Maximum darkening, m1VipsOption.Double
Slope for flat areas, m2VipsOption.Double
Slope for jaggy areas
-
shrink
public VImage shrink(double xshrink, double hshrink, double yshrink, double vshrink, VipsOption... args) throws VipsError Shrink
in
by a pair of factors with a simple box filter. For non-integer factors,shrink
will first shrink by the integer part with a box filter, then usereduce(double, double, double, double, app.photofox.vipsffm.VipsOption...)
to shrink by the remaining fractional part.This is a very low-level operation: see
resize(double, app.photofox.vipsffm.VipsOption...)
for a more convenient way to resize images.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
resize(double, app.photofox.vipsffm.VipsOption...)
,reduce(double, double, double, double, app.photofox.vipsffm.VipsOption...)
.- Parameters:
xshrink
- Horizontal shrink factorhshrink
- Horizontal shrink factoryshrink
- Vertical shrink factorvshrink
- Vertical shrink factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- ceil
VipsOption.Boolean
Round-up output dimensions
-
shrinkh
Shrink
in
horizontally by an integer factor. Each pixel in the output is the average of the corresponding line ofhshrink
pixels in the input.This is a very low-level operation: see
resize(double, app.photofox.vipsffm.VipsOption...)
for a more convenient way to resize images.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
shrinkv(int, int, app.photofox.vipsffm.VipsOption...)
,shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
xshrink
- Horizontal shrink factorhshrink
- Horizontal shrink factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- ceil
VipsOption.Boolean
Round-up output dimensions
-
shrinkv
Shrink
in
vertically by an integer factor. Each pixel in the output is the average of the corresponding column ofvshrink
pixels in the input.This is a very low-level operation: see
resize(double, app.photofox.vipsffm.VipsOption...)
for a more convenient way to resize images.This operation does not change xres or yres. The image resolution needs to be updated by the application.
See also:
shrinkh(int, int, app.photofox.vipsffm.VipsOption...)
,shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,resize(double, app.photofox.vipsffm.VipsOption...)
,affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
yshrink
- Vertical shrink factorvshrink
- Vertical shrink factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- ceil
VipsOption.Boolean
Round-up output dimensions
-
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.
See also:
abs(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
similarity
This operator calls
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
for you, calculating the matrix for the affine transform fromscale
andangle
. Other parameters are passed on toaffine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
unaltered.See also:
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,VipsInterpolate
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- scale
VipsOption.Double
Scale by this factor, angleVipsOption.Double
Rotate clockwise by this many degrees, interpolateVipsOption.Interpolate
Interpolate pixels with this, backgroundVipsOption.ArrayDouble
Background value, odxVipsOption.Double
Horizontal output displacement, odyVipsOption.Double
Vertical output displacement, idxVipsOption.Double
Horizontal input displacement, idyVipsOption.Double
Vertical input displacement
-
sines
Creates a float one band image of the a sine waveform in two dimensions.
The number of horizontal and vertical spatial frequencies are determined by the variables
hfreq
andvfreq
respectively. The function is useful for creating displayable sine waves and square waves in two dimensions.If horfreq and verfreq are integers the resultant image is periodical and therefore the Fourier transform does not present spikes
Pixels are normally in [-1, +1], set
uchar
to output [0, 255].See also:
grey(int, int, app.photofox.vipsffm.VipsOption...)
,xyz(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image, hfreqVipsOption.Double
Horizontal spatial frequency, vfreqVipsOption.Double
Vertical spatial frequency
-
smartcrop
Crop an image down to a specified width and height by removing boring parts.
Use
interesting
to pick the method vips uses to decide which bits of the image should be kept.You can test xoffset / yoffset on
out
to find the location of the crop within the input image.See also:
extractArea(int, int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Width of extract areaheight
- Height of extract areaargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- attention-x
VipsOption.Int
Horizontal position of attention centre, attention-yVipsOption.Int
Vertical position of attention centre, interestingVipsOption.Enum
VipsInteresting
How to measure interestingness, premultipliedVipsOption.Boolean
Input image already has premultiplied alpha
-
sobel
Sobel edge detector.
uchar images are computed using a fast, low-precision path. Cast to float for a high-precision implementation.
See also:
canny(app.photofox.vipsffm.VipsOption...)
,sobel
,prewitt(app.photofox.vipsffm.VipsOption...)
,scharr(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
spcor
Calculate a correlation surface.
ref
is placed at every position inin
and the correlation coefficient calculated. The output image is always float.The output image is the same size as the input. Extra input edge pixels are made by copying the existing edges outwards.
The correlation coefficient is calculated as:
sumij (ref(i,j)-mean(ref))(inkl(i,j)-mean(inkl)) c(k,l) = ------------------------------------------------ sqrt(sumij (ref(i,j)-mean(ref))^2) * sqrt(sumij (inkl(i,j)-mean(inkl))^2)
where inkl is the area of
in
centred at position (k,l).from Niblack "An Introduction to Digital Image Processing", Prentice/Hall, pp 138.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The output image is always float, unless either of the two inputs is double, in which case the output is also double.
See also:
fastcor(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
ref
- Input reference imageargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
spectrum
Make a displayable (ie. 8-bit unsigned int) power spectrum.
If
in
is non-complex, it is transformed to Fourier space. Then the absolute value is passed throughscale(app.photofox.vipsffm.VipsOption...)
in log mode, andwrap(app.photofox.vipsffm.VipsOption...)
.See also:
fwfft(app.photofox.vipsffm.VipsOption...)
,scale(app.photofox.vipsffm.VipsOption...)
,wrap(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
stats
Find many image statistics in a single pass through the data.
out
is a one-bandVipsBandFormat.FORMAT_DOUBLE
image of at least 10 columns by n + 1 (where n is number of bands in imagein
) 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 ofstats
may add more columns.Row 0 has statistics for all bands together, row 1 has stats for band 1, and so on.
If there is more than one maxima or minima, one of them will be chosen at random.
See also:
avg(app.photofox.vipsffm.VipsOption...)
,min(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
stdif
stdif
performs statistical differencing according to the formula given in page 45 of the book "An Introduction to Digital Image Processing" by Wayne Niblack. This transformation emphasises the way in which a pel differs statistically from its neighbours. It is useful for enhancing low-contrast images with lots of detail, such as X-ray plates.At point (i,j) the output is given by the equation:
vout(i,j) = {@code a} * {@code m0} + (1 - {@code a}) * meanv + (vin(i,j) - meanv) * ({@code b} * {@code s0}) / ({@code s0} + {@code b} * stdv)
Values
a
,m0
,b
ands0
are entered, while meanv and stdv are the values calculated over a moving window of sizewidth
,height
centred on pixel (i,j).m0
is the new mean,a
is the weight given to it.s0
is the new standard deviation,b
is the weight given to it.Try:
vips stdif $VIPSHOME/pics/huysum.v fred.v 0.5 128 0.5 50 11 11
The operation works on one-band uchar images only, and writes a one-band uchar image as its result. The output image has the same size as the input.
See also:
histLocal(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Window width in pixelsheight
- Window height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- s0
VipsOption.Double
New deviation, bVipsOption.Double
Weight of new deviation, m0VipsOption.Double
New mean, aVipsOption.Double
Weight of new mean
-
subsample
Subsample an image by an integer fraction. This is fast, nearest-neighbour shrink.
For small horizontal shrinks, this operation will fetch lines of pixels from
in
and then subsample that line. For large shrinks it will fetch single pixels.If
point
is set,in
will always be sampled in points. This can be faster if the previous operations in the pipeline are very slow.See also:
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,shrink(double, double, double, double, app.photofox.vipsffm.VipsOption...)
,zoom(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
xfac
- Horizontal subsample factoryfac
- Vertical subsample factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- point
VipsOption.Boolean
Point sample
-
subtract
This operation calculates
in1
-in2
and writes the result toout
.If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.
The two input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), then the following table is used to determine the output type:<table> <title>VipsSubtract type promotion</title> <tgroup cols='2' align='left' colsep='1' rowsep='1'> <thead> <row> <entry>input type</entry> <entry>output type</entry> </row> </thead> <tbody> <row> <entry>uchar</entry> <entry>short</entry> </row> <row> <entry>char</entry> <entry>short</entry> </row> <row> <entry>ushort</entry> <entry>int</entry> </row> <row> <entry>short</entry> <entry>int</entry> </row> <row> <entry>uint</entry> <entry>int</entry> </row> <row> <entry>int</entry> <entry>int</entry> </row> <row> <entry>float</entry> <entry>float</entry> </row> <row> <entry>double</entry> <entry>double</entry> </row> <row> <entry>complex</entry> <entry>complex</entry> </row> <row> <entry>double complex</entry> <entry>double complex</entry> </row> </tbody> </tgroup> </table>
In other words, the output type is just large enough to hold the whole range of possible values.
See also:
add(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,linear(java.util.List<java.lang.Double>, java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
right
- Right-hand image argumentargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
sum
This operation sums all images in
in
and writes the result toout
.If the images differ in size, the smaller images are enlarged to match the largest by adding zero pixels along the bottom and right.
If the number of bands differs, all but one of the images must have one band. In this case, n-band images are formed from the one-band images by joining n copies of the one-band images together, and then the n-band images are operated upon.
The input images are cast up to the smallest common format (see table Smallest common format in
arithmetic
), then the following table is used to determine the output type:<table> <title>VipsSum type promotion</title> <tgroup cols='2' align='left' colsep='1' rowsep='1'> <thead> <row> <entry>input type</entry> <entry>output type</entry> </row> </thead> <tbody> <row> <entry>uchar</entry> <entry>uint</entry> </row> <row> <entry>char</entry> <entry>int</entry> </row> <row> <entry>ushort</entry> <entry>uint</entry> </row> <row> <entry>short</entry> <entry>int</entry> </row> <row> <entry>uint</entry> <entry>uint</entry> </row> <row> <entry>int</entry> <entry>int</entry> </row> <row> <entry>float</entry> <entry>float</entry> </row> <row> <entry>double</entry> <entry>double</entry> </row> <row> <entry>complex</entry> <entry>complex</entry> </row> <row> <entry>double complex</entry> <entry>double complex</entry> </row> </tbody> </tgroup> </table>
In other words, the output type is just large enough to hold the whole range of possible values.
See also:
add(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
in
- Array of input imagesargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
svgload
Render a SVG file into a VIPS image. Rendering uses the librsvg library and should be fast.
Use
dpi
to set the rendering resolution. The default is 72. You can also scale the rendering byscale
.This function only reads the image header and does not render any pixel data. Rendering occurs when pixels are accessed.
SVGs larger than 10MB are normally blocked for security. Set
unlimited
to allow SVGs of any size.See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dpi
VipsOption.Double
Render at this DPI, scaleVipsOption.Double
Scale output by this factor, unlimitedVipsOption.Boolean
Allow SVG of any size, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
svgloadBuffer
Read a SVG-formatted memory block into a VIPS image. Exactly as
svgload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
svgload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dpi
VipsOption.Double
Render at this DPI, scaleVipsOption.Double
Scale output by this factor, unlimitedVipsOption.Boolean
Allow SVG of any size, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
svgloadSource
Exactly as
svgload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
svgload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- dpi
VipsOption.Double
Render at this DPI, scaleVipsOption.Double
Scale output by this factor, unlimitedVipsOption.Boolean
Allow SVG of any size, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
switch1
The
tests
images are evaluated and at each point the index of the first non-zero value is written toout
. If alltests
are false, the value (n
+ 1) is written.Images in
tests
must have one band. They are expanded to the bounding box of the set of images intests
, and that size is used forout
.tests
can have up to 255 elements.Combine with
case1(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
to make an efficient multi-wayifthenelse(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.See also:
maplut(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
,case1(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
,ifthenelse(app.photofox.vipsffm.VImage, app.photofox.vipsffm.VImage, app.photofox.vipsffm.VipsOption...)
.- Parameters:
tests
- Table of images to testargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
text
Draw the string
text
to an image.out
is normally a one-band 8-bit unsigned char image, with 0 for no text and 255 for text. Values between are used for anti-aliasing.Set
rgba
to enable RGBA output. This is useful for colour emoji rendering, or support for pango markup features like `<span foreground="red">Red!</span>`.text
is the text to render as a UTF-8 string. It can contain Pango markup, for example `<i>The</i>Guardian`.font
is the font to render with, as a fontconfig name. Examples might be `sans 12` or perhaps `bitstream charter bold 10`.You can specify a font to load with
fontfile
. You'll need to also set the name of the font withfont
.width
is the number of pixels to word-wrap at. By default, lines of text wider than this will be broken at word boundaries. Usewrap
to set lines to wrap on word or character boundaries, or to disable line breaks.Set
justify
to turn on line justification.align
can be used to set the alignment style for multi-line text to the low (left) edge centre, or high (right) edge. Note that the output image can be wider thanwidth
if there are no word breaks, or narrower if the lines don't break exactly atwidth
.height
is the maximum number of pixels high the generated text can be. This only takes effect whendpi
is not set, andwidth
is set, making a box. In this case,text
will search for adpi
and set of line breaks which will just fit the text intowidth
andheight
.You can use
autofit-dpi
to read out the DPI selected by auto fit.dpi
sets the resolution to render at. "sans 12" at 72 dpi draws characters approximately 12 pixels high.spacing
sets the line spacing, in points. It would typically be something like font size times 1.2.You can read the coordinate of the top edge of the character from `Xoffset` / `Yoffset`. This can be helpful if you need to line up the output of several
text
.See also:
bandjoin(java.util.List<app.photofox.vipsffm.VImage>, app.photofox.vipsffm.VipsOption...)
,composite(java.util.List<app.photofox.vipsffm.VImage>, java.util.List<java.lang.Integer>, app.photofox.vipsffm.VipsOption...)
.- Parameters:
text
- Text to renderargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- font
VipsOption.String
Font to render with, widthVipsOption.Int
Maximum image width in pixels, heightVipsOption.Int
Maximum image height in pixels, alignVipsOption.Enum
VipsAlign
Align on the low, centre or high edge, justifyVipsOption.Boolean
Justify lines, dpiVipsOption.Int
DPI to render at, autofit-dpiVipsOption.Int
DPI selected by autofit, spacingVipsOption.Int
Line spacing, fontfileVipsOption.String
Load this font file, rgbaVipsOption.Boolean
Enable RGBA output, wrapVipsOption.Enum
VipsTextWrap
Wrap lines on word or character boundaries
-
thumbnail
Make a thumbnail from a file. Shrinking is done in three stages: using any shrink-on-load features available in the file import library, using a block shrink, and using a lanczos3 shrink. At least the final 200% is done with lanczos3. The output should be high quality, and the operation should be quick.
See
thumbnailBuffer(app.photofox.vipsffm.VBlob, int, app.photofox.vipsffm.VipsOption...)
to thumbnail from a memory buffer, orthumbnailSource(app.photofox.vipsffm.VSource, int, app.photofox.vipsffm.VipsOption...)
to thumbnail from an arbitrary byte source.By default, libvips will only use the first frame of animated or multipage images. To thumbnail all pages or frames, pass `n=-1` to the loader in
filename
, for example `"x.gif[n=-1]"`.The output image will fit within a square of size
width
xwidth
. You can specify a separate height with theheight
option. Set eitherwidth
orheight
to a very large number to ignore that dimension.If you set
crop
, then the output image will fill the whole of thewidth
xheight
rectangle, with any excess cropped away. Seesmartcrop(int, int, app.photofox.vipsffm.VipsOption...)
for details on the cropping strategy.Normally the operation will upsize or downsize as required to fit the image inside or outside the target size. If
size
is set toVipsSize.SIZE_UP
, the operation will only upsize and will just copy if asked to downsize. Ifsize
is set toVipsSize.SIZE_DOWN
, the operation will only downsize and will just copy if asked to upsize. Ifsize
isVipsSize.SIZE_FORCE
, the image aspect ratio will be broken and the image will be forced to fit the target.Normally any orientation tags on the input image (such as EXIF tags) are interpreted to rotate the image upright. If you set
no-rotate
toTRUE
, these tags will not be interpreted.Shrinking is normally done in sRGB colourspace. Set
linear
to shrink in linear light colourspace instead. This can give better results, but can also be far slower, since tricks like JPEG shrink-on-load cannot be used in linear space.If you set
export-profile
to the filename of an ICC profile, the image will be transformed to the target colourspace before writing to the output. You can also give animport-profile
which will be used if the input image has no ICC profile, or if the profile embedded in the input image is broken.Use
intent
to set the rendering intent for any ICC transform. The default isVipsIntent.INTENT_RELATIVE
.Use
fail-on
to control the types of error that will cause loading to fail. The default isVipsFailOn.FAIL_ON_NONE
, ie. thumbnail is permissive.See also:
thumbnailBuffer(app.photofox.vipsffm.VBlob, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to read fromwidth
- Size to this widthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- height
VipsOption.Int
Size to this height, sizeVipsOption.Enum
VipsSize
Only upsize, only downsize, or both, no-rotateVipsOption.Boolean
Don't use orientation tags to rotate image upright, cropVipsOption.Enum
VipsInteresting
Reduce to fill target rectangle, then crop, linearVipsOption.Boolean
Reduce in linear light, import-profileVipsOption.String
Fallback import profile, export-profileVipsOption.String
Fallback export profile, intentVipsOption.Enum
VipsIntent
Rendering intent, auto-rotateVipsOption.Boolean
Use orientation tags to rotate image upright, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on
-
thumbnailBuffer
Exactly as
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer. One extra optional argument,option-string
, lets you pass options to the underlying loader.See also:
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromwidth
- Size to this widthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- option-string
VipsOption.String
Options that are passed on to the underlying loader, heightVipsOption.Int
Size to this height, sizeVipsOption.Enum
VipsSize
Only upsize, only downsize, or both, no-rotateVipsOption.Boolean
Don't use orientation tags to rotate image upright, cropVipsOption.Enum
VipsInteresting
Reduce to fill target rectangle, then crop, linearVipsOption.Boolean
Reduce in linear light, import-profileVipsOption.String
Fallback import profile, export-profileVipsOption.String
Fallback export profile, intentVipsOption.Enum
VipsIntent
Rendering intent, auto-rotateVipsOption.Boolean
Use orientation tags to rotate image upright, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on
-
thumbnailImage
Exactly as
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
, but read from an existing image.This operation is not able to exploit shrink-on-load features of image load libraries, so it can be much slower than `
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
` and produce poorer quality output. Only use it if you really have to.See also:
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Size to this widthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- height
VipsOption.Int
Size to this height, sizeVipsOption.Enum
VipsSize
Only upsize, only downsize, or both, no-rotateVipsOption.Boolean
Don't use orientation tags to rotate image upright, cropVipsOption.Enum
VipsInteresting
Reduce to fill target rectangle, then crop, linearVipsOption.Boolean
Reduce in linear light, import-profileVipsOption.String
Fallback import profile, export-profileVipsOption.String
Fallback export profile, intentVipsOption.Enum
VipsIntent
Rendering intent, auto-rotateVipsOption.Boolean
Use orientation tags to rotate image upright, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on
-
thumbnailSource
Exactly as
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
, but read from a source. One extra optional argument,option-string
, lets you pass options to the underlying loader.See also:
thumbnail(java.lang.String, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromwidth
- Size to this widthargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- option-string
VipsOption.String
Options that are passed on to the underlying loader, heightVipsOption.Int
Size to this height, sizeVipsOption.Enum
VipsSize
Only upsize, only downsize, or both, no-rotateVipsOption.Boolean
Don't use orientation tags to rotate image upright, cropVipsOption.Enum
VipsInteresting
Reduce to fill target rectangle, then crop, linearVipsOption.Boolean
Reduce in linear light, import-profileVipsOption.String
Fallback import profile, export-profileVipsOption.String
Fallback export profile, intentVipsOption.Enum
VipsIntent
Rendering intent, auto-rotateVipsOption.Boolean
Use orientation tags to rotate image upright, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on
-
tiffload
Read a TIFF file into a VIPS image. It is a full baseline TIFF 6 reader, with extensions for tiled images, multipage images, XYZ and LAB colour space, pyramidal images and JPEG compression, including CMYK and YCbCr.
page
means load this page from the file. By default the first page (page 0) is read.n
means load this many pages. By default a single page is read. All the pages must have the same dimensions, and they are loaded as a tall, thin "toilet roll" image. TheVIPS_META_PAGE_HEIGHT
metadata tag gives the height in pixels of each page. Use -1 to load all pages.Setting
autorotate
toTRUE
will make the loader interpret the orientation tag and automatically rotate the image appropriately during load.If
autorotate
isFALSE
, the metadata fieldVIPS_META_ORIENTATION
is set to the value of the orientation tag. Applications may read and interpret this field as they wish later in processing. Seeautorot(app.photofox.vipsffm.VipsOption...)
. Save operations will useVIPS_META_ORIENTATION
, if present, to set the orientation of output images.If
autorotate
is TRUE, the image will be rotated upright during load and no metadata attached. This can be very slow.If
subifd
is -1 (the default), the main image is selected for each page. If it is 0 or greater and there is a SUBIFD tag, the indexed SUBIFD is selected. This can be used to read lower resolution layers from bioformats-style image pyramids.Any ICC profile is read and attached to the VIPS image as
VIPS_META_ICC_NAME
. Any XMP metadata is read and attached to the image asVIPS_META_XMP_NAME
. Any IPTC is attached asVIPS_META_IPTC_NAME
. The image description is attached asVIPS_META_IMAGEDESCRIPTION
. Data in the photoshop tag is attached asVIPS_META_PHOTOSHOP_NAME
.See also:
vips_image_new_from_file
,autorot(app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, subifdVipsOption.Int
Subifd index, nVipsOption.Int
Number of pages to load, -1 for all, autorotateVipsOption.Boolean
Rotate image using orientation tag, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
tiffloadBuffer
Read a TIFF-formatted memory block into a VIPS image. Exactly as
tiffload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory source.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
tiffload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, subifdVipsOption.Int
Subifd index, nVipsOption.Int
Number of pages to load, -1 for all, autorotateVipsOption.Boolean
Rotate image using orientation tag, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
tiffloadSource
Exactly as
tiffload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
tiffload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, subifdVipsOption.Int
Subifd index, nVipsOption.Int
Number of pages to load, -1 for all, autorotateVipsOption.Boolean
Rotate image using orientation tag, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
tiffsave
Write a VIPS image to a file as TIFF.
If
in
has theVIPS_META_PAGE_HEIGHT
metadata item, this is assumed to be a "toilet roll" image. It will be written as series of pages, eachVIPS_META_PAGE_HEIGHT
pixels high.Use
compression
to set the tiff compression. Currently jpeg, packbits, fax4, lzw, none, deflate, webp and zstd are supported. The default is no compression. JPEG compression is a good lossy compressor for photographs, packbits is good for 1-bit images, and deflate is the best lossless compression TIFF can do.XYZ images are automatically saved as libtiff LOGLUV with SGILOG compression. Float LAB images are saved as float CIELAB. Set
bitdepth
to save as 8-bit CIELAB.Use
Q
to set the JPEG compression factor. Default 75.User
level
to set the ZSTD (1-22) or Deflate (1-9) compression level. Uselossless
to set WEBP lossless mode on. UseQ
to set the WEBP compression level.Use
predictor
to set the predictor for lzw, deflate and zstd compression. It defaults toVipsForeignTiffPredictor.FOREIGN_TIFF_PREDICTOR_HORIZONTAL
, meaning horizontal differencing. Please refer to the libtiff specifications for further discussion of various predictors.Set
tile
to TRUE to write a tiled tiff. By default tiff are written in strips. Usetile-width
andtile-height
to set the tile size. The defaiult is 128 by 128.Set
pyramid
to write the image as a set of images, one per page, of decreasing size. Useregion-shrink
to set how images will be shrunk: by default each 2x2 block is just averaged, but you can set MODE or MEDIAN as well.By default, the pyramid stops when the image is small enough to fit in one tile. Use
depth
to stop when the image fits in one pixel, or to only write a single layer.Set
bitdepth
to save 8-bit uchar images as 1, 2 or 4-bit TIFFs. In case of depth 1: Values >128 are written as white, values <=128 as black. Normally vips will write MINISBLACK TIFFs where black is a 0 bit, but if you setminiswhite
, it will use 0 for a white bit. Many pre-press applications only work with images which use this sense.miniswhite
only affects one-bit images, it does nothing for greyscale images. In case of depth 2: The same holds but values < 64 are written as black. For 64 <= values < 128 they are written as dark grey, for 128 <= values < 192 they are written as light gray and values above are written as white. In caseminiswhite
is set to true this behavior is inverted. In case of depth 4: values < 16 are written as black, and so on for the lighter shades. In caseminiswhite
is set to true this behavior is inverted.Use
resunit
to override the default resolution unit. The default resolution unit is taken from the header fieldVIPS_META_RESOLUTION_UNIT
. If this field is not set, then VIPS defaults to cm.Use
xres
andyres
to override the default horizontal and vertical resolutions. By default these values are taken from the VIPS image header. libvips resolution is always in pixels per millimetre.Set
bigtiff
to attempt to write a bigtiff. Bigtiff is a variant of the TIFF format that allows more than 4GB in a file.Set
properties
to write all vips metadata to the IMAGEDESCRIPTION tag as xml. Ifproperties
is not set, the value ofVIPS_META_IMAGEDESCRIPTION
is used instead.The value of
VIPS_META_XMP_NAME
is written to the XMP tag.VIPS_META_ORIENTATION
(if set) is used to set the value of the orientation tag.VIPS_META_IPTC
(if set) is used to set the value of the IPTC tag.VIPS_META_PHOTOSHOP_NAME
(if set) is used to set the value of the PHOTOSHOP tag.By default, pyramid layers are saved as consecutive pages. Set
subifd
to save pyramid layers as sub-directories of the main image. Setting this option can improve compatibility with formats like OME.Set
premultiply
to save with premultiplied alpha. Some programs, such as InDesign, will only work with premultiplied alpha.See also:
tiffload(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- compression
VipsOption.Enum
VipsForeignTiffCompression
Compression for this file, QVipsOption.Int
Q factor, predictorVipsOption.Enum
VipsForeignTiffPredictor
Compression prediction, tileVipsOption.Boolean
Write a tiled tiff, tile-widthVipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, pyramidVipsOption.Boolean
Write a pyramidal tiff, miniswhiteVipsOption.Boolean
Use 0 for white in 1-bit images, bitdepthVipsOption.Int
Write as a 1, 2, 4 or 8 bit image, resunitVipsOption.Enum
VipsForeignTiffResunit
Resolution unit, xresVipsOption.Double
Horizontal resolution in pixels/mm, yresVipsOption.Double
Vertical resolution in pixels/mm, bigtiffVipsOption.Boolean
Write a bigtiff image, propertiesVipsOption.Boolean
Write a properties document to IMAGEDESCRIPTION, region-shrinkVipsOption.Enum
VipsRegionShrink
Method to shrink regions, levelVipsOption.Int
Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level, losslessVipsOption.Boolean
Enable WEBP lossless mode, depthVipsOption.Enum
VipsForeignDzDepth
Pyramid depth, subifdVipsOption.Boolean
Save pyr layers as sub-IFDs, premultiplyVipsOption.Boolean
Save with premultiplied alpha, rgbjpegVipsOption.Boolean
Output RGB JPEG rather than YCbCr, squashVipsOption.Boolean
Squash images down to 1 bit, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
tiffsaveBuffer
As
tiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
tiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- compression
VipsOption.Enum
VipsForeignTiffCompression
Compression for this file, QVipsOption.Int
Q factor, predictorVipsOption.Enum
VipsForeignTiffPredictor
Compression prediction, tileVipsOption.Boolean
Write a tiled tiff, tile-widthVipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, pyramidVipsOption.Boolean
Write a pyramidal tiff, miniswhiteVipsOption.Boolean
Use 0 for white in 1-bit images, bitdepthVipsOption.Int
Write as a 1, 2, 4 or 8 bit image, resunitVipsOption.Enum
VipsForeignTiffResunit
Resolution unit, xresVipsOption.Double
Horizontal resolution in pixels/mm, yresVipsOption.Double
Vertical resolution in pixels/mm, bigtiffVipsOption.Boolean
Write a bigtiff image, propertiesVipsOption.Boolean
Write a properties document to IMAGEDESCRIPTION, region-shrinkVipsOption.Enum
VipsRegionShrink
Method to shrink regions, levelVipsOption.Int
Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level, losslessVipsOption.Boolean
Enable WEBP lossless mode, depthVipsOption.Enum
VipsForeignDzDepth
Pyramid depth, subifdVipsOption.Boolean
Save pyr layers as sub-IFDs, premultiplyVipsOption.Boolean
Save with premultiplied alpha, rgbjpegVipsOption.Boolean
Output RGB JPEG rather than YCbCr, squashVipsOption.Boolean
Squash images down to 1 bit, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
tiffsaveTarget
As
tiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
tiffsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_target
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- compression
VipsOption.Enum
VipsForeignTiffCompression
Compression for this file, QVipsOption.Int
Q factor, predictorVipsOption.Enum
VipsForeignTiffPredictor
Compression prediction, tileVipsOption.Boolean
Write a tiled tiff, tile-widthVipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, pyramidVipsOption.Boolean
Write a pyramidal tiff, miniswhiteVipsOption.Boolean
Use 0 for white in 1-bit images, bitdepthVipsOption.Int
Write as a 1, 2, 4 or 8 bit image, resunitVipsOption.Enum
VipsForeignTiffResunit
Resolution unit, xresVipsOption.Double
Horizontal resolution in pixels/mm, yresVipsOption.Double
Vertical resolution in pixels/mm, bigtiffVipsOption.Boolean
Write a bigtiff image, propertiesVipsOption.Boolean
Write a properties document to IMAGEDESCRIPTION, region-shrinkVipsOption.Enum
VipsRegionShrink
Method to shrink regions, levelVipsOption.Int
Deflate (1-9, default 6) or ZSTD (1-22, default 9) compression level, losslessVipsOption.Boolean
Enable WEBP lossless mode, depthVipsOption.Enum
VipsForeignDzDepth
Pyramid depth, subifdVipsOption.Boolean
Save pyr layers as sub-IFDs, premultiplyVipsOption.Boolean
Save with premultiplied alpha, rgbjpegVipsOption.Boolean
Output RGB JPEG rather than YCbCr, squashVipsOption.Boolean
Squash images down to 1 bit, keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
tilecache
This operation behaves rather like
copy(app.photofox.vipsffm.VipsOption...)
between imagesin
andout
, except that it keeps a cache of computed pixels. This cache is made of up tomax-tiles
tiles (a value of -1 means any number of tiles), and each tile is of sizetile-width
bytile-height
pixels.Each cache tile is made with a single call to
vips_region_prepare
.When the cache fills, a tile is chosen for reuse. If
access
isVipsAccess.ACCESS_RANDOM
, then the least-recently-used tile is reused. Ifaccess
isVipsAccess.ACCESS_SEQUENTIAL
the top-most tile is reused.By default,
tile-width
andtile-height
are 128 pixels, and the operation will cache up to 1,000 tiles.access
defaults toVipsAccess.ACCESS_RANDOM
.Normally, only a single thread at once is allowed to calculate tiles. If you set
threaded
toTRUE
,tilecache
will allow many threads to calculate tiles at once, and share the cache between them.Normally the cache is dropped when computation finishes. Set
persistent
toTRUE
to keep the cache between computations.See also:
vips_cache
,linecache(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- tile-width
VipsOption.Int
Tile width in pixels, tile-heightVipsOption.Int
Tile height in pixels, max-tilesVipsOption.Int
Maximum number of tiles to cache, accessVipsOption.Enum
VipsAccess
Expected access pattern, threadedVipsOption.Boolean
Allow threaded access, persistentVipsOption.Boolean
Keep cache between evaluations
-
tonelut
tonelut
generates a tone curve for the adjustment of image levels. It is mostly designed for adjusting the L* part of a LAB image in a way suitable for print work, but you can use it for other things too.The curve is an unsigned 16-bit image with (
in-max
+ 1) entries, each in the range [0,out-max
].Lb
,Lw
are expressed as 0-100, as in LAB colour space. You specify the scaling for the input and output images with thein-max
andout-max
parameters.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- in-max
VipsOption.Int
Size of LUT to build, out-maxVipsOption.Int
Maximum value in output LUT, LbVipsOption.Double
Lowest value in output, LwVipsOption.Double
Highest value in output, PsVipsOption.Double
Position of shadow, PmVipsOption.Double
Position of mid-tones, PhVipsOption.Double
Position of highlights, SVipsOption.Double
Adjust shadows by this much, MVipsOption.Double
Adjust mid-tones by this much, HVipsOption.Double
Adjust highlights by this much
-
transpose3d
Transpose a volumetric image.
Volumetric images are very tall, thin images, with the metadata item
VIPS_META_PAGE_HEIGHT
set to the height of each sub-image.This operation swaps the two major dimensions, so that page N in the output contains the Nth scanline, in order, from each input page.
You can override the
VIPS_META_PAGE_HEIGHT
metadata item with the optionalpage-height
parameter.VIPS_META_PAGE_HEIGHT
in the output image is the number of pages in the input image.See also:
grid(int, int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page-height
VipsOption.Int
Height of each input page
-
unpremultiply
Unpremultiplies any alpha channel. Band
alpha-band
(by default the final band) contains the alpha and all other bands are transformed as:alpha = (int) clip(0, in[in.bands - 1], {@code max-alpha}); norm = (double) alpha / {@code max-alpha}; if (alpha == 0) out = [0, ..., 0, alpha]; else out = [in[0] / norm, ..., in[in.bands - 1] / norm, alpha];
So for an N-band image, the first N - 1 bands are divided by the clipped and normalised final band, the final band is clipped. If there is only a single band, the image is passed through unaltered.
The result is
VipsBandFormat.FORMAT_FLOAT
unless the input format isVipsBandFormat.FORMAT_DOUBLE
, in which case the output is double as well.max-alpha
has the default value 255, or 65535 for images tagged asVipsInterpretation.INTERPRETATION_RGB16
orVipsInterpretation.INTERPRETATION_GREY16
.Non-complex images only.
See also:
premultiply(app.photofox.vipsffm.VipsOption...)
,flatten(app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- max-alpha
VipsOption.Double
Maximum value of alpha channel, alpha-bandVipsOption.Int
Unpremultiply with this alpha
-
vipsload
Read in a vips image.
See also:
vipssave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
vipsloadSource
Exactly as
vipsload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- flags
VipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
vipssave
Write
in
tofilename
in VIPS format.See also:
vipsload(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
vipssaveTarget
As
vipssave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- keep
VipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
webpload
Read a WebP file into a VIPS image.
Use
page
to select a page to render, numbering from zero.Use
n
to select the number of pages to render. The default is 1. Pages are rendered in a vertical column, with each individual page aligned to the left. Set to -1 to mean "until the end of the document". Usegrid(int, int, int, app.photofox.vipsffm.VipsOption...)
to change page layout.Use
scale
to specify a scale-on-load factor. For example, 2.0 to double the size on load. Animated webp images don't support shrink-on-load, so a further resize may be necessary.The loader supports ICC, EXIF and XMP metadata.
See also:
vips_image_new_from_file
.- Parameters:
filename
- Filename to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, scaleVipsOption.Double
Factor to scale by, shrinkVipsOption.Int
Shrink factor on load, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
webploadBuffer
Read a WebP-formatted memory block into a VIPS image. Exactly as
webpload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a memory buffer.You must not free the buffer while
out
is active. TheVipsObject
::postclose signal onout
is a good place to free.See also:
webpload(java.lang.String, app.photofox.vipsffm.VipsOption...)
- Parameters:
buffer
- Buffer to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, scaleVipsOption.Double
Factor to scale by, shrinkVipsOption.Int
Shrink factor on load, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
webploadSource
Exactly as
webpload(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but read from a source.See also:
webpload(java.lang.String, app.photofox.vipsffm.VipsOption...)
- Parameters:
source
- Source to load fromargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- page
VipsOption.Int
First page to load, nVipsOption.Int
Number of pages to load, -1 for all, scaleVipsOption.Double
Factor to scale by, shrinkVipsOption.Int
Shrink factor on load, flagsVipsOption.Int
Flags for this file, memoryVipsOption.Boolean
Force open via memory, accessVipsOption.Enum
VipsAccess
Required access pattern for this file, fail-onVipsOption.Enum
VipsFailOn
Error level to fail on, revalidateVipsOption.Boolean
Don't use a cached result for this operation, sequentialVipsOption.Boolean
Sequential read only, failVipsOption.Boolean
Fail on first warning, discVipsOption.Boolean
Open to disc
-
webpsave
Write an image to a file in WebP format.
By default, images are saved in lossy format, with
Q
giving the WebP quality factor. It has the range 0 - 100, with the default 75.Use
preset
to hint the image type to the lossy compressor. The default isVipsForeignWebpPreset.FOREIGN_WEBP_PRESET_DEFAULT
.Set
smart-subsample
to enable high quality chroma subsampling.Set
smart-deblock
to enable auto-adjusting of the deblocking filter. This can improve image quality, especially on low-contrast edges, but encoding can take significantly longer.Use
alpha-q
to set the quality for the alpha channel in lossy mode. It has the range 1 - 100, with the default 100.Use
effort
to control how much CPU time to spend attempting to reduce file size. A higher value means more effort and therefore CPU time should be spent. It has the range 0-6 and a default value of 4.Use
target-size
to set the desired target size in bytes.Use
passes
to set the number of entropy-analysis passes, by default 1, unlesstarget-size
is set, in which case the default is 3. It is not recommended to setpasses
unless you settarget-size
. Doing so will result in longer encoding times for no benefit.Set
lossless
to use lossless compression, or combinenear-lossless
withQ
80, 60, 40 or 20 to apply increasing amounts of preprocessing which improves the near-lossless compression ratio by up to 50%.For animated webp output,
min-size
will try to optimize for minimum size.For animated webp output,
kmax
sets the maximum number of frames between keyframes. Setting 0 means only keyframes.kmin
sets the minimum number of frames between frames. Setting 0 means no keyframes. By default, keyframes are disabled.For animated webp output,
mixed
tries to improve the file size by mixing both lossy and lossless encoding.Use the metadata items `loop` and `delay` to set the number of loops for the animation and the frame delays.
See also:
webpload(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
filename
- Filename to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, losslessVipsOption.Boolean
Enable lossless compression, presetVipsOption.Enum
VipsForeignWebpPreset
Preset for lossy compression, smart-subsampleVipsOption.Boolean
Enable high quality chroma subsampling, near-losslessVipsOption.Boolean
Enable preprocessing in lossless mode (uses Q), alpha-qVipsOption.Int
Change alpha plane fidelity for lossy compression, min-sizeVipsOption.Boolean
Optimise for minimum size, kminVipsOption.Int
Minimum number of frames between key frames, kmaxVipsOption.Int
Maximum number of frames between key frames, effortVipsOption.Int
Level of CPU effort to reduce file size, target-sizeVipsOption.Int
Desired target size in bytes, reduction-effortVipsOption.Int
Level of CPU effort to reduce file size, mixedVipsOption.Boolean
Allow mixed encoding (might reduce file size), smart-deblockVipsOption.Boolean
Enable auto-adjusting of the deblocking filter, passesVipsOption.Int
Number of entropy-analysis passes (in [1..10]), keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
webpsaveBuffer
As
webpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a memory buffer.The address of the buffer is returned in
buf
, the length of the buffer inlen
. You are responsible for freeing the buffer with g_free() when you are done with it.See also:
webpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, losslessVipsOption.Boolean
Enable lossless compression, presetVipsOption.Enum
VipsForeignWebpPreset
Preset for lossy compression, smart-subsampleVipsOption.Boolean
Enable high quality chroma subsampling, near-losslessVipsOption.Boolean
Enable preprocessing in lossless mode (uses Q), alpha-qVipsOption.Int
Change alpha plane fidelity for lossy compression, min-sizeVipsOption.Boolean
Optimise for minimum size, kminVipsOption.Int
Minimum number of frames between key frames, kmaxVipsOption.Int
Maximum number of frames between key frames, effortVipsOption.Int
Level of CPU effort to reduce file size, target-sizeVipsOption.Int
Desired target size in bytes, reduction-effortVipsOption.Int
Level of CPU effort to reduce file size, mixedVipsOption.Boolean
Allow mixed encoding (might reduce file size), smart-deblockVipsOption.Boolean
Enable auto-adjusting of the deblocking filter, passesVipsOption.Int
Number of entropy-analysis passes (in [1..10]), keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
webpsaveMime
As
webpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save as a mime webp on stdout.See also:
webpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
,vips_image_write_to_file
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, losslessVipsOption.Boolean
Enable lossless compression, presetVipsOption.Enum
VipsForeignWebpPreset
Preset for lossy compression, smart-subsampleVipsOption.Boolean
Enable high quality chroma subsampling, near-losslessVipsOption.Boolean
Enable preprocessing in lossless mode (uses Q), alpha-qVipsOption.Int
Change alpha plane fidelity for lossy compression, min-sizeVipsOption.Boolean
Optimise for minimum size, kminVipsOption.Int
Minimum number of frames between key frames, kmaxVipsOption.Int
Maximum number of frames between key frames, effortVipsOption.Int
Level of CPU effort to reduce file size, target-sizeVipsOption.Int
Desired target size in bytes, reduction-effortVipsOption.Int
Level of CPU effort to reduce file size, mixedVipsOption.Boolean
Allow mixed encoding (might reduce file size), smart-deblockVipsOption.Boolean
Enable auto-adjusting of the deblocking filter, passesVipsOption.Int
Number of entropy-analysis passes (in [1..10]), keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
webpsaveTarget
As
webpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
, but save to a target.See also:
webpsave(java.lang.String, app.photofox.vipsffm.VipsOption...)
.- Parameters:
target
- Target to save toargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- Q
VipsOption.Int
Q factor, losslessVipsOption.Boolean
Enable lossless compression, presetVipsOption.Enum
VipsForeignWebpPreset
Preset for lossy compression, smart-subsampleVipsOption.Boolean
Enable high quality chroma subsampling, near-losslessVipsOption.Boolean
Enable preprocessing in lossless mode (uses Q), alpha-qVipsOption.Int
Change alpha plane fidelity for lossy compression, min-sizeVipsOption.Boolean
Optimise for minimum size, kminVipsOption.Int
Minimum number of frames between key frames, kmaxVipsOption.Int
Maximum number of frames between key frames, effortVipsOption.Int
Level of CPU effort to reduce file size, target-sizeVipsOption.Int
Desired target size in bytes, reduction-effortVipsOption.Int
Level of CPU effort to reduce file size, mixedVipsOption.Boolean
Allow mixed encoding (might reduce file size), smart-deblockVipsOption.Boolean
Enable auto-adjusting of the deblocking filter, passesVipsOption.Int
Number of entropy-analysis passes (in [1..10]), keepVipsOption.Int
Which metadata to retain, backgroundVipsOption.ArrayDouble
Background value, page-heightVipsOption.Int
Set page height for multipage save, profileVipsOption.String
Filename of ICC profile to embed, stripVipsOption.Boolean
Strip all metadata from image
-
worley
Create a one-band float image of Worley noise. See:
https://en.wikipedia.org/wiki/Worley_noise
Use
cell-size
to set the size of the cells from which the image is constructed. The default is 256 x 256.If
width
andheight
are multiples ofcell-size
, the image will tessellate.See also:
perlin(int, int, app.photofox.vipsffm.VipsOption...)
,fractsurf(int, int, double, app.photofox.vipsffm.VipsOption...)
,gaussnoise(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- cell-size
VipsOption.Int
Size of Worley cells, seedVipsOption.Int
Random number seed
-
wrap
Slice an image up and move the segments about so that the pixel that was at 0, 0 is now at
x
,y
. Ifx
andy
are not set, they default to the centre of the image.See also:
embed(int, int, int, int, app.photofox.vipsffm.VipsOption...)
,replicate(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
args
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- x
VipsOption.Int
Left edge of input in output, yVipsOption.Int
Top edge of input in output
-
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.
You can make any image where the value of a pixel is a function of its (x, y) coordinate by combining this operator with the arithmetic operators.
Set
csize
,dsize
,esize
to generate higher dimensions and add more bands. The extra dimensions are placed down the vertical axis. Usegrid(int, int, int, app.photofox.vipsffm.VipsOption...)
to change the layout.See also:
grey(int, int, app.photofox.vipsffm.VipsOption...)
,grid(int, int, int, app.photofox.vipsffm.VipsOption...)
,identity(app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- csize
VipsOption.Int
Size of third dimension, dsizeVipsOption.Int
Size of fourth dimension, esizeVipsOption.Int
Size of fifth dimension
-
zone
Create a one-band image of a zone plate.
Pixels are normally in [-1, +1], set
uchar
to output [0, 255].See also:
eye(int, int, app.photofox.vipsffm.VipsOption...)
,xyz(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
width
- Image width in pixelsheight
- Image height in pixelsargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
- Optional arguments:
- uchar
VipsOption.Boolean
Output an unsigned char image
-
zoom
Zoom an image by repeating pixels. This is fast nearest-neighbour zoom.
See also:
affine(java.util.List<java.lang.Double>, app.photofox.vipsffm.VipsOption...)
,subsample(int, int, app.photofox.vipsffm.VipsOption...)
.- Parameters:
xfac
- Horizontal zoom factoryfac
- Vertical zoom factorargs
- Array of VipsOption to apply to this operation- Throws:
VipsError
-
getWidth
-
getHeight
-
hasAlpha
-
newFromFile
-
newFromSource
-
newFromSource
-
newFromBytes
public static VImage newFromBytes(Arena arena, byte[] bytes, String optionString, VipsOption... options) throws VipsError Creates a new VImage from raw bytes. Note that this is quite inefficient, usenewFromFile(Arena, String, VipsOption...)
and friends instead.- Throws:
VipsError
-
newFromBytes
public static VImage newFromBytes(Arena arena, byte[] bytes, VipsOption... options) throws VipsError - Throws:
VipsError
-
newFromStream
public static VImage newFromStream(Arena arena, InputStream stream, String optionString, VipsOption... options) throws VipsError Creates a new VImage from anInputStream
. This uses libvips' "custom streaming" feature and is therefore quite efficient, avoiding the need to make extra full copies of the image's data. You could, for example, use this function to create an image directly from an API call, thumbnail it, and then upload directly to an S3-compatible API efficiently in memory - all without creating a local file.- Throws:
VipsError
-
newFromStream
public static VImage newFromStream(Arena arena, InputStream stream, VipsOption... options) throws VipsError - Throws:
VipsError
-
writeToFile
- Throws:
VipsError
-
write
-
writeToTarget
- Throws:
VipsError
-
writeToStream
public void writeToStream(OutputStream stream, String suffix, VipsOption... options) throws VipsError Writes this VImage to anOutputStream
. This uses libvips' "custom streaming" feature and is therefore quite efficient, avoiding the need to make extra full copies of the image's data. You could, for example, use this function to create an image directly from an API call, thumbnail it, and then upload directly to an S3-compatible API efficiently in memory - all without creating a local file.- Throws:
VipsError
-
newImage
-
getUnsafeStructAddress()