Class: Vips::Image
- Inherits:
-
Object
- Object
- Vips::Image
- Defined in:
- lib/vips8/image.rb,
lib/vips8/methods.rb
Overview
This class represents a libvips image. See the Vips module documentation for an introduction to using this module.
Instance Attribute Summary (collapse)
-
- (Integer) bands
readonly
Image bands.
-
- (Vips::Coding) coding
readonly
Image coding.
-
- (String) filename
readonly
Image filename.
-
- (Vips::BandFormat) format
readonly
Image format.
-
- (Integer) height
readonly
Image height, in pixels.
-
- (Vips::Interpretation) interpretation
readonly
Image interpretation.
-
- (Integer) width
readonly
Image width, in pixels.
-
- (Float) xres
readonly
Horizontal image resolution, in pixels per mm.
-
- (Float) yres
readonly
Vertical image resolution, in pixels per mm.
Class Method Summary (collapse)
-
+ (Vips::Image) analyzeload(filename, opts = {})
Load an analyze6 image.
-
+ (Vips::Image) arrayjoin
Join an array of images.
-
+ (Vips::Image) bandrank
Band-wise rank of a set of images.
-
+ (Vips::Image) black(width, height, opts = {})
Make a black image.
-
+ (Vips::Image) csvload(filename, opts = {})
Load csv from file.
-
+ (Vips::Image) eye(width, height, opts = {})
Make an image showing the eye's spatial response.
-
+ (Vips::Image) fitsload(filename, opts = {})
Load a fits image.
-
+ (Vips::Image) fractsurf(width, height, fractal_dimension, opts = {})
Make a fractal surface.
-
+ (Vips::Image) gaussmat(sigma, min_ampl, opts = {})
Make a gaussian image.
-
+ (Vips::Image) gaussnoise(width, height, opts = {})
Make a gaussnoise image.
-
+ (Vips::Image) grey(width, height, opts = {})
Make a grey ramp image.
-
+ (Vips::Image) identity(opts = {})
Make a 1d image where pixel values are indexes.
-
+ (Vips::Image) jpegload(filename, opts = {})
Load jpeg from file.
-
+ (Vips::Image) jpegload_buffer(buffer, opts = {})
Load jpeg from buffer.
-
+ (Vips::Image) logmat(sigma, min_ampl, opts = {})
Make a laplacian of gaussian image.
-
+ (Vips::Image) magickload(filename, opts = {})
Load file with imagemagick.
-
+ (Vips::Image) magickload_buffer(buffer, opts = {})
Load buffer with imagemagick.
-
+ (Vips::Image) mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, opts = {})
Make a butterworth filter.
-
+ (Vips::Image) mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {})
Make a butterworth_band filter.
-
+ (Vips::Image) mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {})
Make a butterworth ring filter.
-
+ (Vips::Image) mask_fractal(width, height, fractal_dimension, opts = {})
Make fractal filter.
-
+ (Vips::Image) mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, opts = {})
Make a gaussian filter.
-
+ (Vips::Image) mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {})
Make a gaussian filter.
-
+ (Vips::Image) mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {})
Make a gaussian ring filter.
-
+ (Vips::Image) mask_ideal(width, height, frequency_cutoff, opts = {})
Make an ideal filter.
-
+ (Vips::Image) mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, opts = {})
Make an ideal band filter.
-
+ (Vips::Image) mask_ideal_ring(width, height, frequency_cutoff, ringwidth, opts = {})
Make an ideal ring filter.
-
+ (Vips::Image) matload(filename, opts = {})
Load mat from file.
-
+ (Vips::Image) matrixload(filename, opts = {})
Load matrix from file.
-
+ (Object) method_missing(name, *args)
Invoke a vips operation with call.
-
+ (Image) new_from_array(array, scale = 1, offset = 0)
Create a new Image from a 1D or 2D array.
-
+ (Image) new_from_buffer(data, option_string, opts = {})
Create a new Image for an image encoded in a format, such as JPEG, in a memory string.
-
+ (Image) new_from_file(name, opts = {})
Return a new Image for a file on disc.
-
+ (Vips::Image) openexrload(filename, opts = {})
Load an openexr image.
-
+ (Vips::Image) openslideload(filename, opts = {})
Load file with openslide.
-
+ (Vips::Image) pngload(filename, opts = {})
Load png from file.
-
+ (Vips::Image) pngload_buffer(buffer, opts = {})
Load png from buffer.
-
+ (Vips::Image) ppmload(filename, opts = {})
Load ppm from file.
-
+ (Vips::Image) radload(filename, opts = {})
Load a radiance image from a file.
-
+ (Vips::Image) rawload(filename, width, height, bands, opts = {})
Load raw data from a file.
-
+ (Vips::Image) sines(width, height, opts = {})
Make a 2d sine wave.
-
+ (Vips::Image) sum
Sum an array of images.
-
+ (Object) system(cmd_format, opts = {})
Run an external command.
-
+ (Vips::Image) text(text, opts = {})
Make a text image.
-
+ (Vips::Image) tiffload(filename, opts = {})
Load tiff from file.
-
+ (Vips::Image) tiffload_buffer(buffer, opts = {})
Load tiff from buffer.
-
+ (Vips::Image) tonelut(opts = {})
Build a look-up table.
-
+ (Vips::Image) vipsload(filename, opts = {})
Load vips from file.
-
+ (Vips::Image) webpload(filename, opts = {})
Load webp from file.
-
+ (Vips::Image) webpload_buffer(buffer, opts = {})
Load webp from buffer.
-
+ (Vips::Image) xyz(width, height, opts = {})
Make an image where pixel values are coordinates.
-
+ (Vips::Image) zone(width, height, opts = {})
Make a zone plate.
Instance Method Summary (collapse)
-
- (Image) !
Equivalent to image ^ -1.
-
- (Image) !=(other)
Compare inequality to nil, an image, constant or array.
-
- (Image) %(other)
Remainder after integer division with an image, constant or array.
-
- (Image) &(other)
Integer bitwise AND with an image, constant or array.
-
- (Image) *(other)
Multiply an image, constant or array.
-
- (Image) **(other)
Raise to power of an image, constant or array.
-
- (Image) +(other)
Add an image, constant or array.
-
- (Image) +@
Image.
-
- (Image) -(other)
Subtract an image, constant or array.
-
- (Image) -@
Equivalent to image * -1.
-
- (Image) /(other)
Divide an image, constant or array.
-
- (Image) <(other)
Relational less than with an image, constant or array.
-
- (Image) <<(other)
Integer left shift with an image, constant or array.
-
- (Image) <=(other)
Relational less than or equal to with an image, constant or array.
-
- (Image) ==(other)
Compare equality to nil, an image, constant or array.
-
- (Image) >(other)
Relational more than with an image, constant or array.
-
- (Image) >=(other)
Relational more than or equal to with an image, constant or array.
-
- (Image) >>(other)
Integer right shift with an image, constant or array.
-
- (Image) [](index)
Fetch bands using a number or a range.
-
- (Image) ^(other)
Integer bitwise EOR with an image, constant or array.
-
- (Vips::Image) abs(opts = {})
Absolute value of an image.
-
- (Image) acos
Return the inverse cosine of an image in degrees.
-
- (Vips::Image) add(right, opts = {})
Add two images.
-
- (Vips::Image) affine(matrix, opts = {})
Affine transform of an image.
-
- (Image) asin
Return the inverse sine of an image in degrees.
-
- (Image) atan
Return the inverse tangent of an image in degrees.
-
- (Vips::Image) autorot(opts = {})
Autorotate image by exif tag.
-
- (Float) avg(opts = {})
Find image average.
-
- (Image) bandand
AND the bands of an image together.
-
- (Vips::Image) bandbool(boolean, opts = {})
Boolean operation across image bands.
-
- (Image) bandeor
EOR the bands of an image together.
-
- (Vips::Image) bandfold(opts = {})
Fold up x axis into bands.
-
- (Image) bandjoin(other)
Join a set of images bandwise.
-
- (Vips::Image) bandjoin_const(c, opts = {})
Append a constant band to an image.
-
- (Vips::Image) bandmean(opts = {})
Band-wise average.
-
- (Image) bandor
OR the bands of an image together.
-
- (Array<Image>) bandsplit
Split an n-band image into n separate images.
-
- (Vips::Image) bandunfold(opts = {})
Unfold image bands into x axis.
-
- (Vips::Image) boolean(right, boolean, opts = {})
Boolean operation on two images.
-
- (Vips::Image) boolean_const(c, boolean, opts = {})
Boolean operations against a constant.
-
- (Vips::Image) buildlut(opts = {})
Build a look-up table.
-
- (Vips::Image) byteswap(opts = {})
Byteswap an image.
-
- (Vips::Image) cache(opts = {})
Cache an image.
-
- (Vips::Image) cast(format, opts = {})
Cast an image.
-
- (Image) ceil
Return the smallest integral value not less than the argument.
-
- (Vips::Image) CMC2LCh(opts = {})
Transform lch to cmc.
-
- (Vips::Image) colourspace(space, opts = {})
Convert to a new colourspace.
-
- (Vips::Image) compass(mask, opts = {})
Convolve with rotating mask.
-
- (Vips::Image) complex(cmplx, opts = {})
Perform a complex operation on an image.
-
- (Vips::Image) complex2(right, cmplx, opts = {})
Complex binary operations on two images.
-
- (Vips::Image) complexform(right, opts = {})
Form a complex image from two real images.
-
- (Vips::Image) complexget(get, opts = {})
Get a component from a complex image.
-
- (Image) conj
Return the complex conjugate of an image.
-
- (Vips::Image) conv(mask, opts = {})
Convolution operation.
-
- (Vips::Image) convsep(mask, opts = {})
Seperable convolution operation.
-
- (Vips::Image) copy(opts = {})
Copy an image.
-
- (Image) cos
Return the cosine of an image in degrees.
-
- (Float) countlines(direction, opts = {})
Count lines in an image.
-
- (Object) csvsave(filename, opts = {})
Save image to csv file.
-
- (Vips::Image) dE00(right, opts = {})
Calculate de00.
-
- (Vips::Image) dE76(right, opts = {})
Calculate de76.
-
- (Vips::Image) dECMC(right, opts = {})
Calculate decmc.
-
- (Float) deviate(opts = {})
Find image standard deviation.
-
- (Image) dilate(mask)
Dilate with a structuring element.
-
- (Vips::Image) divide(right, opts = {})
Divide two images.
-
- (Vips::Image) draw_circle(ink, cx, cy, radius, opts = {})
Draw a circle on an image.
-
- (Vips::Image) draw_flood(ink, x, y, opts = {})
Flood-fill an area.
-
- (Vips::Image) draw_image(sub, x, y, opts = {})
Paint an image into another image.
-
- (Vips::Image) draw_line(ink, x1, y1, x2, y2, opts = {})
Draw a line on an image.
-
- (Vips::Image) draw_mask(ink, mask, x, y, opts = {})
Draw a mask on an image.
-
- (Vips::Image) draw_rect(ink, left, top, width, height, opts = {})
Paint a rectangle on an image.
-
- (Vips::Image) draw_smudge(left, top, width, height, opts = {})
Blur a rectangle on an image.
-
- (Object) dzsave(filename, opts = {})
Save image to deep zoom format.
-
- (Vips::Image) embed(x, y, width, height, opts = {})
Embed an image in a larger image.
-
- (Image) erode(mask)
Erode with a structuring element.
-
- (Image) exp
Return e ** pixel.
-
- (Image) exp10
Return 10 ** pixel.
-
- (Vips::Image) extract_area(left, top, width, height, opts = {})
Extract an area from an image.
-
- (Vips::Image) extract_band(band, opts = {})
Extract band from an image.
-
- (Vips::Image) falsecolour(opts = {})
False-colour an image.
-
- (Vips::Image) fastcor(ref, opts = {})
Fast correlation.
-
- (Object) fitssave(filename, opts = {})
Save image to fits file.
-
- (Vips::Image) flatten(opts = {})
Flatten alpha out of an image.
-
- (Vips::Image) flip(direction, opts = {})
Flip an image.
-
- (Image) fliphor
Flip horizontally.
-
- (Image) flipver
Flip vertically.
-
- (Vips::Image) float2rad(opts = {})
Transform float rgb to radiance coding.
-
- (Image) floor
Return the largest integral value not greater than the argument.
-
- (Vips::Image) freqmult(mask, opts = {})
Frequency-domain filtering.
-
- (Vips::Image) fwfft(opts = {})
Forward fft.
-
- (Vips::Image) gamma(opts = {})
Gamma an image.
-
- (Vips::Image) gaussblur(sigma, opts = {})
Gaussian blur.
-
- (GValue) get(name)
Fetch a
GValue
from an image. -
- (void) get_value(name)
Get a metadata item from an image.
-
- (Array<Double>) getpoint(x, y, opts = {})
Read a point from an image.
-
- (Vips::Image) globalbalance(opts = {})
Global balance an image mosaic.
-
- (Vips::Image) grid(tile_height, across, down, opts = {})
Grid an image.
-
- (Vips::Image) hist_cum(opts = {})
Form cumulative histogram.
-
- (Float) hist_entropy(opts = {})
Estimate image entropy.
-
- (Vips::Image) hist_equal(opts = {})
Histogram equalisation.
-
- (Vips::Image) hist_find(opts = {})
Find image histogram.
-
- (Vips::Image) hist_find_indexed(index, opts = {})
Find indexed image histogram.
-
- (Vips::Image) hist_find_ndim(opts = {})
Find n-dimensional image histogram.
-
- (Boolean) hist_ismonotonic(opts = {})
Test for monotonicity.
-
- (Vips::Image) hist_local(width, height, opts = {})
Local histogram equalisation.
-
- (Vips::Image) hist_match(ref, opts = {})
Match two histograms.
-
- (Vips::Image) hist_norm(opts = {})
Normalise histogram.
-
- (Vips::Image) hist_plot(opts = {})
Plot histogram.
-
- (Vips::Image) hough_circle(opts = {})
Find hough circle transform.
-
- (Vips::Image) hough_line(opts = {})
Find hough line transform.
-
- (Vips::Image) HSV2sRGB(opts = {})
Transform hsv to srgb.
-
- (Vips::Image) icc_export(opts = {})
Output to device with icc profile.
-
- (Vips::Image) icc_import(opts = {})
Import from device with icc profile.
-
- (Vips::Image) icc_transform(output_profile, opts = {})
Transform between devices with icc profiles.
-
- (Image) ifthenelse(th, el, opts = {})
Select pixels from
th
ifself
is non-zero and fromel
ifself
is zero. -
- (Image) imag
Return the imaginary part of a complex image.
-
- (Vips::Image) insert(sub, x, y, opts = {})
Insert image @sub into @main at @x, @y.
-
- (Vips::Image) invert(opts = {})
Invert an image.
-
- (Vips::Image) invertlut(opts = {})
Build an inverted look-up table.
-
- (Vips::Image) invfft(opts = {})
Inverse fft.
-
- (Vips::Image) join(in2, direction, opts = {})
Join a pair of images.
-
- (Object) jpegsave(filename, opts = {})
Save image to jpeg file.
-
- (Vips::Blob) jpegsave_buffer(opts = {})
Save image to jpeg buffer.
-
- (Object) jpegsave_mime(opts = {})
Save image to jpeg mime.
-
- (Vips::Image) Lab2LabQ(opts = {})
Transform float lab to labq coding.
-
- (Vips::Image) Lab2LabS(opts = {})
Transform float lab to signed short.
-
- (Vips::Image) Lab2LCh(opts = {})
Transform lab to lch.
-
- (Vips::Image) Lab2XYZ(opts = {})
Transform cielab to xyz.
-
- (Vips::Image) labelregions(opts = {})
Label regions in an image.
-
- (Vips::Image) LabQ2Lab(opts = {})
Unpack a labq image to float lab.
-
- (Vips::Image) LabQ2LabS(opts = {})
Unpack a labq image to short lab.
-
- (Vips::Image) LabQ2sRGB(opts = {})
Convert a labq image to srgb.
-
- (Vips::Image) LabS2Lab(opts = {})
Transform signed short lab to float.
-
- (Vips::Image) LabS2LabQ(opts = {})
Transform short lab to labq coding.
-
- (Vips::Image) LCh2CMC(opts = {})
Transform lch to cmc.
-
- (Vips::Image) LCh2Lab(opts = {})
Transform lch to lab.
-
- (Vips::Image) linear(a, b, opts = {})
Calculate (a * in + b).
-
- (Vips::Image) linecache(opts = {})
Cache an image as a set of lines.
-
- (Image) log
Return the natural log of an image.
-
- (Image) log10
Return the log base 10 of an image.
-
- (Vips::Image) mapim(index, opts = {})
Resample with an mapim image.
-
- (Vips::Image) maplut(lut, opts = {})
Map an image though a lut.
-
- (Vips::Image) match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {})
First-order match of two images.
-
- (Vips::Image) math(math, opts = {})
Apply a math operation to an image.
-
- (Vips::Image) math2(right, math2, opts = {})
Binary math operations.
-
- (Vips::Image) math2_const(c, math2, opts = {})
Pow( @in, @c ).
-
- (Object) matrixprint(opts = {})
Print matrix.
-
- (Object) matrixsave(filename, opts = {})
Save image to matrix file.
-
- (Float) max(opts = {})
Find image maximum.
-
- (Real) maxpos
Return the coordinates of the image maximum.
-
- (Vips::Image) measure(h, v, opts = {})
Measure a set of patches on a colour chart.
-
- (Image) median(size = 3)
a median filter.
-
- (Vips::Image) merge(sec, direction, dx, dy, opts = {})
Merge two images.
-
- (Object) method_missing(name, *args)
Invoke a vips operation with call, using self as the first input image argument.
-
- (Float) min(opts = {})
Find image minimum.
-
- (Real) minpos
Return the coordinates of the image minimum.
-
- (Vips::Image) morph(mask, morph, opts = {})
Morphology operation.
-
- (Vips::Image) mosaic(sec, direction, xref, yref, xsec, ysec, opts = {})
Mosaic two images.
-
- (Vips::Image) mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {})
First-order mosaic of two images.
-
- (Vips::Image) msb(opts = {})
Pick most-significant byte from an image.
-
- (Vips::Image) multiply(right, opts = {})
Multiply two images.
-
- (Integer) percent(percent, opts = {})
Find threshold for percent of pixels.
-
- (Vips::Image) phasecor(in2, opts = {})
Calculate phase correlation.
-
- (Object) pngsave(filename, opts = {})
Save image to png file.
-
- (Vips::Blob) pngsave_buffer(opts = {})
Save image to png buffer.
-
- (Image) polar
Return an image with rectangular pixels converted to polar.
-
- (Object) ppmsave(filename, opts = {})
Save image to ppm file.
-
- (Vips::Image) premultiply(opts = {})
Premultiply image alpha.
-
- (Array<Vips::Image, Vips::Image>) profile(opts = {})
Find image profiles.
-
- (Array<Vips::Image, Vips::Image>) project(opts = {})
Find image projections.
-
- (Vips::Image) quadratic(coeff, opts = {})
Resample an image with a quadratic transform.
-
- (Vips::Image) rad2float(opts = {})
Unpack radiance coding to float rgb.
-
- (Object) radsave(filename, opts = {})
Save image to radiance file.
-
- (Vips::Image) rank(width, height, index, opts = {})
Rank filter.
-
- (Object) rawsave(filename, opts = {})
Save image to raw file.
-
- (Object) rawsave_fd(fd, opts = {})
Write raw image to file descriptor.
-
- (Image) real
Return the real part of a complex image.
-
- (Vips::Image) recomb(m, opts = {})
Linear recombination with matrix.
-
- (Image) rect
Return an image with polar pixels converted to rectangular.
-
- (Vips::Image) relational(right, relational, opts = {})
Relational operation on two images.
-
- (Vips::Image) relational_const(c, relational, opts = {})
Relational operations against a constant.
-
- (Vips::Image) remainder(right, opts = {})
Remainder after integer division of two images.
-
- (Vips::Image) remainder_const(c, opts = {})
Remainder after integer division of an image and a constant.
-
- (Vips::Image) replicate(across, down, opts = {})
Replicate an image.
-
- (Vips::Image) resize(scale, opts = {})
Resize an image.
-
- (Image) rint
Return the nearest integral value.
-
- (Vips::Image) rot(angle, opts = {})
Rotate an image.
-
- (Image) rot180
Rotate by 180 degrees clockwise.
-
- (Image) rot270
Rotate by 270 degrees clockwise.
-
- (Vips::Image) rot45(opts = {})
Rotate an image.
-
- (Image) rot90
Rotate by 90 degrees clockwise.
-
- (Vips::Image) round(round, opts = {})
Perform a round function on an image.
-
- (Vips::Image) scale(opts = {})
Scale an image to uchar.
-
- (Vips::Image) scRGB2BW(opts = {})
Convert scrgb to bw.
-
- (Vips::Image) scRGB2sRGB(opts = {})
Convert an scrgb image to srgb.
-
- (Vips::Image) scRGB2XYZ(opts = {})
Transform scrgb to xyz.
-
- (Vips::Image) sequential(opts = {})
Check sequential access.
-
- (Object) set(name, value)
Set a
GValue
on an image. -
- (Object) set_value(name, value)
Set a metadata item on an image.
-
- (Vips::Image) sharpen(opts = {})
Unsharp masking for print.
-
- (Vips::Image) shrink(xshrink, yshrink, opts = {})
Shrink an image.
-
- (Vips::Image) shrink2(xshrink, yshrink, opts = {})
Shrink an image.
-
- (Vips::Image) shrinkh(xshrink, opts = {})
Shrink an image horizontally.
-
- (Vips::Image) shrinkv(yshrink, opts = {})
Shrink an image vertically.
-
- (Vips::Image) sign(opts = {})
Unit vector of pixel.
-
- (Vips::Image) similarity(opts = {})
Similarity transform of an image.
-
- (Image) sin
Return the sine of an image in degrees.
-
- (Vips::Image) spcor(ref, opts = {})
Spatial correlation.
-
- (Vips::Image) spectrum(opts = {})
Make displayable power spectrum.
-
- (Vips::Image) sRGB2HSV(opts = {})
Transform srgb to hsv.
-
- (Vips::Image) sRGB2scRGB(opts = {})
Convert an srgb image to scrgb.
-
- (Vips::Image) stats(opts = {})
Find image average.
-
- (Vips::Image) stdif(width, height, opts = {})
Statistical difference.
-
- (Vips::Image) subsample(xfac, yfac, opts = {})
Subsample an image.
-
- (Vips::Image) subtract(right, opts = {})
Subtract two images.
-
- (Image) tan
Return the tangent of an image in degrees.
-
- (Object) tiffsave(filename, opts = {})
Save image to tiff file.
-
- (Vips::Image) tilecache(opts = {})
Cache an image as a set of tiles.
-
- (Vips::Image) unpremultiply(opts = {})
Unpremultiply image alpha.
-
- (Object) vipssave(filename, opts = {})
Save image to vips file.
-
- (Object) webpsave(filename, opts = {})
Save image to webp file.
-
- (Vips::Blob) webpsave_buffer(opts = {})
Save image to webp buffer.
-
- (Vips::Image) wrap(opts = {})
Wrap image origin.
-
- (String) write_to_buffer(format_string, opts = {})
Write this image to a memory buffer.
-
- (Object) write_to_file(name, opts = {})
Write this image to a file.
-
- (Vips::Image) XYZ2Lab(opts = {})
Transform xyz to lab.
-
- (Vips::Image) XYZ2scRGB(opts = {})
Transform xyz to scrgb.
-
- (Vips::Image) XYZ2Yxy(opts = {})
Transform xyz to yxy.
-
- (Vips::Image) Yxy2XYZ(opts = {})
Transform yxy to xyz.
-
- (Vips::Image) zoom(xfac, yfac, opts = {})
Zoom an image.
-
- (Image) |(other)
Integer bitwise OR with an image, constant or array.
-
- (Image) ~
Equivalent to image ^ -1.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(name, *args)
Invoke a vips operation with Vips.call, using self as the first input image argument.
306 307 308 |
# File 'lib/vips8/image.rb', line 306 def method_missing(name, *args) Vips::call_base(name.to_s, self, "", args) end |
Instance Attribute Details
- (Integer) bands (readonly)
Returns image bands
|
# File 'lib/vips8/image.rb', line 545
|
- (String) filename (readonly)
Returns image filename
|
# File 'lib/vips8/image.rb', line 545
|
- (Integer) height (readonly)
Returns image height, in pixels
|
# File 'lib/vips8/image.rb', line 545
|
- (Vips::Interpretation) interpretation (readonly)
Returns image interpretation
|
# File 'lib/vips8/image.rb', line 545
|
- (Integer) width (readonly)
Returns image width, in pixels
|
# File 'lib/vips8/image.rb', line 545
|
- (Float) xres (readonly)
Returns horizontal image resolution, in pixels per mm
|
# File 'lib/vips8/image.rb', line 545
|
- (Float) yres (readonly)
Returns vertical image resolution, in pixels per mm
|
# File 'lib/vips8/image.rb', line 545
|
Class Method Details
+ (Vips::Image) analyzeload(filename, opts = {})
Load an analyze6 image.
|
# File 'lib/vips8/methods.rb', line 847
|
+ (Vips::Image) black(width, height, opts = {})
Make a black image.
|
# File 'lib/vips8/methods.rb', line 536
|
+ (Vips::Image) csvload(filename, opts = {})
Load csv from file.
|
# File 'lib/vips8/methods.rb', line 825
|
+ (Vips::Image) eye(width, height, opts = {})
Make an image showing the eye's spatial response.
|
# File 'lib/vips8/methods.rb', line 592
|
+ (Vips::Image) fitsload(filename, opts = {})
Load a fits image.
|
# File 'lib/vips8/methods.rb', line 1001
|
+ (Vips::Image) fractsurf(width, height, fractal_dimension, opts = {})
Make a fractal surface.
|
# File 'lib/vips8/methods.rb', line 799
|
+ (Vips::Image) gaussmat(sigma, min_ampl, opts = {})
Make a gaussian image.
|
# File 'lib/vips8/methods.rb', line 574
|
+ (Vips::Image) gaussnoise(width, height, opts = {})
Make a gaussnoise image.
|
# File 'lib/vips8/methods.rb', line 544
|
+ (Vips::Image) grey(width, height, opts = {})
Make a grey ramp image.
|
# File 'lib/vips8/methods.rb', line 601
|
+ (Vips::Image) identity(opts = {})
Make a 1d image where pixel values are indexes.
|
# File 'lib/vips8/methods.rb', line 791
|
+ (Vips::Image) jpegload(filename, opts = {})
Load jpeg from file.
|
# File 'lib/vips8/methods.rb', line 905
|
+ (Vips::Image) jpegload_buffer(buffer, opts = {})
Load jpeg from buffer.
|
# File 'lib/vips8/methods.rb', line 917
|
+ (Vips::Image) logmat(sigma, min_ampl, opts = {})
Make a laplacian of gaussian image.
|
# File 'lib/vips8/methods.rb', line 583
|
+ (Vips::Image) magickload(filename, opts = {})
Load file with imagemagick.
|
# File 'lib/vips8/methods.rb', line 979
|
+ (Vips::Image) magickload_buffer(buffer, opts = {})
Load buffer with imagemagick.
|
# File 'lib/vips8/methods.rb', line 990
|
+ (Vips::Image) mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, opts = {})
Make a butterworth filter.
|
# File 'lib/vips8/methods.rb', line 666
|
+ (Vips::Image) mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {})
Make a butterworth_band filter.
|
# File 'lib/vips8/methods.rb', line 695
|
+ (Vips::Image) mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {})
Make a butterworth ring filter.
|
# File 'lib/vips8/methods.rb', line 680
|
+ (Vips::Image) mask_fractal(width, height, fractal_dimension, opts = {})
Make fractal filter.
|
# File 'lib/vips8/methods.rb', line 753
|
+ (Vips::Image) mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, opts = {})
Make a gaussian filter.
|
# File 'lib/vips8/methods.rb', line 711
|
+ (Vips::Image) mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {})
Make a gaussian filter.
|
# File 'lib/vips8/methods.rb', line 738
|
+ (Vips::Image) mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {})
Make a gaussian ring filter.
|
# File 'lib/vips8/methods.rb', line 724
|
+ (Vips::Image) mask_ideal(width, height, frequency_cutoff, opts = {})
Make an ideal filter.
|
# File 'lib/vips8/methods.rb', line 627
|
+ (Vips::Image) mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, opts = {})
Make an ideal band filter.
|
# File 'lib/vips8/methods.rb', line 652
|
+ (Vips::Image) mask_ideal_ring(width, height, frequency_cutoff, ringwidth, opts = {})
Make an ideal ring filter.
|
# File 'lib/vips8/methods.rb', line 639
|
+ (Vips::Image) matload(filename, opts = {})
Load mat from file.
|
# File 'lib/vips8/methods.rb', line 896
|
+ (Vips::Image) matrixload(filename, opts = {})
Load matrix from file.
|
# File 'lib/vips8/methods.rb', line 838
|
+ (Object) method_missing(name, *args)
Invoke a vips operation with Vips.call.
311 312 313 |
# File 'lib/vips8/image.rb', line 311 def self.method_missing(name, *args) Vips::call_base name.to_s, nil, "", args end |
+ (Image) new_from_array(array, scale = 1, offset = 0)
Create a new Image from a 1D or 2D array. A 1D array becomes an
image with height 1. Use scale
and offset
to set the scale and
offset fields in the header. These are useful for integer
convolutions.
For example:
image = Vips::new_from_array [1, 2, 3]
or
image = Vips::new_from_array [
[-1, -1, -1],
[-1, 16, -1],
[-1, -1, -1]], 8
for a simple sharpening mask.
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/vips8/image.rb', line 431 def self.new_from_array(array, scale = 1, offset = 0) # we accept a 1D array and assume height == 1, or a 2D array # and check all lines are the same length if not array.is_a? Array raise Vips::Error, "Argument is not an array." end if array[0].is_a? Array height = array.length width = array[0].length if not array.all? {|x| x.is_a? Array} raise Vips::Error, "Not a 2D array." end if not array.all? {|x| x.length == width} raise Vips::Error, "Array not rectangular." end array = array.flatten else height = 1 width = array.length end if not array.all? {|x| x.is_a? Numeric} raise Vips::Error, "Not all array elements are Numeric." end image = Vips::Image.matrix_from_array width, height, array if image == nil raise Vips::Error end # be careful to set them as double image.set_double 'scale', scale.to_f image.set_double 'offset', offset.to_f return image end |
+ (Image) new_from_buffer(data, option_string, opts = {})
Create a new Vips::Image for an image encoded in a format, such as JPEG, in a memory string. Load options may be passed encoded as strings, or appended as a hash. For example:
image = Vips::new_from_from_buffer memory_buffer, "shrink=2"
or alternatively:
image = Vips::new_from_from_buffer memory_buffer, "", :shrink => 2
The options available depend on the file format. Try something like:
$ vips jpegload_buffer
at the command-line to see the available options. Only JPEG, PNG and TIFF images can be read from memory buffers.
Loading is fast: only enough of the image is loaded to be able to fill out the header. Pixels will only be processed when they are needed.
396 397 398 399 400 401 402 403 |
# File 'lib/vips8/image.rb', line 396 def self.new_from_buffer(data, option_string, opts = {}) loader = Vips::Foreign.find_load_buffer data if loader == nil raise Vips::Error end Vips::call_base loader, nil, option_string, [data] + args end |
+ (Image) new_from_file(name, opts = {})
Return a new Vips::Image for a file on disc. This method can load images in any format supported by vips. The filename can include load options, for example:
image = Vips::new_from_file "fred.jpg[shrink=2]"
You can also supply options as a hash, for example:
image = Vips::new_from_file "fred.jpg", :shrink => 2
The full set of options available depend upon the load operation that will be executed. Try something like:
$ vips jpegload
at the command-line to see a summary of the available options.
Loading is fast: only enough of the image is loaded to be able to fill out the header. Pixels will only be processed when they are needed.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/vips8/image.rb', line 350 def self.new_from_file(name, opts = {}) # very common, and Vips::filename_get_filename will segv if we pass # this if name == nil raise Error, "filename is nil" end filename = Vips::filename_get_filename name option_string = Vips:: name loader = Vips::Foreign.find_load filename if loader == nil raise Vips::Error end Vips::call_base loader, nil, option_string, [filename, opts] end |
+ (Vips::Image) openexrload(filename, opts = {})
Load an openexr image.
|
# File 'lib/vips8/methods.rb', line 1010
|
+ (Vips::Image) openslideload(filename, opts = {})
Load file with openslide.
|
# File 'lib/vips8/methods.rb', line 967
|
+ (Vips::Image) pngload(filename, opts = {})
Load png from file.
|
# File 'lib/vips8/methods.rb', line 878
|
+ (Vips::Image) pngload_buffer(buffer, opts = {})
Load png from buffer.
|
# File 'lib/vips8/methods.rb', line 887
|
+ (Vips::Image) ppmload(filename, opts = {})
Load ppm from file.
|
# File 'lib/vips8/methods.rb', line 816
|
+ (Vips::Image) radload(filename, opts = {})
Load a radiance image from a file.
|
# File 'lib/vips8/methods.rb', line 807
|
+ (Vips::Image) rawload(filename, width, height, bands, opts = {})
Load raw data from a file.
|
# File 'lib/vips8/methods.rb', line 856
|
+ (Vips::Image) sines(width, height, opts = {})
Make a 2d sine wave.
|
# File 'lib/vips8/methods.rb', line 617
|
+ (Object) system(cmd_format, opts = {})
Run an external command.
|
# File 'lib/vips8/methods.rb', line 4
|
+ (Vips::Image) tiffload(filename, opts = {})
Load tiff from file.
|
# File 'lib/vips8/methods.rb', line 947
|
+ (Vips::Image) tiffload_buffer(buffer, opts = {})
Load tiff from buffer.
|
# File 'lib/vips8/methods.rb', line 957
|
+ (Vips::Image) vipsload(filename, opts = {})
Load vips from file.
|
# File 'lib/vips8/methods.rb', line 869
|
+ (Vips::Image) webpload(filename, opts = {})
Load webp from file.
|
# File 'lib/vips8/methods.rb', line 929
|
+ (Vips::Image) webpload_buffer(buffer, opts = {})
Load webp from buffer.
|
# File 'lib/vips8/methods.rb', line 938
|
+ (Vips::Image) xyz(width, height, opts = {})
Make an image where pixel values are coordinates.
|
# File 'lib/vips8/methods.rb', line 564
|
+ (Vips::Image) zone(width, height, opts = {})
Make a zone plate.
|
# File 'lib/vips8/methods.rb', line 609
|
Instance Method Details
- (Image) !
Equivalent to image ^ -1
741 742 743 |
# File 'lib/vips8/image.rb', line 741 def ! self ^ -1 end |
- (Image) !=(other)
Compare inequality to nil, an image, constant or array.
820 821 822 823 824 825 826 827 828 |
# File 'lib/vips8/image.rb', line 820 def !=(other) if other == nil true elsif other.is_a?(Vips::Image) relational(other, :noteq) else relational_const(other, :noteq) end end |
- (Image) %(other)
Remainder after integer division with an image, constant or array.
679 680 681 682 |
# File 'lib/vips8/image.rb', line 679 def %(other) other.is_a?(Vips::Image) ? remainder(other) : remainder_const(other) end |
- (Image) &(other)
Integer bitwise AND with an image, constant or array.
724 725 726 727 |
# File 'lib/vips8/image.rb', line 724 def &(other) other.is_a?(Vips::Image) ? boolean(other, :and) : boolean_const(other, :and) end |
- (Image) *(other)
Multiply an image, constant or array.
662 663 664 |
# File 'lib/vips8/image.rb', line 662 def *(other) other.is_a?(Vips::Image) ? multiply(other) : linear(other, 0) end |
- (Image) **(other)
Raise to power of an image, constant or array.
688 689 690 691 |
# File 'lib/vips8/image.rb', line 688 def **(other) other.is_a?(Vips::Image) ? math2(other, :pow) : math2_const(other, :pow) end |
- (Image) +(other)
Add an image, constant or array.
645 646 647 |
# File 'lib/vips8/image.rb', line 645 def +(other) other.is_a?(Vips::Image) ? add(other) : linear(1, other) end |
- (Image) -(other)
Subtract an image, constant or array.
653 654 655 656 |
# File 'lib/vips8/image.rb', line 653 def -(other) other.is_a?(Vips::Image) ? subtract(other) : linear(1, Image::smap(other) {|x| x * -1}) end |
- (Image) -@
Equivalent to image * -1
760 761 762 |
# File 'lib/vips8/image.rb', line 760 def -@ self * -1 end |
- (Image) /(other)
Divide an image, constant or array.
670 671 672 673 |
# File 'lib/vips8/image.rb', line 670 def /(other) other.is_a?(Vips::Image) ? divide(other) : linear(Image::smap(other) {|x| 1.0 / x}, 0) end |
- (Image) <(other)
Relational less than with an image, constant or array.
768 769 770 771 |
# File 'lib/vips8/image.rb', line 768 def <(other) other.is_a?(Vips::Image) ? relational(other, :less) : relational_const(other, :less) end |
- (Image) <<(other)
Integer left shift with an image, constant or array.
697 698 699 700 |
# File 'lib/vips8/image.rb', line 697 def <<(other) other.is_a?(Vips::Image) ? boolean(other, :lshift) : boolean_const(other, :lshift) end |
- (Image) <=(other)
Relational less than or equal to with an image, constant or array.
778 779 780 781 |
# File 'lib/vips8/image.rb', line 778 def <=(other) other.is_a?(Vips::Image) ? relational(other, :lesseq) : relational_const(other, :lesseq) end |
- (Image) ==(other)
Compare equality to nil, an image, constant or array.
806 807 808 809 810 811 812 813 814 |
# File 'lib/vips8/image.rb', line 806 def ==(other) if other == nil false elsif other.is_a?(Vips::Image) relational(other, :equal) else relational_const(other, :equal) end end |
- (Image) >(other)
Relational more than with an image, constant or array.
787 788 789 790 |
# File 'lib/vips8/image.rb', line 787 def >(other) other.is_a?(Vips::Image) ? relational(other, :more) : relational_const(other, :more) end |
- (Image) >=(other)
Relational more than or equal to with an image, constant or array.
797 798 799 800 |
# File 'lib/vips8/image.rb', line 797 def >=(other) other.is_a?(Vips::Image) ? relational(other, :moreeq) : relational_const(other, :moreeq) end |
- (Image) >>(other)
Integer right shift with an image, constant or array.
706 707 708 709 |
# File 'lib/vips8/image.rb', line 706 def >>(other) other.is_a?(Vips::Image) ? boolean(other, :rshift) : boolean_const(other, :rshift) end |
- (Image) [](index)
Fetch bands using a number or a range
834 835 836 837 838 839 840 841 842 843 844 |
# File 'lib/vips8/image.rb', line 834 def [](index) if index.is_a? Range n = index.end - index.begin n += 1 if not index.exclude_end? extract_band index.begin, :n => n elsif index.is_a? Numeric extract_band index else raise Vips::Error, "[] index is not range or numeric." end end |
- (Image) ^(other)
Integer bitwise EOR with an image, constant or array.
733 734 735 736 |
# File 'lib/vips8/image.rb', line 733 def ^(other) other.is_a?(Vips::Image) ? boolean(other, :eor) : boolean_const(other, :eor) end |
- (Image) acos
Return the inverse cosine of an image in degrees.
1034 1035 1036 |
# File 'lib/vips8/image.rb', line 1034 def acos math :acos end |
- (Vips::Image) affine(matrix, opts = {})
Affine transform of an image.
|
# File 'lib/vips8/methods.rb', line 1261
|
- (Image) asin
Return the inverse sine of an image in degrees.
1027 1028 1029 |
# File 'lib/vips8/image.rb', line 1027 def asin math :asin end |
- (Image) atan
Return the inverse tangent of an image in degrees.
1041 1042 1043 |
# File 'lib/vips8/image.rb', line 1041 def atan math :atan end |
- (Vips::Image) autorot(opts = {})
Autorotate image by exif tag.
|
# File 'lib/vips8/methods.rb', line 434
|
- (Float) avg(opts = {})
Find image average.
|
# File 'lib/vips8/methods.rb', line 159
|
- (Image) bandand
AND the bands of an image together
870 871 872 |
# File 'lib/vips8/image.rb', line 870 def bandand bandbool :and end |
- (Vips::Image) bandbool(boolean, opts = {})
Boolean operation across image bands.
|
# File 'lib/vips8/methods.rb', line 402
|
- (Image) bandeor
EOR the bands of an image together
884 885 886 |
# File 'lib/vips8/image.rb', line 884 def bandeor bandbool :eor end |
- (Vips::Image) bandfold(opts = {})
Fold up x axis into bands.
|
# File 'lib/vips8/methods.rb', line 446
|
- (Image) bandjoin(other)
Join a set of images bandwise.
899 900 901 902 903 904 905 |
# File 'lib/vips8/image.rb', line 899 def bandjoin(other) if not other.is_a? Array other = [other] end Vips::Image.bandjoin([self] + other) end |
- (Vips::Image) bandjoin_const(c, opts = {})
Append a constant band to an image.
|
# File 'lib/vips8/methods.rb', line 384
|
- (Image) bandor
OR the bands of an image together
877 878 879 |
# File 'lib/vips8/image.rb', line 877 def bandor bandbool :or end |
- (Array<Image>) bandsplit
Split an n-band image into n separate images.
891 892 893 |
# File 'lib/vips8/image.rb', line 891 def bandsplit (0...bands).map {|i| extract_band(i)} end |
- (Vips::Image) bandunfold(opts = {})
Unfold image bands into x axis.
|
# File 'lib/vips8/methods.rb', line 452
|
- (Vips::Image) boolean(right, boolean, opts = {})
Boolean operation on two images.
|
# File 'lib/vips8/methods.rb', line 52
|
- (Vips::Image) boolean_const(c, boolean, opts = {})
Boolean operations against a constant.
|
# File 'lib/vips8/methods.rb', line 133
|
- (Image) ceil
Return the smallest integral value not less than the argument.
856 857 858 |
# File 'lib/vips8/image.rb', line 856 def ceil round :ceil end |
- (Vips::Image) colourspace(space, opts = {})
Convert to a new colourspace.
|
# File 'lib/vips8/methods.rb', line 1295
|
- (Vips::Image) compass(mask, opts = {})
Convolve with rotating mask.
|
# File 'lib/vips8/methods.rb', line 1550
|
- (Vips::Image) complex(cmplx, opts = {})
Perform a complex operation on an image.
|
# File 'lib/vips8/methods.rb', line 147
|
- (Vips::Image) complex2(right, cmplx, opts = {})
Complex binary operations on two images.
|
# File 'lib/vips8/methods.rb', line 66
|
- (Vips::Image) complexform(right, opts = {})
Form a complex image from two real images.
|
# File 'lib/vips8/methods.rb', line 73
|
- (Vips::Image) complexget(get, opts = {})
Get a component from a complex image.
|
# File 'lib/vips8/methods.rb', line 153
|
- (Image) conj
Return the complex conjugate of an image.
The image can be complex, in which case the return image will also be complex, or must have an even number of bands, in which case pairs of bands are treated as (x, y) coordinates.
999 1000 1001 |
# File 'lib/vips8/image.rb', line 999 def conj Image::run_cmplx(self) {|x| x.complex :conj} end |
- (Vips::Image) conv(mask, opts = {})
Convolution operation.
|
# File 'lib/vips8/methods.rb', line 1541
|
- (Vips::Image) convsep(mask, opts = {})
Seperable convolution operation.
|
# File 'lib/vips8/methods.rb', line 1562
|
- (Image) cos
Return the cosine of an image in degrees.
1013 1014 1015 |
# File 'lib/vips8/image.rb', line 1013 def cos math :cos end |
- (Float) countlines(direction, opts = {})
Count lines in an image.
|
# File 'lib/vips8/methods.rb', line 1645
|
- (Object) csvsave(filename, opts = {})
Save image to csv file.
|
# File 'lib/vips8/methods.rb', line 1037
|
- (Float) deviate(opts = {})
Find image standard deviation.
|
# File 'lib/vips8/methods.rb', line 186
|
- (Image) dilate(mask)
Dilate with a structuring element.
The structuring element must be an array with 0 for black, 255 for white and 128 for don't care.
1107 1108 1109 |
# File 'lib/vips8/image.rb', line 1107 def dilate(mask) morph mask, :dilate end |
- (Vips::Image) draw_circle(ink, cx, cy, radius, opts = {})
Draw a circle on an image.
|
# File 'lib/vips8/methods.rb', line 1687
|
- (Vips::Image) draw_flood(ink, x, y, opts = {})
Flood-fill an area.
|
# File 'lib/vips8/methods.rb', line 1697
|
- (Vips::Image) draw_image(sub, x, y, opts = {})
Paint an image into another image.
|
# File 'lib/vips8/methods.rb', line 1711
|
- (Vips::Image) draw_line(ink, x1, y1, x2, y2, opts = {})
Draw a line on an image.
|
# File 'lib/vips8/methods.rb', line 1677
|
- (Vips::Image) draw_mask(ink, mask, x, y, opts = {})
Draw a mask on an image.
|
# File 'lib/vips8/methods.rb', line 1668
|
- (Vips::Image) draw_rect(ink, left, top, width, height, opts = {})
Paint a rectangle on an image.
|
# File 'lib/vips8/methods.rb', line 1657
|
- (Vips::Image) draw_smudge(left, top, width, height, opts = {})
Blur a rectangle on an image.
|
# File 'lib/vips8/methods.rb', line 1720
|
- (Object) dzsave(filename, opts = {})
Save image to deep zoom format.
|
# File 'lib/vips8/methods.rb', line 1085
|
- (Vips::Image) embed(x, y, width, height, opts = {})
Embed an image in a larger image.
|
# File 'lib/vips8/methods.rb', line 308
|
- (Image) erode(mask)
Erode with a structuring element.
The structuring element must be an array with 0 for black, 255 for white and 128 for don't care.
1095 1096 1097 |
# File 'lib/vips8/image.rb', line 1095 def erode(mask) morph mask, :erode end |
- (Image) exp
Return e ** pixel.
1062 1063 1064 |
# File 'lib/vips8/image.rb', line 1062 def exp math :exp end |
- (Image) exp10
Return 10 ** pixel.
1069 1070 1071 |
# File 'lib/vips8/image.rb', line 1069 def exp10 math :exp10 end |
- (Vips::Image) extract_area(left, top, width, height, opts = {})
Extract an area from an image.
|
# File 'lib/vips8/methods.rb', line 359
|
- (Vips::Image) extract_band(band, opts = {})
Extract band from an image.
|
# File 'lib/vips8/methods.rb', line 377
|
- (Vips::Image) falsecolour(opts = {})
False-colour an image.
|
# File 'lib/vips8/methods.rb', line 525
|
- (Object) fitssave(filename, opts = {})
Save image to fits file.
|
# File 'lib/vips8/methods.rb', line 1213
|
- (Vips::Image) flatten(opts = {})
Flatten alpha out of an image.
|
# File 'lib/vips8/methods.rb', line 458
|
- (Image) fliphor
Flip horizontally.
1076 1077 1078 |
# File 'lib/vips8/image.rb', line 1076 def fliphor flip :horizontal end |
- (Image) flipver
Flip vertically.
1083 1084 1085 |
# File 'lib/vips8/image.rb', line 1083 def flipver flip :vertical end |
- (Vips::Image) float2rad(opts = {})
Transform float rgb to radiance coding.
|
# File 'lib/vips8/methods.rb', line 1389
|
- (Image) floor
Return the largest integral value not greater than the argument.
849 850 851 |
# File 'lib/vips8/image.rb', line 849 def floor round :floor end |
- (Vips::Image) freqmult(mask, opts = {})
Frequency-domain filtering.
|
# File 'lib/vips8/methods.rb', line 1613
|
- (GValue) get(name)
Fetch a GValue
from an image
|
# File 'lib/vips8/image.rb', line 571
|
- (void) get_value(name)
This method returns an undefined value.
Get a metadata item from an image. Ruby types are constructed
automatically from the GValue
, if possible.
For example, you can read the ICC profile from an image like this:
profile = image.get_value "icc-profile-data"
and profile will be an array containing the profile.
631 632 633 634 635 636 637 638 639 |
# File 'lib/vips8/image.rb', line 631 def get_value(name) ret, gval = get name if ret[0] != 0 raise Vips::Error, "Field #{name} not found." end value = gval.value Argument::unwrap(value) end |
- (Array<Double>) getpoint(x, y, opts = {})
Read a point from an image.
934 935 936 937 938 939 940 941 |
# File 'lib/vips8/image.rb', line 934 def getpoint(x, y) # vips has an operation that does this, but we can't call it via # gobject-introspection 3.0.7 since it's missing array double # returns # # remove this def when gobject-introspection updates crop(x, y, 1, 1).bandsplit.map {|i| i.avg} end |
- (Vips::Image) globalbalance(opts = {})
Global balance an image mosaic.
|
# File 'lib/vips8/methods.rb', line 1806
|
- (Vips::Image) grid(tile_height, across, down, opts = {})
Grid an image.
|
# File 'lib/vips8/methods.rb', line 477
|
- (Vips::Image) hist_cum(opts = {})
Form cumulative histogram.
|
# File 'lib/vips8/methods.rb', line 1497
|
- (Float) hist_entropy(opts = {})
Estimate image entropy.
|
# File 'lib/vips8/methods.rb', line 1536
|
- (Vips::Image) hist_equal(opts = {})
Histogram equalisation.
|
# File 'lib/vips8/methods.rb', line 1513
|
- (Vips::Image) hist_find_indexed(index, opts = {})
Find indexed image histogram.
|
# File 'lib/vips8/methods.rb', line 208
|
- (Vips::Image) hist_find_ndim(opts = {})
Find n-dimensional image histogram.
|
# File 'lib/vips8/methods.rb', line 202
|
- (Boolean) hist_ismonotonic(opts = {})
Test for monotonicity.
|
# File 'lib/vips8/methods.rb', line 1531
|
- (Vips::Image) hist_local(width, height, opts = {})
Local histogram equalisation.
|
# File 'lib/vips8/methods.rb', line 1524
|
- (Vips::Image) hist_match(ref, opts = {})
Match two histograms.
|
# File 'lib/vips8/methods.rb', line 1502
|
- (Vips::Image) hough_circle(opts = {})
Find hough circle transform.
|
# File 'lib/vips8/methods.rb', line 221
|
- (Vips::Image) hough_line(opts = {})
Find hough line transform.
|
# File 'lib/vips8/methods.rb', line 214
|
- (Vips::Image) icc_export(opts = {})
Output to device with icc profile.
|
# File 'lib/vips8/methods.rb', line 1418
|
- (Vips::Image) icc_import(opts = {})
Import from device with icc profile.
|
# File 'lib/vips8/methods.rb', line 1409
|
- (Vips::Image) icc_transform(output_profile, opts = {})
Transform between devices with icc profiles.
|
# File 'lib/vips8/methods.rb', line 1427
|
- (Image) ifthenelse(th, el, opts = {})
Select pixels from th
if self
is non-zero and from el
if
self
is zero. Use the :blend
option to fade smoothly
between th
and el
.
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 |
# File 'lib/vips8/image.rb', line 1141 def ifthenelse(th, el, opts = {}) match_image = [th, el, self].find {|x| x.is_a? Vips::Image} if not th.is_a? Vips::Image th = Argument::imageize match_image, th end if not el.is_a? Vips::Image el = Argument::imageize match_image, el end Vips::call_base "ifthenelse", self, "", [th, el] + args end |
- (Image) imag
Return the imaginary part of a complex image.
961 962 963 |
# File 'lib/vips8/image.rb', line 961 def imag complexget :imag end |
- (Vips::Image) insert(sub, x, y, opts = {})
Insert image @sub into @main at @x, @y.
|
# File 'lib/vips8/methods.rb', line 325
|
- (Vips::Image) invertlut(opts = {})
Build an inverted look-up table.
|
# File 'lib/vips8/methods.rb', line 770
|
- (Vips::Image) join(in2, direction, opts = {})
Join a pair of images.
|
# File 'lib/vips8/methods.rb', line 335
|
- (Object) jpegsave(filename, opts = {})
Save image to jpeg file.
|
# File 'lib/vips8/methods.rb', line 1125
|
- (Vips::Blob) jpegsave_buffer(opts = {})
Save image to jpeg buffer.
|
# File 'lib/vips8/methods.rb', line 1141
|
- (Object) jpegsave_mime(opts = {})
Save image to jpeg mime.
|
# File 'lib/vips8/methods.rb', line 1156
|
- (Vips::Image) Lab2LabQ(opts = {})
Transform float lab to labq coding.
|
# File 'lib/vips8/methods.rb', line 1359
|
- (Vips::Image) Lab2LabS(opts = {})
Transform float lab to signed short.
|
# File 'lib/vips8/methods.rb', line 1379
|
- (Vips::Image) Lab2XYZ(opts = {})
Transform cielab to xyz.
|
# File 'lib/vips8/methods.rb', line 1302
|
- (Vips::Image) labelregions(opts = {})
Label regions in an image.
|
# File 'lib/vips8/methods.rb', line 1651
|
- (Vips::Image) LabQ2Lab(opts = {})
Unpack a labq image to float lab.
|
# File 'lib/vips8/methods.rb', line 1354
|
- (Vips::Image) LabQ2LabS(opts = {})
Unpack a labq image to short lab.
|
# File 'lib/vips8/methods.rb', line 1364
|
- (Vips::Image) LabQ2sRGB(opts = {})
Convert a labq image to srgb.
|
# File 'lib/vips8/methods.rb', line 1394
|
- (Vips::Image) LabS2Lab(opts = {})
Transform signed short lab to float.
|
# File 'lib/vips8/methods.rb', line 1374
|
- (Vips::Image) LabS2LabQ(opts = {})
Transform short lab to labq coding.
|
# File 'lib/vips8/methods.rb', line 1369
|
- (Vips::Image) linear(a, b, opts = {})
Calculate (a * in + b).
|
# File 'lib/vips8/methods.rb', line 90
|
- (Vips::Image) linecache(opts = {})
Cache an image as a set of lines.
|
# File 'lib/vips8/methods.rb', line 283
|
- (Image) log
Return the natural log of an image.
1048 1049 1050 |
# File 'lib/vips8/image.rb', line 1048 def log math :log end |
- (Image) log10
Return the log base 10 of an image.
1055 1056 1057 |
# File 'lib/vips8/image.rb', line 1055 def log10 math :log10 end |
- (Vips::Image) mapim(index, opts = {})
Resample with an mapim image.
|
# File 'lib/vips8/methods.rb', line 1221
|
- (Vips::Image) maplut(lut, opts = {})
Map an image though a lut.
|
# File 'lib/vips8/methods.rb', line 1473
|
- (Vips::Image) match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {})
First-order match of two images.
|
# File 'lib/vips8/methods.rb', line 1781
|
- (Vips::Image) math(math, opts = {})
Apply a math operation to an image.
|
# File 'lib/vips8/methods.rb', line 98
|
- (Vips::Image) math2(right, math2, opts = {})
Binary math operations.
|
# File 'lib/vips8/methods.rb', line 59
|
- (Vips::Image) math2_const(c, math2, opts = {})
Pow( @in, @c ).
|
# File 'lib/vips8/methods.rb', line 140
|
- (Object) matrixprint(opts = {})
Print matrix.
|
# File 'lib/vips8/methods.rb', line 1054
|
- (Object) matrixsave(filename, opts = {})
Save image to matrix file.
|
# File 'lib/vips8/methods.rb', line 1046
|
- (Float) max(opts = {})
Find image maximum.
|
# File 'lib/vips8/methods.rb', line 175
|
- (Real) maxpos
Return the coordinates of the image maximum.
911 912 913 914 915 916 |
# File 'lib/vips8/image.rb', line 911 def maxpos v, opts = max :x => true, :y => true x = opts['x'] y = opts['y'] return v, x, y end |
- (Vips::Image) measure(h, v, opts = {})
Measure a set of patches on a colour chart.
|
# File 'lib/vips8/methods.rb', line 239
|
- (Image) median(size = 3)
a median filter
947 948 949 |
# File 'lib/vips8/image.rb', line 947 def median(size = 3) rank(size, size, (size * size) / 2) end |
- (Vips::Image) merge(sec, direction, dx, dy, opts = {})
Merge two images.
|
# File 'lib/vips8/methods.rb', line 1729
|
- (Float) min(opts = {})
Find image minimum.
|
# File 'lib/vips8/methods.rb', line 164
|
- (Real) minpos
Return the coordinates of the image minimum.
922 923 924 925 926 927 |
# File 'lib/vips8/image.rb', line 922 def minpos v, opts = min :x => true, :y => true x = opts['x'] y = opts['y'] return v, x, y end |
- (Vips::Image) morph(mask, morph, opts = {})
Morphology operation.
|
# File 'lib/vips8/methods.rb', line 1630
|
- (Vips::Image) mosaic(sec, direction, xref, yref, xsec, ysec, opts = {})
Mosaic two images.
|
# File 'lib/vips8/methods.rb', line 1739
|
- (Vips::Image) mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {})
First-order mosaic of two images.
|
# File 'lib/vips8/methods.rb', line 1760
|
- (Vips::Image) msb(opts = {})
Pick most-significant byte from an image.
|
# File 'lib/vips8/methods.rb', line 514
|
- (Vips::Image) multiply(right, opts = {})
Multiply two images.
|
# File 'lib/vips8/methods.rb', line 27
|
- (Integer) percent(percent, opts = {})
Find threshold for percent of pixels.
|
# File 'lib/vips8/methods.rb', line 1480
|
- (Vips::Image) phasecor(in2, opts = {})
Calculate phase correlation.
|
# File 'lib/vips8/methods.rb', line 1624
|
- (Object) pngsave(filename, opts = {})
Save image to png file.
|
# File 'lib/vips8/methods.rb', line 1102
|
- (Vips::Blob) pngsave_buffer(opts = {})
Save image to png buffer.
|
# File 'lib/vips8/methods.rb', line 1114
|
- (Image) polar
Return an image with rectangular pixels converted to polar.
The image can be complex, in which case the return image will also be complex, or must have an even number of bands, in which case pairs of bands are treated as (x, y) coordinates.
974 975 976 |
# File 'lib/vips8/image.rb', line 974 def polar Image::run_cmplx(self) {|x| x.complex :polar} end |
- (Object) ppmsave(filename, opts = {})
Save image to ppm file.
|
# File 'lib/vips8/methods.rb', line 1027
|
- (Vips::Image) premultiply(opts = {})
Premultiply image alpha.
|
# File 'lib/vips8/methods.rb', line 465
|
- (Array<Vips::Image, Vips::Image>) profile(opts = {})
Find image profiles.
|
# File 'lib/vips8/methods.rb', line 234
|
- (Array<Vips::Image, Vips::Image>) project(opts = {})
Find image projections.
|
# File 'lib/vips8/methods.rb', line 229
|
- (Vips::Image) quadratic(coeff, opts = {})
Resample an image with a quadratic transform.
|
# File 'lib/vips8/methods.rb', line 1254
|
- (Vips::Image) rad2float(opts = {})
Unpack radiance coding to float rgb.
|
# File 'lib/vips8/methods.rb', line 1384
|
- (Object) radsave(filename, opts = {})
Save image to radiance file.
|
# File 'lib/vips8/methods.rb', line 1019
|
- (Vips::Image) rank(width, height, index, opts = {})
Rank filter.
|
# File 'lib/vips8/methods.rb', line 1637
|
- (Object) rawsave(filename, opts = {})
Save image to raw file.
|
# File 'lib/vips8/methods.rb', line 1061
|
- (Object) rawsave_fd(fd, opts = {})
Write raw image to file descriptor.
|
# File 'lib/vips8/methods.rb', line 1069
|
- (Image) real
Return the real part of a complex image.
954 955 956 |
# File 'lib/vips8/image.rb', line 954 def real complexget :real end |
- (Vips::Image) recomb(m, opts = {})
Linear recombination with matrix.
|
# File 'lib/vips8/methods.rb', line 440
|
- (Image) rect
Return an image with polar pixels converted to rectangular.
The image can be complex, in which case the return image will also be complex, or must have an even number of bands, in which case pairs of bands are treated as (x, y) coordinates.
987 988 989 |
# File 'lib/vips8/image.rb', line 987 def rect Image::run_cmplx(self) {|x| x.complex :rect} end |
- (Vips::Image) relational(right, relational, opts = {})
Relational operation on two images.
|
# File 'lib/vips8/methods.rb', line 39
|
- (Vips::Image) relational_const(c, relational, opts = {})
Relational operations against a constant.
|
# File 'lib/vips8/methods.rb', line 120
|
- (Vips::Image) remainder(right, opts = {})
Remainder after integer division of two images.
|
# File 'lib/vips8/methods.rb', line 46
|
- (Vips::Image) remainder_const(c, opts = {})
Remainder after integer division of an image and a constant.
|
# File 'lib/vips8/methods.rb', line 127
|
- (Vips::Image) replicate(across, down, opts = {})
Replicate an image.
|
# File 'lib/vips8/methods.rb', line 408
|
- (Image) rint
Return the nearest integral value.
863 864 865 |
# File 'lib/vips8/image.rb', line 863 def rint round :rint end |
- (Image) rot180
Rotate by 180 degrees clockwise.
1121 1122 1123 |
# File 'lib/vips8/image.rb', line 1121 def rot180 rot :d180 end |
- (Image) rot270
Rotate by 270 degrees clockwise.
1128 1129 1130 |
# File 'lib/vips8/image.rb', line 1128 def rot270 rot :d270 end |
- (Image) rot90
Rotate by 90 degrees clockwise.
1114 1115 1116 |
# File 'lib/vips8/image.rb', line 1114 def rot90 rot :d90 end |
- (Vips::Image) round(round, opts = {})
Perform a round function on an image.
|
# File 'lib/vips8/methods.rb', line 114
|
- (Vips::Image) scRGB2sRGB(opts = {})
Convert an scrgb image to srgb.
|
# File 'lib/vips8/methods.rb', line 1467
|
- (Vips::Image) scRGB2XYZ(opts = {})
Transform scrgb to xyz.
|
# File 'lib/vips8/methods.rb', line 1344
|
- (Vips::Image) sequential(opts = {})
Check sequential access.
|
# File 'lib/vips8/methods.rb', line 292
|
- (Object) set(name, value)
Set a GValue
on an image
|
# File 'lib/vips8/image.rb', line 564
|
- (Object) set_value(name, value)
Set a metadata item on an image. Ruby types are automatically
transformed into the matching GValue
, if possible.
For example, you can use this to set an image's ICC profile:
x = y.set_value "icc-profile-data", profile
where profile
is an ICC profile held as a binary string object.
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 |
# File 'lib/vips8/image.rb', line 592 def set_value(name, value) gtype = get_typeof name if gtype != 0 # array-ize value = Argument::arrayize gtype, value # blob-ize if gtype.type_is_a? GLib::Type["VipsBlob"] if not value.is_a? Vips::Blob value = Vips::Blob.copy value end end # image-ize if gtype.type_is_a? GLib::Type["VipsImage"] if not value.is_a? Vips::Image value = imageize match_image, value end end end set name, value end |
- (Vips::Image) sharpen(opts = {})
Unsharp masking for print.
|
# File 'lib/vips8/methods.rb', line 1583
|
- (Vips::Image) shrink(xshrink, yshrink, opts = {})
Shrink an image.
|
# File 'lib/vips8/methods.rb', line 1228
|
- (Vips::Image) shrink2(xshrink, yshrink, opts = {})
Shrink an image.
|
# File 'lib/vips8/methods.rb', line 1247
|
- (Vips::Image) shrinkh(xshrink, opts = {})
Shrink an image horizontally.
|
# File 'lib/vips8/methods.rb', line 1235
|
- (Vips::Image) shrinkv(yshrink, opts = {})
Shrink an image vertically.
|
# File 'lib/vips8/methods.rb', line 1241
|
- (Vips::Image) similarity(opts = {})
Similarity transform of an image.
|
# File 'lib/vips8/methods.rb', line 1273
|
- (Image) sin
Return the sine of an image in degrees.
1006 1007 1008 |
# File 'lib/vips8/image.rb', line 1006 def sin math :sin end |
- (Vips::Image) spectrum(opts = {})
Make displayable power spectrum.
|
# File 'lib/vips8/methods.rb', line 1619
|
- (Vips::Image) sRGB2scRGB(opts = {})
Convert an srgb image to scrgb.
|
# File 'lib/vips8/methods.rb', line 1456
|
- (Vips::Image) stdif(width, height, opts = {})
Statistical difference.
|
# File 'lib/vips8/methods.rb', line 1486
|
- (Vips::Image) subsample(xfac, yfac, opts = {})
Subsample an image.
|
# File 'lib/vips8/methods.rb', line 506
|
- (Vips::Image) subtract(right, opts = {})
Subtract two images.
|
# File 'lib/vips8/methods.rb', line 21
|
- (Image) tan
Return the tangent of an image in degrees.
1020 1021 1022 |
# File 'lib/vips8/image.rb', line 1020 def tan math :tan end |
- (Object) tiffsave(filename, opts = {})
Save image to tiff file.
|
# File 'lib/vips8/methods.rb', line 1190
|
- (Vips::Image) tilecache(opts = {})
Cache an image as a set of tiles.
|
# File 'lib/vips8/methods.rb', line 272
|
- (Vips::Image) unpremultiply(opts = {})
Unpremultiply image alpha.
|
# File 'lib/vips8/methods.rb', line 471
|
- (Object) vipssave(filename, opts = {})
Save image to vips file.
|
# File 'lib/vips8/methods.rb', line 1077
|
- (Object) webpsave(filename, opts = {})
Save image to webp file.
|
# File 'lib/vips8/methods.rb', line 1171
|
- (Vips::Blob) webpsave_buffer(opts = {})
Save image to webp buffer.
|
# File 'lib/vips8/methods.rb', line 1181
|
- (String) write_to_buffer(format_string, opts = {})
Write this image to a memory buffer. Save options may be encoded in the format_string or given as a hash. For example:
buffer = image.write_to_buffer ".jpg[Q=90]"
or equivalently:
image.write_to_buffer ".jpg", :Q => 90
The full set of save options depend on the selected saver. Try something like:
$ vips jpegsave
to see all the available options.
534 535 536 537 538 539 540 541 542 543 |
# File 'lib/vips8/image.rb', line 534 def write_to_buffer(format_string, opts = {}) filename = Vips::filename_get_filename format_string option_string = Vips:: format_string saver = Vips::Foreign.find_save_buffer filename if saver == nil raise Vips::Error, "No known saver for '#{filename}'." end Vips::call_base saver, self, option_string, [opts] end |
- (Object) write_to_file(name, opts = {})
Write this image to a file. Save options may be encoded in the filename or given as a hash. For example:
image.write_to_file "fred.jpg[Q=90]"
or equivalently:
image.write_to_file "fred.jpg", :Q => 90
The full set of save options depend on the selected saver. Try something like:
$ vips jpegsave
to see all the available options.
498 499 500 501 502 503 504 505 506 507 |
# File 'lib/vips8/image.rb', line 498 def write_to_file(name, opts = {}) filename = Vips::filename_get_filename name option_string = Vips:: name saver = Vips::Foreign.find_save filename if saver == nil raise Vips::Error, "No known saver for '#{filename}'." end Vips::call_base saver, self, option_string, [filename, opts] end |
- (Vips::Image) XYZ2scRGB(opts = {})
Transform xyz to scrgb.
|
# File 'lib/vips8/methods.rb', line 1349
|
- (Image) |(other)
Integer bitwise OR with an image, constant or array.
715 716 717 718 |
# File 'lib/vips8/image.rb', line 715 def |(other) other.is_a?(Vips::Image) ? boolean(other, :or) : boolean_const(other, :or) end |
- (Image) ~
Equivalent to image ^ -1
748 749 750 |
# File 'lib/vips8/image.rb', line 748 def ~ self ^ -1 end |