Class: Vips::Image
- Inherits:
-
Object
- Object
- Vips::Image
- Defined in:
- lib/vips8/image.rb,
lib/vips8/methods.rb more...
Overview
This class represents a libvips image. See the Vips module documentation for an introduction to using this module.
Instance Attribute Summary collapse
-
#bands ⇒ Integer
readonly
Image bands.
-
#coding ⇒ Vips::Coding
readonly
Image coding.
-
#filename ⇒ String
readonly
Image filename.
-
#format ⇒ Vips::BandFormat
readonly
Image format.
-
#height ⇒ Integer
readonly
Image height, in pixels.
-
#interpretation ⇒ Vips::Interpretation
readonly
Image interpretation.
-
#width ⇒ Integer
readonly
Image width, in pixels.
-
#xres ⇒ Float
readonly
Horizontal image resolution, in pixels per mm.
-
#yres ⇒ Float
readonly
Vertical image resolution, in pixels per mm.
Class Method Summary collapse
-
.analyzeload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load an analyze6 image.
-
.arrayjoin ⇒ Vips::Image
Join an array of images.
-
.bandrank ⇒ Vips::Image
Band-wise rank of a set of images.
-
.black(width, height, opts = {}) ⇒ Vips::Image
Make a black image.
-
.csvload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load csv from file.
-
.eye(width, height, opts = {}) ⇒ Vips::Image
Make an image showing the eye's spatial response.
-
.fitsload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load a fits image.
-
.fractsurf(width, height, fractal_dimension, opts = {}) ⇒ Vips::Image
Make a fractal surface.
-
.gaussmat(sigma, min_ampl, opts = {}) ⇒ Vips::Image
Make a gaussian image.
-
.gaussnoise(width, height, opts = {}) ⇒ Vips::Image
Make a gaussnoise image.
-
.grey(width, height, opts = {}) ⇒ Vips::Image
Make a grey ramp image.
-
.identity(opts = {}) ⇒ Vips::Image
Make a 1d image where pixel values are indexes.
-
.jpegload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load jpeg from file.
-
.jpegload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load jpeg from buffer.
-
.logmat(sigma, min_ampl, opts = {}) ⇒ Vips::Image
Make a laplacian of gaussian image.
-
.magickload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load file with imagemagick.
-
.magickload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load buffer with imagemagick.
-
.mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a butterworth filter.
-
.mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a butterworth_band filter.
-
.mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {}) ⇒ Vips::Image
Make a butterworth ring filter.
-
.mask_fractal(width, height, fractal_dimension, opts = {}) ⇒ Vips::Image
Make fractal filter.
-
.mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a gaussian filter.
-
.mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a gaussian filter.
-
.mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {}) ⇒ Vips::Image
Make a gaussian ring filter.
-
.mask_ideal(width, height, frequency_cutoff, opts = {}) ⇒ Vips::Image
Make an ideal filter.
-
.mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, opts = {}) ⇒ Vips::Image
Make an ideal band filter.
-
.mask_ideal_ring(width, height, frequency_cutoff, ringwidth, opts = {}) ⇒ Vips::Image
Make an ideal ring filter.
-
.matload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load mat from file.
-
.matrixload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load matrix from file.
-
.method_missing(name, *args) ⇒ Object
Invoke a vips operation with call.
-
.new_from_array(array, scale = 1, offset = 0) ⇒ Image
Create a new Image from a 1D or 2D array.
-
.new_from_buffer(data, option_string, opts = {}) ⇒ Image
Create a new Image for an image encoded in a format, such as JPEG, in a memory string.
-
.new_from_file(name, opts = {}) ⇒ Image
Return a new Image for a file on disc.
-
.openexrload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load an openexr image.
-
.openslideload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load file with openslide.
-
.pngload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load png from file.
-
.pngload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load png from buffer.
-
.ppmload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load ppm from file.
-
.radload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load a radiance image from a file.
-
.rawload(filename, width, height, bands, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load raw data from a file.
-
.sines(width, height, opts = {}) ⇒ Vips::Image
Make a 2d sine wave.
-
.sum ⇒ Vips::Image
Sum an array of images.
-
.system(cmd_format, opts = {}) ⇒ nil, Hash<Symbol => Object>
Run an external command.
-
.text(text, opts = {}) ⇒ Vips::Image
Make a text image.
-
.tiffload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load tiff from file.
-
.tiffload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load tiff from buffer.
-
.tonelut(opts = {}) ⇒ Vips::Image
Build a look-up table.
-
.vipsload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load vips from file.
-
.webpload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load webp from file.
-
.webpload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load webp from buffer.
-
.xyz(width, height, opts = {}) ⇒ Vips::Image
Make an image where pixel values are coordinates.
-
.zone(width, height, opts = {}) ⇒ Vips::Image
Make a zone plate.
Instance Method Summary collapse
-
#! ⇒ Image
Equivalent to image ^ -1.
-
#!=(other) ⇒ Image
Compare inequality to nil, an image, constant or array.
-
#%(other) ⇒ Image
Remainder after integer division with an image, constant or array.
-
#&(other) ⇒ Image
Integer bitwise AND with an image, constant or array.
-
#*(other) ⇒ Image
Multiply an image, constant or array.
-
#**(other) ⇒ Image
Raise to power of an image, constant or array.
-
#+(other) ⇒ Image
Add an image, constant or array.
-
#+@ ⇒ Image
Image.
-
#-(other) ⇒ Image
Subtract an image, constant or array.
-
#-@ ⇒ Image
Equivalent to image * -1.
-
#/(other) ⇒ Image
Divide an image, constant or array.
-
#<(other) ⇒ Image
Relational less than with an image, constant or array.
-
#<<(other) ⇒ Image
Integer left shift with an image, constant or array.
-
#<=(other) ⇒ Image
Relational less than or equal to with an image, constant or array.
-
#==(other) ⇒ Image
Compare equality to nil, an image, constant or array.
-
#>(other) ⇒ Image
Relational more than with an image, constant or array.
-
#>=(other) ⇒ Image
Relational more than or equal to with an image, constant or array.
-
#>>(other) ⇒ Image
Integer right shift with an image, constant or array.
-
#[](index) ⇒ Image
Fetch bands using a number or a range.
-
#^(other) ⇒ Image
Integer bitwise EOR with an image, constant or array.
-
#abs(opts = {}) ⇒ Vips::Image
Absolute value of an image.
-
#acos ⇒ Image
Return the inverse cosine of an image in degrees.
-
#add(right, opts = {}) ⇒ Vips::Image
Add two images.
-
#affine(matrix, opts = {}) ⇒ Vips::Image
Affine transform of an image.
-
#asin ⇒ Image
Return the inverse sine of an image in degrees.
-
#atan ⇒ Image
Return the inverse tangent of an image in degrees.
-
#autorot(opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Autorotate image by exif tag.
-
#avg(opts = {}) ⇒ Float
Find image average.
-
#bandand ⇒ Image
AND the bands of an image together.
-
#bandbool(boolean, opts = {}) ⇒ Vips::Image
Boolean operation across image bands.
-
#bandeor ⇒ Image
EOR the bands of an image together.
-
#bandfold(opts = {}) ⇒ Vips::Image
Fold up x axis into bands.
-
#bandjoin(other) ⇒ Image
Join a set of images bandwise.
-
#bandjoin_const(c, opts = {}) ⇒ Vips::Image
Append a constant band to an image.
-
#bandmean(opts = {}) ⇒ Vips::Image
Band-wise average.
-
#bandor ⇒ Image
OR the bands of an image together.
-
#bandsplit ⇒ Array<Image>
Split an n-band image into n separate images.
-
#bandunfold(opts = {}) ⇒ Vips::Image
Unfold image bands into x axis.
-
#boolean(right, boolean, opts = {}) ⇒ Vips::Image
Boolean operation on two images.
-
#boolean_const(c, boolean, opts = {}) ⇒ Vips::Image
Boolean operations against a constant.
-
#buildlut(opts = {}) ⇒ Vips::Image
Build a look-up table.
-
#byteswap(opts = {}) ⇒ Vips::Image
Byteswap an image.
-
#cache(opts = {}) ⇒ Vips::Image
Cache an image.
-
#cast(format, opts = {}) ⇒ Vips::Image
Cast an image.
-
#ceil ⇒ Image
Return the smallest integral value not less than the argument.
-
#CMC2LCh(opts = {}) ⇒ Vips::Image
Transform lch to cmc.
-
#colourspace(space, opts = {}) ⇒ Vips::Image
Convert to a new colourspace.
-
#compass(mask, opts = {}) ⇒ Vips::Image
Convolve with rotating mask.
-
#complex(cmplx, opts = {}) ⇒ Vips::Image
Perform a complex operation on an image.
-
#complex2(right, cmplx, opts = {}) ⇒ Vips::Image
Complex binary operations on two images.
-
#complexform(right, opts = {}) ⇒ Vips::Image
Form a complex image from two real images.
-
#complexget(get, opts = {}) ⇒ Vips::Image
Get a component from a complex image.
-
#conj ⇒ Image
Return the complex conjugate of an image.
-
#conv(mask, opts = {}) ⇒ Vips::Image
Convolution operation.
-
#convsep(mask, opts = {}) ⇒ Vips::Image
Seperable convolution operation.
-
#copy(opts = {}) ⇒ Vips::Image
Copy an image.
-
#cos ⇒ Image
Return the cosine of an image in degrees.
-
#countlines(direction, opts = {}) ⇒ Float
Count lines in an image.
-
#csvsave(filename, opts = {}) ⇒ nil
Save image to csv file.
-
#dE00(right, opts = {}) ⇒ Vips::Image
Calculate de00.
-
#dE76(right, opts = {}) ⇒ Vips::Image
Calculate de76.
-
#dECMC(right, opts = {}) ⇒ Vips::Image
Calculate decmc.
-
#deviate(opts = {}) ⇒ Float
Find image standard deviation.
-
#dilate(mask) ⇒ Image
Dilate with a structuring element.
-
#divide(right, opts = {}) ⇒ Vips::Image
Divide two images.
-
#draw_circle(ink, cx, cy, radius, opts = {}) ⇒ Vips::Image
Draw a circle on an image.
-
#draw_flood(ink, x, y, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Flood-fill an area.
-
#draw_image(sub, x, y, opts = {}) ⇒ Vips::Image
Paint an image into another image.
-
#draw_line(ink, x1, y1, x2, y2, opts = {}) ⇒ Vips::Image
Draw a line on an image.
-
#draw_mask(ink, mask, x, y, opts = {}) ⇒ Vips::Image
Draw a mask on an image.
-
#draw_rect(ink, left, top, width, height, opts = {}) ⇒ Vips::Image
Paint a rectangle on an image.
-
#draw_smudge(left, top, width, height, opts = {}) ⇒ Vips::Image
Blur a rectangle on an image.
-
#dzsave(filename, opts = {}) ⇒ nil
Save image to deep zoom format.
-
#embed(x, y, width, height, opts = {}) ⇒ Vips::Image
Embed an image in a larger image.
-
#erode(mask) ⇒ Image
Erode with a structuring element.
-
#exp ⇒ Image
Return e ** pixel.
-
#exp10 ⇒ Image
Return 10 ** pixel.
-
#extract_area(left, top, width, height, opts = {}) ⇒ Vips::Image
Extract an area from an image.
-
#extract_band(band, opts = {}) ⇒ Vips::Image
Extract band from an image.
-
#falsecolour(opts = {}) ⇒ Vips::Image
False-colour an image.
-
#fastcor(ref, opts = {}) ⇒ Vips::Image
Fast correlation.
-
#fitssave(filename, opts = {}) ⇒ nil
Save image to fits file.
-
#flatten(opts = {}) ⇒ Vips::Image
Flatten alpha out of an image.
-
#flip(direction, opts = {}) ⇒ Vips::Image
Flip an image.
-
#fliphor ⇒ Image
Flip horizontally.
-
#flipver ⇒ Image
Flip vertically.
-
#float2rad(opts = {}) ⇒ Vips::Image
Transform float rgb to radiance coding.
-
#floor ⇒ Image
Return the largest integral value not greater than the argument.
-
#freqmult(mask, opts = {}) ⇒ Vips::Image
Frequency-domain filtering.
-
#fwfft(opts = {}) ⇒ Vips::Image
Forward fft.
-
#gamma(opts = {}) ⇒ Vips::Image
Gamma an image.
-
#gaussblur(sigma, opts = {}) ⇒ Vips::Image
Gaussian blur.
-
#get(name) ⇒ Integer, GValue
Fetch a
GValue
from an image. -
#get_typeof(name) ⇒ Integer
Fetch a
GType
from an image. -
#get_value(name) ⇒ Object
Get a metadata item from an image.
-
#getpoint(x, y, opts = {}) ⇒ Array<Double>
Read a point from an image.
-
#globalbalance(opts = {}) ⇒ Vips::Image
Global balance an image mosaic.
-
#grid(tile_height, across, down, opts = {}) ⇒ Vips::Image
Grid an image.
-
#hist_cum(opts = {}) ⇒ Vips::Image
Form cumulative histogram.
-
#hist_entropy(opts = {}) ⇒ Float
Estimate image entropy.
-
#hist_equal(opts = {}) ⇒ Vips::Image
Histogram equalisation.
-
#hist_find(opts = {}) ⇒ Vips::Image
Find image histogram.
-
#hist_find_indexed(index, opts = {}) ⇒ Vips::Image
Find indexed image histogram.
-
#hist_find_ndim(opts = {}) ⇒ Vips::Image
Find n-dimensional image histogram.
-
#hist_ismonotonic(opts = {}) ⇒ Boolean
Test for monotonicity.
-
#hist_local(width, height, opts = {}) ⇒ Vips::Image
Local histogram equalisation.
-
#hist_match(ref, opts = {}) ⇒ Vips::Image
Match two histograms.
-
#hist_norm(opts = {}) ⇒ Vips::Image
Normalise histogram.
-
#hist_plot(opts = {}) ⇒ Vips::Image
Plot histogram.
-
#hough_circle(opts = {}) ⇒ Vips::Image
Find hough circle transform.
-
#hough_line(opts = {}) ⇒ Vips::Image
Find hough line transform.
-
#HSV2sRGB(opts = {}) ⇒ Vips::Image
Transform hsv to srgb.
-
#icc_export(opts = {}) ⇒ Vips::Image
Output to device with icc profile.
-
#icc_import(opts = {}) ⇒ Vips::Image
Import from device with icc profile.
-
#icc_transform(output_profile, opts = {}) ⇒ Vips::Image
Transform between devices with icc profiles.
-
#ifthenelse(th, el, opts = {}) ⇒ Image
Select pixels from
th
ifself
is non-zero and fromel
ifself
is zero. -
#imag ⇒ Image
Return the imaginary part of a complex image.
-
#insert(sub, x, y, opts = {}) ⇒ Vips::Image
Insert image @sub into @main at @x, @y.
-
#invert(opts = {}) ⇒ Vips::Image
Invert an image.
-
#invertlut(opts = {}) ⇒ Vips::Image
Build an inverted look-up table.
-
#invfft(opts = {}) ⇒ Vips::Image
Inverse fft.
-
#join(in2, direction, opts = {}) ⇒ Vips::Image
Join a pair of images.
-
#jpegsave(filename, opts = {}) ⇒ nil
Save image to jpeg file.
-
#jpegsave_buffer(opts = {}) ⇒ Vips::Blob
Save image to jpeg buffer.
-
#jpegsave_mime(opts = {}) ⇒ nil
Save image to jpeg mime.
-
#Lab2LabQ(opts = {}) ⇒ Vips::Image
Transform float lab to labq coding.
-
#Lab2LabS(opts = {}) ⇒ Vips::Image
Transform float lab to signed short.
-
#Lab2LCh(opts = {}) ⇒ Vips::Image
Transform lab to lch.
-
#Lab2XYZ(opts = {}) ⇒ Vips::Image
Transform cielab to xyz.
-
#labelregions(opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Label regions in an image.
-
#LabQ2Lab(opts = {}) ⇒ Vips::Image
Unpack a labq image to float lab.
-
#LabQ2LabS(opts = {}) ⇒ Vips::Image
Unpack a labq image to short lab.
-
#LabQ2sRGB(opts = {}) ⇒ Vips::Image
Convert a labq image to srgb.
-
#LabS2Lab(opts = {}) ⇒ Vips::Image
Transform signed short lab to float.
-
#LabS2LabQ(opts = {}) ⇒ Vips::Image
Transform short lab to labq coding.
-
#LCh2CMC(opts = {}) ⇒ Vips::Image
Transform lch to cmc.
-
#LCh2Lab(opts = {}) ⇒ Vips::Image
Transform lch to lab.
-
#linear(a, b, opts = {}) ⇒ Vips::Image
Calculate (a * in + b).
-
#linecache(opts = {}) ⇒ Vips::Image
Cache an image as a set of lines.
-
#log ⇒ Image
Return the natural log of an image.
-
#log10 ⇒ Image
Return the log base 10 of an image.
-
#mapim(index, opts = {}) ⇒ Vips::Image
Resample with an mapim image.
-
#maplut(lut, opts = {}) ⇒ Vips::Image
Map an image though a lut.
-
#match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {}) ⇒ Vips::Image
First-order match of two images.
-
#math(math, opts = {}) ⇒ Vips::Image
Apply a math operation to an image.
-
#math2(right, math2, opts = {}) ⇒ Vips::Image
Binary math operations.
-
#math2_const(c, math2, opts = {}) ⇒ Vips::Image
Pow( @in, @c ).
-
#matrixprint(opts = {}) ⇒ nil
Print matrix.
-
#matrixsave(filename, opts = {}) ⇒ nil
Save image to matrix file.
-
#max(opts = {}) ⇒ Float, Hash<Symbol => Object>
Find image maximum.
-
#maxpos ⇒ Real
Return the coordinates of the image maximum.
-
#measure(h, v, opts = {}) ⇒ Vips::Image
Measure a set of patches on a colour chart.
-
#median(size = 3) ⇒ Image
a median filter.
-
#merge(sec, direction, dx, dy, opts = {}) ⇒ Vips::Image
Merge two images.
-
#method_missing(name, *args) ⇒ Object
Invoke a vips operation with call, using self as the first input image argument.
-
#min(opts = {}) ⇒ Float, Hash<Symbol => Object>
Find image minimum.
-
#minpos ⇒ Real
Return the coordinates of the image minimum.
-
#morph(mask, morph, opts = {}) ⇒ Vips::Image
Morphology operation.
-
#mosaic(sec, direction, xref, yref, xsec, ysec, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Mosaic two images.
-
#mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {}) ⇒ Vips::Image
First-order mosaic of two images.
-
#msb(opts = {}) ⇒ Vips::Image
Pick most-significant byte from an image.
-
#multiply(right, opts = {}) ⇒ Vips::Image
Multiply two images.
-
#percent(percent, opts = {}) ⇒ Integer
Find threshold for percent of pixels.
-
#phasecor(in2, opts = {}) ⇒ Vips::Image
Calculate phase correlation.
-
#pngsave(filename, opts = {}) ⇒ nil
Save image to png file.
-
#pngsave_buffer(opts = {}) ⇒ Vips::Blob
Save image to png buffer.
-
#polar ⇒ Image
Return an image with rectangular pixels converted to polar.
-
#ppmsave(filename, opts = {}) ⇒ nil
Save image to ppm file.
-
#premultiply(opts = {}) ⇒ Vips::Image
Premultiply image alpha.
-
#profile(opts = {}) ⇒ Array<] First non-zero pixel in column, First non-zero pixel in row
Find image profiles.
-
#project(opts = {}) ⇒ Array<] Sums of columns, Sums of rows
Find image projections.
-
#quadratic(coeff, opts = {}) ⇒ Vips::Image
Resample an image with a quadratic transform.
-
#rad2float(opts = {}) ⇒ Vips::Image
Unpack radiance coding to float rgb.
-
#radsave(filename, opts = {}) ⇒ nil
Save image to radiance file.
-
#rank(width, height, index, opts = {}) ⇒ Vips::Image
Rank filter.
-
#rawsave(filename, opts = {}) ⇒ nil
Save image to raw file.
-
#rawsave_fd(fd, opts = {}) ⇒ nil
Write raw image to file descriptor.
-
#real ⇒ Image
Return the real part of a complex image.
-
#recomb(m, opts = {}) ⇒ Vips::Image
Linear recombination with matrix.
-
#rect ⇒ Image
Return an image with polar pixels converted to rectangular.
-
#relational(right, relational, opts = {}) ⇒ Vips::Image
Relational operation on two images.
-
#relational_const(c, relational, opts = {}) ⇒ Vips::Image
Relational operations against a constant.
-
#remainder(right, opts = {}) ⇒ Vips::Image
Remainder after integer division of two images.
-
#remainder_const(c, opts = {}) ⇒ Vips::Image
Remainder after integer division of an image and a constant.
-
#replicate(across, down, opts = {}) ⇒ Vips::Image
Replicate an image.
-
#resize(scale, opts = {}) ⇒ Vips::Image
Resize an image.
-
#rint ⇒ Image
Return the nearest integral value.
-
#rot(angle, opts = {}) ⇒ Vips::Image
Rotate an image.
-
#rot180 ⇒ Image
Rotate by 180 degrees clockwise.
-
#rot270 ⇒ Image
Rotate by 270 degrees clockwise.
-
#rot45(opts = {}) ⇒ Vips::Image
Rotate an image.
-
#rot90 ⇒ Image
Rotate by 90 degrees clockwise.
-
#round(round, opts = {}) ⇒ Vips::Image
Perform a round function on an image.
-
#scale(opts = {}) ⇒ Vips::Image
Scale an image to uchar.
-
#scRGB2BW(opts = {}) ⇒ Vips::Image
Convert scrgb to bw.
-
#scRGB2sRGB(opts = {}) ⇒ Vips::Image
Convert an scrgb image to srgb.
-
#scRGB2XYZ(opts = {}) ⇒ Vips::Image
Transform scrgb to xyz.
-
#sequential(opts = {}) ⇒ Vips::Image
Check sequential access.
-
#set(name, value) ⇒ Object
Set a
GValue
on an image. -
#set_value(name, value) ⇒ Object
Set a metadata item on an image.
-
#sharpen(opts = {}) ⇒ Vips::Image
Unsharp masking for print.
-
#shrink(xshrink, yshrink, opts = {}) ⇒ Vips::Image
Shrink an image.
-
#shrink2(xshrink, yshrink, opts = {}) ⇒ Vips::Image
Shrink an image.
-
#shrinkh(xshrink, opts = {}) ⇒ Vips::Image
Shrink an image horizontally.
-
#shrinkv(yshrink, opts = {}) ⇒ Vips::Image
Shrink an image vertically.
-
#sign(opts = {}) ⇒ Vips::Image
Unit vector of pixel.
-
#similarity(opts = {}) ⇒ Vips::Image
Similarity transform of an image.
-
#sin ⇒ Image
Return the sine of an image in degrees.
-
#spcor(ref, opts = {}) ⇒ Vips::Image
Spatial correlation.
-
#spectrum(opts = {}) ⇒ Vips::Image
Make displayable power spectrum.
-
#sRGB2HSV(opts = {}) ⇒ Vips::Image
Transform srgb to hsv.
-
#sRGB2scRGB(opts = {}) ⇒ Vips::Image
Convert an srgb image to scrgb.
-
#stats(opts = {}) ⇒ Vips::Image
Find image average.
-
#stdif(width, height, opts = {}) ⇒ Vips::Image
Statistical difference.
-
#subsample(xfac, yfac, opts = {}) ⇒ Vips::Image
Subsample an image.
-
#subtract(right, opts = {}) ⇒ Vips::Image
Subtract two images.
-
#tan ⇒ Image
Return the tangent of an image in degrees.
-
#tiffsave(filename, opts = {}) ⇒ nil
Save image to tiff file.
-
#tilecache(opts = {}) ⇒ Vips::Image
Cache an image as a set of tiles.
-
#unpremultiply(opts = {}) ⇒ Vips::Image
Unpremultiply image alpha.
-
#vipssave(filename, opts = {}) ⇒ nil
Save image to vips file.
-
#webpsave(filename, opts = {}) ⇒ nil
Save image to webp file.
-
#webpsave_buffer(opts = {}) ⇒ Vips::Blob
Save image to webp buffer.
-
#wrap(opts = {}) ⇒ Vips::Image
Wrap image origin.
-
#write_to_buffer(format_string, opts = {}) ⇒ String
Write this image to a memory buffer.
-
#write_to_file(name, opts = {}) ⇒ Object
Write this image to a file.
-
#XYZ2Lab(opts = {}) ⇒ Vips::Image
Transform xyz to lab.
-
#XYZ2scRGB(opts = {}) ⇒ Vips::Image
Transform xyz to scrgb.
-
#XYZ2Yxy(opts = {}) ⇒ Vips::Image
Transform xyz to yxy.
-
#Yxy2XYZ(opts = {}) ⇒ Vips::Image
Transform yxy to xyz.
-
#zoom(xfac, yfac, opts = {}) ⇒ Vips::Image
Zoom an image.
-
#|(other) ⇒ Image
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
permalink #method_missing(name, *args) ⇒ Object
Invoke a vips operation with Vips.call, using self as the first input image argument.
374 375 376 |
# File 'lib/vips8/image.rb', line 374 def method_missing(name, *args) Vips::call_base(name.to_s, self, "", args) end |
Instance Attribute Details
permalink #coding ⇒ Vips::Coding (readonly)
Returns image coding.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #filename ⇒ String (readonly)
Returns image filename.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #format ⇒ Vips::BandFormat (readonly)
Returns image format.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #height ⇒ Integer (readonly)
Returns image height, in pixels.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #interpretation ⇒ Vips::Interpretation (readonly)
Returns image interpretation.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #width ⇒ Integer (readonly)
Returns image width, in pixels.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #xres ⇒ Float (readonly)
Returns horizontal image resolution, in pixels per mm.
|
# File 'lib/vips8/image.rb', line 619
|
permalink #yres ⇒ Float (readonly)
Returns vertical image resolution, in pixels per mm.
|
# File 'lib/vips8/image.rb', line 619
|
Class Method Details
permalink .analyzeload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load an analyze6 image.
|
# File 'lib/vips8/methods.rb', line 847
|
permalink .arrayjoin ⇒ Vips::Image
Join an array of images.
|
# File 'lib/vips8/methods.rb', line 346
|
permalink .bandrank ⇒ Vips::Image
Band-wise rank of a set of images.
|
# File 'lib/vips8/methods.rb', line 390
|
permalink .black(width, height, opts = {}) ⇒ Vips::Image
Make a black image.
|
# File 'lib/vips8/methods.rb', line 536
|
permalink .csvload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load csv from file.
|
# File 'lib/vips8/methods.rb', line 825
|
permalink .eye(width, height, opts = {}) ⇒ Vips::Image
Make an image showing the eye's spatial response.
|
# File 'lib/vips8/methods.rb', line 592
|
permalink .fitsload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load a fits image.
|
# File 'lib/vips8/methods.rb', line 1001
|
permalink .fractsurf(width, height, fractal_dimension, opts = {}) ⇒ Vips::Image
Make a fractal surface.
|
# File 'lib/vips8/methods.rb', line 799
|
permalink .gaussmat(sigma, min_ampl, opts = {}) ⇒ Vips::Image
Make a gaussian image.
|
# File 'lib/vips8/methods.rb', line 574
|
permalink .gaussnoise(width, height, opts = {}) ⇒ Vips::Image
Make a gaussnoise image.
|
# File 'lib/vips8/methods.rb', line 544
|
permalink .grey(width, height, opts = {}) ⇒ Vips::Image
Make a grey ramp image.
|
# File 'lib/vips8/methods.rb', line 601
|
permalink .identity(opts = {}) ⇒ Vips::Image
Make a 1d image where pixel values are indexes.
|
# File 'lib/vips8/methods.rb', line 791
|
permalink .jpegload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load jpeg from file.
|
# File 'lib/vips8/methods.rb', line 905
|
permalink .jpegload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load jpeg from buffer.
|
# File 'lib/vips8/methods.rb', line 917
|
permalink .logmat(sigma, min_ampl, opts = {}) ⇒ Vips::Image
Make a laplacian of gaussian image.
|
# File 'lib/vips8/methods.rb', line 583
|
permalink .magickload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load file with imagemagick.
|
# File 'lib/vips8/methods.rb', line 979
|
permalink .magickload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load buffer with imagemagick.
|
# File 'lib/vips8/methods.rb', line 990
|
permalink .mask_butterworth(width, height, order, frequency_cutoff, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a butterworth filter.
|
# File 'lib/vips8/methods.rb', line 666
|
permalink .mask_butterworth_band(width, height, order, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a butterworth_band filter.
|
# File 'lib/vips8/methods.rb', line 695
|
permalink .mask_butterworth_ring(width, height, order, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {}) ⇒ Vips::Image
Make a butterworth ring filter.
|
# File 'lib/vips8/methods.rb', line 680
|
permalink .mask_fractal(width, height, fractal_dimension, opts = {}) ⇒ Vips::Image
Make fractal filter.
|
# File 'lib/vips8/methods.rb', line 753
|
permalink .mask_gaussian(width, height, frequency_cutoff, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a gaussian filter.
|
# File 'lib/vips8/methods.rb', line 711
|
permalink .mask_gaussian_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, amplitude_cutoff, opts = {}) ⇒ Vips::Image
Make a gaussian filter.
|
# File 'lib/vips8/methods.rb', line 738
|
permalink .mask_gaussian_ring(width, height, frequency_cutoff, amplitude_cutoff, ringwidth, opts = {}) ⇒ Vips::Image
Make a gaussian ring filter.
|
# File 'lib/vips8/methods.rb', line 724
|
permalink .mask_ideal(width, height, frequency_cutoff, opts = {}) ⇒ Vips::Image
Make an ideal filter.
|
# File 'lib/vips8/methods.rb', line 627
|
permalink .mask_ideal_band(width, height, frequency_cutoff_x, frequency_cutoff_y, radius, opts = {}) ⇒ Vips::Image
Make an ideal band filter.
|
# File 'lib/vips8/methods.rb', line 652
|
permalink .mask_ideal_ring(width, height, frequency_cutoff, ringwidth, opts = {}) ⇒ Vips::Image
Make an ideal ring filter.
|
# File 'lib/vips8/methods.rb', line 639
|
permalink .matload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load mat from file.
|
# File 'lib/vips8/methods.rb', line 896
|
permalink .matrixload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load matrix from file.
|
# File 'lib/vips8/methods.rb', line 838
|
permalink .method_missing(name, *args) ⇒ Object
Invoke a vips operation with Vips.call.
379 380 381 |
# File 'lib/vips8/image.rb', line 379 def self.method_missing(name, *args) Vips::call_base name.to_s, nil, "", args end |
permalink .new_from_array(array, scale = 1, offset = 0) ⇒ Image
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.
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/vips8/image.rb', line 499 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 |
permalink .new_from_buffer(data, option_string, opts = {}) ⇒ Image
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.
464 465 466 467 468 469 470 471 |
# File 'lib/vips8/image.rb', line 464 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, opts] end |
permalink .new_from_file(name, opts = {}) ⇒ Image
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.
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/vips8/image.rb', line 418 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 |
permalink .openexrload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load an openexr image.
|
# File 'lib/vips8/methods.rb', line 1010
|
permalink .openslideload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load file with openslide.
|
# File 'lib/vips8/methods.rb', line 967
|
permalink .pngload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load png from file.
|
# File 'lib/vips8/methods.rb', line 878
|
permalink .pngload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load png from buffer.
|
# File 'lib/vips8/methods.rb', line 887
|
permalink .ppmload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load ppm from file.
|
# File 'lib/vips8/methods.rb', line 816
|
permalink .radload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load a radiance image from a file.
|
# File 'lib/vips8/methods.rb', line 807
|
permalink .rawload(filename, width, height, bands, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load raw data from a file.
|
# File 'lib/vips8/methods.rb', line 856
|
permalink .sines(width, height, opts = {}) ⇒ Vips::Image
Make a 2d sine wave.
|
# File 'lib/vips8/methods.rb', line 617
|
permalink .sum ⇒ Vips::Image
Sum an array of images.
|
# File 'lib/vips8/methods.rb', line 79
|
permalink .system(cmd_format, opts = {}) ⇒ nil, Hash<Symbol => Object>
Run an external command.
|
# File 'lib/vips8/methods.rb', line 4
|
permalink .text(text, opts = {}) ⇒ Vips::Image
Make a text image.
|
# File 'lib/vips8/methods.rb', line 553
|
permalink .tiffload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load tiff from file.
|
# File 'lib/vips8/methods.rb', line 947
|
permalink .tiffload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load tiff from buffer.
|
# File 'lib/vips8/methods.rb', line 957
|
permalink .tonelut(opts = {}) ⇒ Vips::Image
Build a look-up table.
|
# File 'lib/vips8/methods.rb', line 776
|
permalink .vipsload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load vips from file.
|
# File 'lib/vips8/methods.rb', line 869
|
permalink .webpload(filename, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load webp from file.
|
# File 'lib/vips8/methods.rb', line 929
|
permalink .webpload_buffer(buffer, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Load webp from buffer.
|
# File 'lib/vips8/methods.rb', line 938
|
permalink .xyz(width, height, opts = {}) ⇒ Vips::Image
Make an image where pixel values are coordinates.
|
# File 'lib/vips8/methods.rb', line 564
|
permalink .zone(width, height, opts = {}) ⇒ Vips::Image
Make a zone plate.
|
# File 'lib/vips8/methods.rb', line 609
|
Instance Method Details
permalink #! ⇒ Image
Equivalent to image ^ -1
825 826 827 |
# File 'lib/vips8/image.rb', line 825 def ! self ^ -1 end |
permalink #!=(other) ⇒ Image
Compare inequality to nil, an image, constant or array.
904 905 906 907 908 909 910 911 912 |
# File 'lib/vips8/image.rb', line 904 def !=(other) if other == nil true elsif other.is_a?(Vips::Image) relational(other, :noteq) else relational_const(other, :noteq) end end |
permalink #%(other) ⇒ Image
Remainder after integer division with an image, constant or array.
763 764 765 766 |
# File 'lib/vips8/image.rb', line 763 def %(other) other.is_a?(Vips::Image) ? remainder(other) : remainder_const(other) end |
permalink #&(other) ⇒ Image
Integer bitwise AND with an image, constant or array.
808 809 810 811 |
# File 'lib/vips8/image.rb', line 808 def &(other) other.is_a?(Vips::Image) ? boolean(other, :and) : boolean_const(other, :and) end |
permalink #*(other) ⇒ Image
Multiply an image, constant or array.
746 747 748 |
# File 'lib/vips8/image.rb', line 746 def *(other) other.is_a?(Vips::Image) ? multiply(other) : linear(other, 0) end |
permalink #**(other) ⇒ Image
Raise to power of an image, constant or array.
772 773 774 775 |
# File 'lib/vips8/image.rb', line 772 def **(other) other.is_a?(Vips::Image) ? math2(other, :pow) : math2_const(other, :pow) end |
permalink #+(other) ⇒ Image
Add an image, constant or array.
729 730 731 |
# File 'lib/vips8/image.rb', line 729 def +(other) other.is_a?(Vips::Image) ? add(other) : linear(1, other) end |
permalink #+@ ⇒ Image
Returns image.
837 838 839 |
# File 'lib/vips8/image.rb', line 837 def +@ self end |
permalink #-(other) ⇒ Image
Subtract an image, constant or array.
737 738 739 740 |
# File 'lib/vips8/image.rb', line 737 def -(other) other.is_a?(Vips::Image) ? subtract(other) : linear(1, Image::smap(other) {|x| x * -1}) end |
permalink #-@ ⇒ Image
Equivalent to image * -1
844 845 846 |
# File 'lib/vips8/image.rb', line 844 def -@ self * -1 end |
permalink #/(other) ⇒ Image
Divide an image, constant or array.
754 755 756 757 |
# File 'lib/vips8/image.rb', line 754 def /(other) other.is_a?(Vips::Image) ? divide(other) : linear(Image::smap(other) {|x| 1.0 / x}, 0) end |
permalink #<(other) ⇒ Image
Relational less than with an image, constant or array.
852 853 854 855 |
# File 'lib/vips8/image.rb', line 852 def <(other) other.is_a?(Vips::Image) ? relational(other, :less) : relational_const(other, :less) end |
permalink #<<(other) ⇒ Image
Integer left shift with an image, constant or array.
781 782 783 784 |
# File 'lib/vips8/image.rb', line 781 def <<(other) other.is_a?(Vips::Image) ? boolean(other, :lshift) : boolean_const(other, :lshift) end |
permalink #<=(other) ⇒ Image
Relational less than or equal to with an image, constant or array.
862 863 864 865 |
# File 'lib/vips8/image.rb', line 862 def <=(other) other.is_a?(Vips::Image) ? relational(other, :lesseq) : relational_const(other, :lesseq) end |
permalink #==(other) ⇒ Image
Compare equality to nil, an image, constant or array.
890 891 892 893 894 895 896 897 898 |
# File 'lib/vips8/image.rb', line 890 def ==(other) if other == nil false elsif other.is_a?(Vips::Image) relational(other, :equal) else relational_const(other, :equal) end end |
permalink #>(other) ⇒ Image
Relational more than with an image, constant or array.
871 872 873 874 |
# File 'lib/vips8/image.rb', line 871 def >(other) other.is_a?(Vips::Image) ? relational(other, :more) : relational_const(other, :more) end |
permalink #>=(other) ⇒ Image
Relational more than or equal to with an image, constant or array.
881 882 883 884 |
# File 'lib/vips8/image.rb', line 881 def >=(other) other.is_a?(Vips::Image) ? relational(other, :moreeq) : relational_const(other, :moreeq) end |
permalink #>>(other) ⇒ Image
Integer right shift with an image, constant or array.
790 791 792 793 |
# File 'lib/vips8/image.rb', line 790 def >>(other) other.is_a?(Vips::Image) ? boolean(other, :rshift) : boolean_const(other, :rshift) end |
permalink #[](index) ⇒ Image
Fetch bands using a number or a range
918 919 920 921 922 923 924 925 926 927 928 |
# File 'lib/vips8/image.rb', line 918 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 |
permalink #^(other) ⇒ Image
Integer bitwise EOR with an image, constant or array.
817 818 819 820 |
# File 'lib/vips8/image.rb', line 817 def ^(other) other.is_a?(Vips::Image) ? boolean(other, :eor) : boolean_const(other, :eor) end |
permalink #abs(opts = {}) ⇒ Vips::Image
Absolute value of an image.
|
# File 'lib/vips8/methods.rb', line 104
|
permalink #acos ⇒ Image
Return the inverse cosine of an image in degrees.
1118 1119 1120 |
# File 'lib/vips8/image.rb', line 1118 def acos math :acos end |
permalink #add(right, opts = {}) ⇒ Vips::Image
Add two images.
|
# File 'lib/vips8/methods.rb', line 15
|
permalink #affine(matrix, opts = {}) ⇒ Vips::Image
Affine transform of an image.
|
# File 'lib/vips8/methods.rb', line 1261
|
permalink #asin ⇒ Image
Return the inverse sine of an image in degrees.
1111 1112 1113 |
# File 'lib/vips8/image.rb', line 1111 def asin math :asin end |
permalink #atan ⇒ Image
Return the inverse tangent of an image in degrees.
1125 1126 1127 |
# File 'lib/vips8/image.rb', line 1125 def atan math :atan end |
permalink #autorot(opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Autorotate image by exif tag.
|
# File 'lib/vips8/methods.rb', line 434
|
permalink #avg(opts = {}) ⇒ Float
Find image average.
|
# File 'lib/vips8/methods.rb', line 159
|
permalink #bandand ⇒ Image
AND the bands of an image together
954 955 956 |
# File 'lib/vips8/image.rb', line 954 def bandand bandbool :and end |
permalink #bandbool(boolean, opts = {}) ⇒ Vips::Image
Boolean operation across image bands.
|
# File 'lib/vips8/methods.rb', line 402
|
permalink #bandeor ⇒ Image
EOR the bands of an image together
968 969 970 |
# File 'lib/vips8/image.rb', line 968 def bandeor bandbool :eor end |
permalink #bandfold(opts = {}) ⇒ Vips::Image
Fold up x axis into bands.
|
# File 'lib/vips8/methods.rb', line 446
|
permalink #bandjoin(other) ⇒ Image
Join a set of images bandwise.
983 984 985 986 987 988 989 |
# File 'lib/vips8/image.rb', line 983 def bandjoin(other) if not other.is_a? Array other = [other] end Vips::Image.bandjoin([self] + other) end |
permalink #bandjoin_const(c, opts = {}) ⇒ Vips::Image
Append a constant band to an image.
|
# File 'lib/vips8/methods.rb', line 384
|
permalink #bandmean(opts = {}) ⇒ Vips::Image
Band-wise average.
|
# File 'lib/vips8/methods.rb', line 397
|
permalink #bandor ⇒ Image
OR the bands of an image together
961 962 963 |
# File 'lib/vips8/image.rb', line 961 def bandor bandbool :or end |
permalink #bandsplit ⇒ Array<Image>
Split an n-band image into n separate images.
975 976 977 |
# File 'lib/vips8/image.rb', line 975 def bandsplit (0...bands).map {|i| extract_band(i)} end |
permalink #bandunfold(opts = {}) ⇒ Vips::Image
Unfold image bands into x axis.
|
# File 'lib/vips8/methods.rb', line 452
|
permalink #boolean(right, boolean, opts = {}) ⇒ Vips::Image
Boolean operation on two images.
|
# File 'lib/vips8/methods.rb', line 52
|
permalink #boolean_const(c, boolean, opts = {}) ⇒ Vips::Image
Boolean operations against a constant.
|
# File 'lib/vips8/methods.rb', line 133
|
permalink #buildlut(opts = {}) ⇒ Vips::Image
Build a look-up table.
|
# File 'lib/vips8/methods.rb', line 765
|
permalink #byteswap(opts = {}) ⇒ Vips::Image
Byteswap an image.
|
# File 'lib/vips8/methods.rb', line 520
|
permalink #cache(opts = {}) ⇒ Vips::Image
Cache an image.
|
# File 'lib/vips8/methods.rb', line 300
|
permalink #cast(format, opts = {}) ⇒ Vips::Image
Cast an image.
|
# File 'lib/vips8/methods.rb', line 415
|
permalink #ceil ⇒ Image
Return the smallest integral value not less than the argument.
940 941 942 |
# File 'lib/vips8/image.rb', line 940 def ceil round :ceil end |
permalink #CMC2LCh(opts = {}) ⇒ Vips::Image
Transform lch to cmc.
|
# File 'lib/vips8/methods.rb', line 1329
|
permalink #colourspace(space, opts = {}) ⇒ Vips::Image
Convert to a new colourspace.
|
# File 'lib/vips8/methods.rb', line 1295
|
permalink #compass(mask, opts = {}) ⇒ Vips::Image
Convolve with rotating mask.
|
# File 'lib/vips8/methods.rb', line 1550
|
permalink #complex(cmplx, opts = {}) ⇒ Vips::Image
Perform a complex operation on an image.
|
# File 'lib/vips8/methods.rb', line 147
|
permalink #complex2(right, cmplx, opts = {}) ⇒ Vips::Image
Complex binary operations on two images.
|
# File 'lib/vips8/methods.rb', line 66
|
permalink #complexform(right, opts = {}) ⇒ Vips::Image
Form a complex image from two real images.
|
# File 'lib/vips8/methods.rb', line 73
|
permalink #complexget(get, opts = {}) ⇒ Vips::Image
Get a component from a complex image.
|
# File 'lib/vips8/methods.rb', line 153
|
permalink #conj ⇒ Image
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.
1083 1084 1085 |
# File 'lib/vips8/image.rb', line 1083 def conj Image::run_cmplx(self) {|x| x.complex :conj} end |
permalink #conv(mask, opts = {}) ⇒ Vips::Image
Convolution operation.
|
# File 'lib/vips8/methods.rb', line 1541
|
permalink #convsep(mask, opts = {}) ⇒ Vips::Image
Seperable convolution operation.
|
# File 'lib/vips8/methods.rb', line 1562
|
permalink #copy(opts = {}) ⇒ Vips::Image
Copy an image.
|
# File 'lib/vips8/methods.rb', line 257
|
permalink #cos ⇒ Image
Return the cosine of an image in degrees.
1097 1098 1099 |
# File 'lib/vips8/image.rb', line 1097 def cos math :cos end |
permalink #countlines(direction, opts = {}) ⇒ Float
Count lines in an image.
|
# File 'lib/vips8/methods.rb', line 1645
|
permalink #csvsave(filename, opts = {}) ⇒ nil
Save image to csv file.
|
# File 'lib/vips8/methods.rb', line 1037
|
permalink #dE00(right, opts = {}) ⇒ Vips::Image
Calculate de00.
|
# File 'lib/vips8/methods.rb', line 1444
|
permalink #dE76(right, opts = {}) ⇒ Vips::Image
Calculate de76.
|
# File 'lib/vips8/methods.rb', line 1438
|
permalink #dECMC(right, opts = {}) ⇒ Vips::Image
Calculate decmc.
|
# File 'lib/vips8/methods.rb', line 1450
|
permalink #deviate(opts = {}) ⇒ Float
Find image standard deviation.
|
# File 'lib/vips8/methods.rb', line 186
|
permalink #dilate(mask) ⇒ Image
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.
1191 1192 1193 |
# File 'lib/vips8/image.rb', line 1191 def dilate(mask) morph mask, :dilate end |
permalink #divide(right, opts = {}) ⇒ Vips::Image
Divide two images.
|
# File 'lib/vips8/methods.rb', line 33
|
permalink #draw_circle(ink, cx, cy, radius, opts = {}) ⇒ Vips::Image
Draw a circle on an image.
|
# File 'lib/vips8/methods.rb', line 1687
|
permalink #draw_flood(ink, x, y, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Flood-fill an area.
|
# File 'lib/vips8/methods.rb', line 1697
|
permalink #draw_image(sub, x, y, opts = {}) ⇒ Vips::Image
Paint an image into another image.
|
# File 'lib/vips8/methods.rb', line 1711
|
permalink #draw_line(ink, x1, y1, x2, y2, opts = {}) ⇒ Vips::Image
Draw a line on an image.
|
# File 'lib/vips8/methods.rb', line 1677
|
permalink #draw_mask(ink, mask, x, y, opts = {}) ⇒ Vips::Image
Draw a mask on an image.
|
# File 'lib/vips8/methods.rb', line 1668
|
permalink #draw_rect(ink, left, top, width, height, opts = {}) ⇒ Vips::Image
Paint a rectangle on an image.
|
# File 'lib/vips8/methods.rb', line 1657
|
permalink #draw_smudge(left, top, width, height, opts = {}) ⇒ Vips::Image
Blur a rectangle on an image.
|
# File 'lib/vips8/methods.rb', line 1720
|
permalink #dzsave(filename, opts = {}) ⇒ nil
Save image to deep zoom format.
|
# File 'lib/vips8/methods.rb', line 1085
|
permalink #embed(x, y, width, height, opts = {}) ⇒ Vips::Image
Embed an image in a larger image.
|
# File 'lib/vips8/methods.rb', line 308
|
permalink #erode(mask) ⇒ Image
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.
1179 1180 1181 |
# File 'lib/vips8/image.rb', line 1179 def erode(mask) morph mask, :erode end |
permalink #exp ⇒ Image
Return e ** pixel.
1146 1147 1148 |
# File 'lib/vips8/image.rb', line 1146 def exp math :exp end |
permalink #exp10 ⇒ Image
Return 10 ** pixel.
1153 1154 1155 |
# File 'lib/vips8/image.rb', line 1153 def exp10 math :exp10 end |
permalink #extract_area(left, top, width, height, opts = {}) ⇒ Vips::Image
Extract an area from an image.
|
# File 'lib/vips8/methods.rb', line 359
|
permalink #extract_band(band, opts = {}) ⇒ Vips::Image
Extract band from an image.
|
# File 'lib/vips8/methods.rb', line 377
|
permalink #falsecolour(opts = {}) ⇒ Vips::Image
False-colour an image.
|
# File 'lib/vips8/methods.rb', line 525
|
permalink #fastcor(ref, opts = {}) ⇒ Vips::Image
Fast correlation.
|
# File 'lib/vips8/methods.rb', line 1571
|
permalink #fitssave(filename, opts = {}) ⇒ nil
Save image to fits file.
|
# File 'lib/vips8/methods.rb', line 1213
|
permalink #flatten(opts = {}) ⇒ Vips::Image
Flatten alpha out of an image.
|
# File 'lib/vips8/methods.rb', line 458
|
permalink #flip(direction, opts = {}) ⇒ Vips::Image
Flip an image.
|
# File 'lib/vips8/methods.rb', line 319
|
permalink #fliphor ⇒ Image
Flip horizontally.
1160 1161 1162 |
# File 'lib/vips8/image.rb', line 1160 def fliphor flip :horizontal end |
permalink #flipver ⇒ Image
Flip vertically.
1167 1168 1169 |
# File 'lib/vips8/image.rb', line 1167 def flipver flip :vertical end |
permalink #float2rad(opts = {}) ⇒ Vips::Image
Transform float rgb to radiance coding.
|
# File 'lib/vips8/methods.rb', line 1389
|
permalink #floor ⇒ Image
Return the largest integral value not greater than the argument.
933 934 935 |
# File 'lib/vips8/image.rb', line 933 def floor round :floor end |
permalink #freqmult(mask, opts = {}) ⇒ Vips::Image
Frequency-domain filtering.
|
# File 'lib/vips8/methods.rb', line 1613
|
permalink #fwfft(opts = {}) ⇒ Vips::Image
Forward fft.
|
# File 'lib/vips8/methods.rb', line 1602
|
permalink #gamma(opts = {}) ⇒ Vips::Image
Gamma an image.
|
# File 'lib/vips8/methods.rb', line 530
|
permalink #gaussblur(sigma, opts = {}) ⇒ Vips::Image
Gaussian blur.
|
# File 'lib/vips8/methods.rb', line 1594
|
permalink #get(name) ⇒ Integer, GValue
Fetch a GValue
from an image. The return status is 0 for success, -1
for failure.
|
# File 'lib/vips8/image.rb', line 646
|
permalink #get_typeof(name) ⇒ Integer
Fetch a GType
from an image. GType
will be 0 for no such field.
|
# File 'lib/vips8/image.rb', line 638
|
permalink #get_value(name) ⇒ Object
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.
676 677 678 679 680 681 682 683 684 |
# File 'lib/vips8/image.rb', line 676 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 |
permalink #getpoint(x, y, opts = {}) ⇒ Array<Double>
Read a point from an image.
1018 1019 1020 1021 1022 1023 1024 1025 |
# File 'lib/vips8/image.rb', line 1018 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 # get # # remove this def when gobject-introspection updates crop(x, y, 1, 1).bandsplit.map {|i| i.avg} end |
permalink #globalbalance(opts = {}) ⇒ Vips::Image
Global balance an image mosaic.
|
# File 'lib/vips8/methods.rb', line 1799
|
permalink #grid(tile_height, across, down, opts = {}) ⇒ Vips::Image
Grid an image.
|
# File 'lib/vips8/methods.rb', line 477
|
permalink #hist_cum(opts = {}) ⇒ Vips::Image
Form cumulative histogram.
|
# File 'lib/vips8/methods.rb', line 1497
|
permalink #hist_entropy(opts = {}) ⇒ Float
Estimate image entropy.
|
# File 'lib/vips8/methods.rb', line 1536
|
permalink #hist_equal(opts = {}) ⇒ Vips::Image
Histogram equalisation.
|
# File 'lib/vips8/methods.rb', line 1513
|
permalink #hist_find(opts = {}) ⇒ Vips::Image
Find image histogram.
|
# File 'lib/vips8/methods.rb', line 196
|
permalink #hist_find_indexed(index, opts = {}) ⇒ Vips::Image
Find indexed image histogram.
|
# File 'lib/vips8/methods.rb', line 208
|
permalink #hist_find_ndim(opts = {}) ⇒ Vips::Image
Find n-dimensional image histogram.
|
# File 'lib/vips8/methods.rb', line 202
|
permalink #hist_ismonotonic(opts = {}) ⇒ Boolean
Test for monotonicity.
|
# File 'lib/vips8/methods.rb', line 1531
|
permalink #hist_local(width, height, opts = {}) ⇒ Vips::Image
Local histogram equalisation.
|
# File 'lib/vips8/methods.rb', line 1524
|
permalink #hist_match(ref, opts = {}) ⇒ Vips::Image
Match two histograms.
|
# File 'lib/vips8/methods.rb', line 1502
|
permalink #hist_norm(opts = {}) ⇒ Vips::Image
Normalise histogram.
|
# File 'lib/vips8/methods.rb', line 1508
|
permalink #hist_plot(opts = {}) ⇒ Vips::Image
Plot histogram.
|
# File 'lib/vips8/methods.rb', line 1519
|
permalink #hough_circle(opts = {}) ⇒ Vips::Image
Find hough circle transform.
|
# File 'lib/vips8/methods.rb', line 221
|
permalink #hough_line(opts = {}) ⇒ Vips::Image
Find hough line transform.
|
# File 'lib/vips8/methods.rb', line 214
|
permalink #HSV2sRGB(opts = {}) ⇒ Vips::Image
Transform hsv to srgb.
|
# File 'lib/vips8/methods.rb', line 1404
|
permalink #icc_export(opts = {}) ⇒ Vips::Image
Output to device with icc profile.
|
# File 'lib/vips8/methods.rb', line 1418
|
permalink #icc_import(opts = {}) ⇒ Vips::Image
Import from device with icc profile.
|
# File 'lib/vips8/methods.rb', line 1409
|
permalink #icc_transform(output_profile, opts = {}) ⇒ Vips::Image
Transform between devices with icc profiles.
|
# File 'lib/vips8/methods.rb', line 1427
|
permalink #ifthenelse(th, el, opts = {}) ⇒ Image
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
.
1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 |
# File 'lib/vips8/image.rb', line 1225 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, opts] end |
permalink #imag ⇒ Image
Return the imaginary part of a complex image.
1045 1046 1047 |
# File 'lib/vips8/image.rb', line 1045 def imag complexget :imag end |
permalink #insert(sub, x, y, opts = {}) ⇒ Vips::Image
Insert image @sub into @main at @x, @y.
|
# File 'lib/vips8/methods.rb', line 325
|
permalink #invert(opts = {}) ⇒ Vips::Image
Invert an image.
|
# File 'lib/vips8/methods.rb', line 85
|
permalink #invertlut(opts = {}) ⇒ Vips::Image
Build an inverted look-up table.
|
# File 'lib/vips8/methods.rb', line 770
|
permalink #invfft(opts = {}) ⇒ Vips::Image
Inverse fft.
|
# File 'lib/vips8/methods.rb', line 1607
|
permalink #join(in2, direction, opts = {}) ⇒ Vips::Image
Join a pair of images.
|
# File 'lib/vips8/methods.rb', line 335
|
permalink #jpegsave(filename, opts = {}) ⇒ nil
Save image to jpeg file.
|
# File 'lib/vips8/methods.rb', line 1125
|
permalink #jpegsave_buffer(opts = {}) ⇒ Vips::Blob
Save image to jpeg buffer.
|
# File 'lib/vips8/methods.rb', line 1141
|
permalink #jpegsave_mime(opts = {}) ⇒ nil
Save image to jpeg mime.
|
# File 'lib/vips8/methods.rb', line 1156
|
permalink #Lab2LabQ(opts = {}) ⇒ Vips::Image
Transform float lab to labq coding.
|
# File 'lib/vips8/methods.rb', line 1359
|
permalink #Lab2LabS(opts = {}) ⇒ Vips::Image
Transform float lab to signed short.
|
# File 'lib/vips8/methods.rb', line 1379
|
permalink #Lab2LCh(opts = {}) ⇒ Vips::Image
Transform lab to lch.
|
# File 'lib/vips8/methods.rb', line 1314
|
permalink #Lab2XYZ(opts = {}) ⇒ Vips::Image
Transform cielab to xyz.
|
# File 'lib/vips8/methods.rb', line 1302
|
permalink #labelregions(opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Label regions in an image.
|
# File 'lib/vips8/methods.rb', line 1651
|
permalink #LabQ2Lab(opts = {}) ⇒ Vips::Image
Unpack a labq image to float lab.
|
# File 'lib/vips8/methods.rb', line 1354
|
permalink #LabQ2LabS(opts = {}) ⇒ Vips::Image
Unpack a labq image to short lab.
|
# File 'lib/vips8/methods.rb', line 1364
|
permalink #LabQ2sRGB(opts = {}) ⇒ Vips::Image
Convert a labq image to srgb.
|
# File 'lib/vips8/methods.rb', line 1394
|
permalink #LabS2Lab(opts = {}) ⇒ Vips::Image
Transform signed short lab to float.
|
# File 'lib/vips8/methods.rb', line 1374
|
permalink #LabS2LabQ(opts = {}) ⇒ Vips::Image
Transform short lab to labq coding.
|
# File 'lib/vips8/methods.rb', line 1369
|
permalink #LCh2CMC(opts = {}) ⇒ Vips::Image
Transform lch to cmc.
|
# File 'lib/vips8/methods.rb', line 1324
|
permalink #LCh2Lab(opts = {}) ⇒ Vips::Image
Transform lch to lab.
|
# File 'lib/vips8/methods.rb', line 1319
|
permalink #linear(a, b, opts = {}) ⇒ Vips::Image
Calculate (a * in + b).
|
# File 'lib/vips8/methods.rb', line 90
|
permalink #linecache(opts = {}) ⇒ Vips::Image
Cache an image as a set of lines.
|
# File 'lib/vips8/methods.rb', line 283
|
permalink #log ⇒ Image
Return the natural log of an image.
1132 1133 1134 |
# File 'lib/vips8/image.rb', line 1132 def log math :log end |
permalink #log10 ⇒ Image
Return the log base 10 of an image.
1139 1140 1141 |
# File 'lib/vips8/image.rb', line 1139 def log10 math :log10 end |
permalink #mapim(index, opts = {}) ⇒ Vips::Image
Resample with an mapim image.
|
# File 'lib/vips8/methods.rb', line 1221
|
permalink #maplut(lut, opts = {}) ⇒ Vips::Image
Map an image though a lut.
|
# File 'lib/vips8/methods.rb', line 1473
|
permalink #match(sec, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {}) ⇒ Vips::Image
First-order match of two images.
|
# File 'lib/vips8/methods.rb', line 1781
|
permalink #math(math, opts = {}) ⇒ Vips::Image
Apply a math operation to an image.
|
# File 'lib/vips8/methods.rb', line 98
|
permalink #math2(right, math2, opts = {}) ⇒ Vips::Image
Binary math operations.
|
# File 'lib/vips8/methods.rb', line 59
|
permalink #math2_const(c, math2, opts = {}) ⇒ Vips::Image
Pow( @in, @c ).
|
# File 'lib/vips8/methods.rb', line 140
|
permalink #matrixprint(opts = {}) ⇒ nil
Print matrix.
|
# File 'lib/vips8/methods.rb', line 1054
|
permalink #matrixsave(filename, opts = {}) ⇒ nil
Save image to matrix file.
|
# File 'lib/vips8/methods.rb', line 1046
|
permalink #max(opts = {}) ⇒ Float, Hash<Symbol => Object>
Find image maximum.
|
# File 'lib/vips8/methods.rb', line 175
|
permalink #maxpos ⇒ Real
Return the coordinates of the image maximum.
995 996 997 998 999 1000 |
# File 'lib/vips8/image.rb', line 995 def maxpos v, opts = max :x => true, :y => true x = opts['x'] y = opts['y'] return v, x, y end |
permalink #measure(h, v, opts = {}) ⇒ Vips::Image
Measure a set of patches on a colour chart.
|
# File 'lib/vips8/methods.rb', line 239
|
permalink #median(size = 3) ⇒ Image
a median filter
1031 1032 1033 |
# File 'lib/vips8/image.rb', line 1031 def median(size = 3) rank(size, size, (size * size) / 2) end |
permalink #merge(sec, direction, dx, dy, opts = {}) ⇒ Vips::Image
Merge two images.
|
# File 'lib/vips8/methods.rb', line 1729
|
permalink #min(opts = {}) ⇒ Float, Hash<Symbol => Object>
Find image minimum.
|
# File 'lib/vips8/methods.rb', line 164
|
permalink #minpos ⇒ Real
Return the coordinates of the image minimum.
1006 1007 1008 1009 1010 1011 |
# File 'lib/vips8/image.rb', line 1006 def minpos v, opts = min :x => true, :y => true x = opts['x'] y = opts['y'] return v, x, y end |
permalink #morph(mask, morph, opts = {}) ⇒ Vips::Image
Morphology operation.
|
# File 'lib/vips8/methods.rb', line 1630
|
permalink #mosaic(sec, direction, xref, yref, xsec, ysec, opts = {}) ⇒ Vips::Image, Hash<Symbol => Object>
Mosaic two images.
|
# File 'lib/vips8/methods.rb', line 1739
|
permalink #mosaic1(sec, direction, xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, opts = {}) ⇒ Vips::Image
First-order mosaic of two images.
|
# File 'lib/vips8/methods.rb', line 1760
|
permalink #msb(opts = {}) ⇒ Vips::Image
Pick most-significant byte from an image.
|
# File 'lib/vips8/methods.rb', line 514
|
permalink #multiply(right, opts = {}) ⇒ Vips::Image
Multiply two images.
|
# File 'lib/vips8/methods.rb', line 27
|
permalink #percent(percent, opts = {}) ⇒ Integer
Find threshold for percent of pixels.
|
# File 'lib/vips8/methods.rb', line 1480
|
permalink #phasecor(in2, opts = {}) ⇒ Vips::Image
Calculate phase correlation.
|
# File 'lib/vips8/methods.rb', line 1624
|
permalink #pngsave(filename, opts = {}) ⇒ nil
Save image to png file.
|
# File 'lib/vips8/methods.rb', line 1102
|
permalink #pngsave_buffer(opts = {}) ⇒ Vips::Blob
Save image to png buffer.
|
# File 'lib/vips8/methods.rb', line 1114
|
permalink #polar ⇒ Image
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.
1058 1059 1060 |
# File 'lib/vips8/image.rb', line 1058 def polar Image::run_cmplx(self) {|x| x.complex :polar} end |
permalink #ppmsave(filename, opts = {}) ⇒ nil
Save image to ppm file.
|
# File 'lib/vips8/methods.rb', line 1027
|
permalink #premultiply(opts = {}) ⇒ Vips::Image
Premultiply image alpha.
|
# File 'lib/vips8/methods.rb', line 465
|
permalink #profile(opts = {}) ⇒ Array<] First non-zero pixel in column, First non-zero pixel in row
Find image profiles.
|
# File 'lib/vips8/methods.rb', line 234
|
permalink #project(opts = {}) ⇒ Array<] Sums of columns, Sums of rows
Find image projections.
|
# File 'lib/vips8/methods.rb', line 229
|
permalink #quadratic(coeff, opts = {}) ⇒ Vips::Image
Resample an image with a quadratic transform.
|
# File 'lib/vips8/methods.rb', line 1254
|
permalink #rad2float(opts = {}) ⇒ Vips::Image
Unpack radiance coding to float rgb.
|
# File 'lib/vips8/methods.rb', line 1384
|
permalink #radsave(filename, opts = {}) ⇒ nil
Save image to radiance file.
|
# File 'lib/vips8/methods.rb', line 1019
|
permalink #rank(width, height, index, opts = {}) ⇒ Vips::Image
Rank filter.
|
# File 'lib/vips8/methods.rb', line 1637
|
permalink #rawsave(filename, opts = {}) ⇒ nil
Save image to raw file.
|
# File 'lib/vips8/methods.rb', line 1061
|
permalink #rawsave_fd(fd, opts = {}) ⇒ nil
Write raw image to file descriptor.
|
# File 'lib/vips8/methods.rb', line 1069
|
permalink #real ⇒ Image
Return the real part of a complex image.
1038 1039 1040 |
# File 'lib/vips8/image.rb', line 1038 def real complexget :real end |
permalink #recomb(m, opts = {}) ⇒ Vips::Image
Linear recombination with matrix.
|
# File 'lib/vips8/methods.rb', line 440
|
permalink #rect ⇒ Image
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.
1071 1072 1073 |
# File 'lib/vips8/image.rb', line 1071 def rect Image::run_cmplx(self) {|x| x.complex :rect} end |
permalink #relational(right, relational, opts = {}) ⇒ Vips::Image
Relational operation on two images.
|
# File 'lib/vips8/methods.rb', line 39
|
permalink #relational_const(c, relational, opts = {}) ⇒ Vips::Image
Relational operations against a constant.
|
# File 'lib/vips8/methods.rb', line 120
|
permalink #remainder(right, opts = {}) ⇒ Vips::Image
Remainder after integer division of two images.
|
# File 'lib/vips8/methods.rb', line 46
|
permalink #remainder_const(c, opts = {}) ⇒ Vips::Image
Remainder after integer division of an image and a constant.
|
# File 'lib/vips8/methods.rb', line 127
|
permalink #replicate(across, down, opts = {}) ⇒ Vips::Image
Replicate an image.
|
# File 'lib/vips8/methods.rb', line 408
|
permalink #resize(scale, opts = {}) ⇒ Vips::Image
Resize an image.
|
# File 'lib/vips8/methods.rb', line 1285
|
permalink #rint ⇒ Image
Return the nearest integral value.
947 948 949 |
# File 'lib/vips8/image.rb', line 947 def rint round :rint end |
permalink #rot(angle, opts = {}) ⇒ Vips::Image
Rotate an image.
|
# File 'lib/vips8/methods.rb', line 422
|
permalink #rot180 ⇒ Image
Rotate by 180 degrees clockwise.
1205 1206 1207 |
# File 'lib/vips8/image.rb', line 1205 def rot180 rot :d180 end |
permalink #rot270 ⇒ Image
Rotate by 270 degrees clockwise.
1212 1213 1214 |
# File 'lib/vips8/image.rb', line 1212 def rot270 rot :d270 end |
permalink #rot45(opts = {}) ⇒ Vips::Image
Rotate an image.
|
# File 'lib/vips8/methods.rb', line 428
|
permalink #rot90 ⇒ Image
Rotate by 90 degrees clockwise.
1198 1199 1200 |
# File 'lib/vips8/image.rb', line 1198 def rot90 rot :d90 end |
permalink #round(round, opts = {}) ⇒ Vips::Image
Perform a round function on an image.
|
# File 'lib/vips8/methods.rb', line 114
|
permalink #scale(opts = {}) ⇒ Vips::Image
Scale an image to uchar.
|
# File 'lib/vips8/methods.rb', line 485
|
permalink #scRGB2BW(opts = {}) ⇒ Vips::Image
Convert scrgb to bw.
|
# File 'lib/vips8/methods.rb', line 1461
|
permalink #scRGB2sRGB(opts = {}) ⇒ Vips::Image
Convert an scrgb image to srgb.
|
# File 'lib/vips8/methods.rb', line 1467
|
permalink #scRGB2XYZ(opts = {}) ⇒ Vips::Image
Transform scrgb to xyz.
|
# File 'lib/vips8/methods.rb', line 1344
|
permalink #sequential(opts = {}) ⇒ Vips::Image
Check sequential access.
|
# File 'lib/vips8/methods.rb', line 292
|
permalink #set(name, value) ⇒ Object
Set a GValue
on an image
|
# File 'lib/vips8/image.rb', line 655
|
permalink #set_value(name, value) ⇒ Object
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.
700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 |
# File 'lib/vips8/image.rb', line 700 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 |
permalink #sharpen(opts = {}) ⇒ Vips::Image
Unsharp masking for print.
|
# File 'lib/vips8/methods.rb', line 1583
|
permalink #shrink(xshrink, yshrink, opts = {}) ⇒ Vips::Image
Shrink an image.
|
# File 'lib/vips8/methods.rb', line 1228
|
permalink #shrink2(xshrink, yshrink, opts = {}) ⇒ Vips::Image
Shrink an image.
|
# File 'lib/vips8/methods.rb', line 1247
|
permalink #shrinkh(xshrink, opts = {}) ⇒ Vips::Image
Shrink an image horizontally.
|
# File 'lib/vips8/methods.rb', line 1235
|
permalink #shrinkv(yshrink, opts = {}) ⇒ Vips::Image
Shrink an image vertically.
|
# File 'lib/vips8/methods.rb', line 1241
|
permalink #sign(opts = {}) ⇒ Vips::Image
Unit vector of pixel.
|
# File 'lib/vips8/methods.rb', line 109
|
permalink #similarity(opts = {}) ⇒ Vips::Image
Similarity transform of an image.
|
# File 'lib/vips8/methods.rb', line 1273
|
permalink #sin ⇒ Image
Return the sine of an image in degrees.
1090 1091 1092 |
# File 'lib/vips8/image.rb', line 1090 def sin math :sin end |
permalink #spcor(ref, opts = {}) ⇒ Vips::Image
Spatial correlation.
|
# File 'lib/vips8/methods.rb', line 1577
|
permalink #spectrum(opts = {}) ⇒ Vips::Image
Make displayable power spectrum.
|
# File 'lib/vips8/methods.rb', line 1619
|
permalink #sRGB2HSV(opts = {}) ⇒ Vips::Image
Transform srgb to hsv.
|
# File 'lib/vips8/methods.rb', line 1399
|
permalink #sRGB2scRGB(opts = {}) ⇒ Vips::Image
Convert an srgb image to scrgb.
|
# File 'lib/vips8/methods.rb', line 1456
|
permalink #stats(opts = {}) ⇒ Vips::Image
Find image average.
|
# File 'lib/vips8/methods.rb', line 191
|
permalink #stdif(width, height, opts = {}) ⇒ Vips::Image
Statistical difference.
|
# File 'lib/vips8/methods.rb', line 1486
|
permalink #subsample(xfac, yfac, opts = {}) ⇒ Vips::Image
Subsample an image.
|
# File 'lib/vips8/methods.rb', line 506
|
permalink #subtract(right, opts = {}) ⇒ Vips::Image
Subtract two images.
|
# File 'lib/vips8/methods.rb', line 21
|
permalink #tan ⇒ Image
Return the tangent of an image in degrees.
1104 1105 1106 |
# File 'lib/vips8/image.rb', line 1104 def tan math :tan end |
permalink #tiffsave(filename, opts = {}) ⇒ nil
Save image to tiff file.
|
# File 'lib/vips8/methods.rb', line 1190
|
permalink #tilecache(opts = {}) ⇒ Vips::Image
Cache an image as a set of tiles.
|
# File 'lib/vips8/methods.rb', line 272
|
permalink #unpremultiply(opts = {}) ⇒ Vips::Image
Unpremultiply image alpha.
|
# File 'lib/vips8/methods.rb', line 471
|
permalink #vipssave(filename, opts = {}) ⇒ nil
Save image to vips file.
|
# File 'lib/vips8/methods.rb', line 1077
|
permalink #webpsave(filename, opts = {}) ⇒ nil
Save image to webp file.
|
# File 'lib/vips8/methods.rb', line 1171
|
permalink #webpsave_buffer(opts = {}) ⇒ Vips::Blob
Save image to webp buffer.
|
# File 'lib/vips8/methods.rb', line 1181
|
permalink #wrap(opts = {}) ⇒ Vips::Image
Wrap image origin.
|
# File 'lib/vips8/methods.rb', line 492
|
permalink #write_to_buffer(format_string, opts = {}) ⇒ String
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.
604 605 606 607 608 609 610 611 612 613 614 615 616 617 |
# File 'lib/vips8/image.rb', line 604 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 buffer = Vips::call_base saver, self, option_string, [opts] write_gc return buffer end |
permalink #write_to_file(name, opts = {}) ⇒ Object
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.
566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/vips8/image.rb', line 566 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] write_gc end |
permalink #XYZ2Lab(opts = {}) ⇒ Vips::Image
Transform xyz to lab.
|
# File 'lib/vips8/methods.rb', line 1308
|
permalink #XYZ2scRGB(opts = {}) ⇒ Vips::Image
Transform xyz to scrgb.
|
# File 'lib/vips8/methods.rb', line 1349
|
permalink #XYZ2Yxy(opts = {}) ⇒ Vips::Image
Transform xyz to yxy.
|
# File 'lib/vips8/methods.rb', line 1334
|
permalink #Yxy2XYZ(opts = {}) ⇒ Vips::Image
Transform yxy to xyz.
|
# File 'lib/vips8/methods.rb', line 1339
|
permalink #zoom(xfac, yfac, opts = {}) ⇒ Vips::Image
Zoom an image.
|
# File 'lib/vips8/methods.rb', line 499
|
permalink #|(other) ⇒ Image
Integer bitwise OR with an image, constant or array.
799 800 801 802 |
# File 'lib/vips8/image.rb', line 799 def |(other) other.is_a?(Vips::Image) ? boolean(other, :or) : boolean_const(other, :or) end |
permalink #~ ⇒ Image
Equivalent to image ^ -1
832 833 834 |
# File 'lib/vips8/image.rb', line 832 def ~ self ^ -1 end |