Lua bindings to ImageMagick's MagicWand for LuaJIT using FFI.
Reimplement magick
This library is under early development.
You'll need both LuaJIT (any version) and MagickWand.
To use ImageMagick, you might run:
On Ubuntu
$ sudo apt-get install libmagickwand-dev
On Centos
$ sudo yum install ImageMagick ImageMagick-devel
On MacOS
$ brew install imagemagick
It's recommended to use opm to install lua-resty-imagick.
$ opm install lua-resty-imagick
If you just need to resize/crop an image, use the thumb
function. It provides
a shorthand syntax for common operations.
local magick = require("resty.imagick")
magick.thumb("input.png", "100x100", "output.png")
The second argument to thumb
is a size string, it can have the following
kinds of values:
"500x300" -- Resize image such that the aspect ratio is kept,
-- the width does not exceed 500 and the height does
-- not exceed 300
"500x300!" -- Resize image to 500 by 300, ignoring aspect ratio
"500x" -- Resize width to 500 keep aspect ratio
"x300" -- Resize height to 300 keep aspect ratio
"50%x20%" -- Resize width to 50% and height to 20% of original
"500x300#" -- Resize image to 500 by 300, but crop either top
-- or bottom to keep aspect ratio
"500x300+10+20" -- Crop image to 500 by 300 at position 10,20
If you need more advanced image operations, you'll need to work with the
Image
object. Read on.
All functions contained in the table returned by require("resty.imagick")
.
Loads and resizes image. Write output to out_fname
if provided, otherwise
return image blob. (input_fname
can optionally be an instance of Image
)
Return a new Image
instance, loaded from filename. Returns nil
and error
message if image could not be loaded.
Loads an image from a Lua string containing the binary image data.
Calling load_image
or load_image_from_blob
returns an Image
object.
local magick = require "resty.imagick"
local img = assert(magick.load_image("hello.png"))
print("width:", img:get_width(), "height:", img:get_height());
img:resize(200, 200)
img:write("resized.png")
Images are automatically freed from memory by LuaJIT's garbage collector, but
images can take up a lot of space in memory when loaded so it's recommended to
call destroy
on the image object as soon as possible.
Load ImageMagick directly:
magick = requrie "resty.imagick.wand"
local img = magick.load_image("some_image.png")
Methods mutate the current image when appropriate. Use clone
to get an
independent copy.
Resizes the image, f
is resize function, see Filer Types
Resizes the image using adaptive resize
Crops image to w
,h
where the top left is x
, y
Blurs the image with specified paramaters. See Blur Arguments
Rotates the image by specified number of degrees. The image dimensions will
enlarge to prevent cropping. The triangles on the corners are filled with the
color specified by r
, g
, b
. The color components are specified as
floating point numbers from 0 to 1.
Sharpens the image with specified parameters. See Sharpening Images
Resizes the image to w
,h
. The image will be cropped if necessary to
maintain its aspect ratio.
Returns Lua string containing the binary data of the image. The blob is
formatated the same as the image's current format (eg. PNG, Gif, etc.). Use
image:set_format
to change the format.
Writes the the image to disk
Gets the width of the image
Gets the height of the image
Gets the current format of image as a file extension like "png"
or "bmp"
.
Use image:set_format
to change the format.
Sets the format of the image, takes a file extension like "png"
or "bmp"
Gets the image compression quality.
Sets the image compression quality.
Gets the image gravity type.
Sets the image's gravity type:
gravity
can be one of the values listed in data.lua
Returns all the option names that match the specified pattern associated with a
image (e.g img:get_option("webp", "lossless")
)
Associates one or options with the img (e.g img:set_option("webp", "lossless", "0")
)
Scale the size of an image to the given dimensions.
Coalesces the current image by compositing each frame on the previous frame. This un-optimized animated images to make them suitable for other methods.
Composite another image onto another at the specified offset x
, y
.
compose
can be one of the values listed in data.lua
Strips image of all profiles and comments, useful for removing exif and other data
Get the r,g,b,a color components of a pixel in the image as doubles from 0
to 1
Returns a copy of the image.
Adjust the brightness, saturation, and hue of the image. See Modulate Brightness, Saturation, and Hue
Mutates the image to be a thumbnail. Uses the same size string format described at the top of this README.
Immediately frees the memory associated with the image, it is invalid to use the image after calling this method. It is unecessary to call this method normally as images are tracked by the garbage collector.
Animates an image or image sequence.
Like MagickThresholdImage() but forces all pixels below the threshold into black while leaving all pixels above the threshold unchanged.
Surrounds the image with a border of the color defined by the bordercolor pixel wand.
Simulates a charcoal drawing.
Removes a region of an image and collapses the image to occupy the removed portion.
Restricts the color range from 0 to the quantum depth.
Clips along the first path from the 8BIM profile, if present.
Clips along the named paths from the 8BIM profile, if present. Later operations take effect inside the path. Id may be a number if preceded with #, to work on a numbered path, e.g., "#1" to use the first path.
Replaces colors in the image from a color lookup table.
Accepts a lightweight Color Correction Collection (CCC) file which solely contains one or more color corrections and applies the color correction to the image. Here is a sample CCC file:
<ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2">
<ColorCorrection id="cc03345">
<SOPNode>
<Slope> 0.9 1.2 0.5 </Slope>
<Offset> 0.4 -0.5 0.6 </Offset>
<Power> 1.0 0.8 1.5 </Power>
</SOPNode>
<SATNode>
<Saturation> 0.85 </Saturation>
</SATNode>
</ColorCorrection>
</ColorCorrectionCollection>
which includes the offset, slope, and power for each of the RGB channels as well as the saturation.
Blends the fill color with each pixel in the image.
Apply color transformation to an image. The method permits saturation changes, hue rotation, luminance to alpha, and various other effects. Although variable-sized transformation matrices can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6 for CMYKA (or RGBA with offsets). The matrix is similar to those used by Adobe Flash except offsets are in column 6 rather than 5 (in support of CMYKA images) and offsets are normalized (divide Flash offset by 255).
Combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified hannels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.
Adds a comment to your image.
Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.
Composite the images in the source wand over the images in the destination wand in sequence, starting with the current image in both lists.
Each layer from the two image lists are composted together until the end of one of the image lists is reached. The offset of each composition is also adjusted to match the virtual canvas offsets of each layer. As such the given offset is relative to the virtual canvas, and not the actual image.
Composition uses given x and y offsets, as the 'origin' location of the source images virtual canvas (not the real image) allowing you to compose a list of 'layer images' into the destiantioni images. This makes it well sutiable for directly composing 'Clears Frame Animations' or 'Coaleased Animations' onto a static or other 'Coaleased Animation' destination image list. GIF disposal handling is not looked at.
Special case:- If one of the image sequences is the last image (just a single image remaining), that image is repeatally composed with all the images in the other image list. Either the source or destination lists may be the single image, for this situation.
In the case of a single destination image (or last image given), that image will ve cloned to match the number of images remaining in the source image list.
This is equivelent to the "-layer Composite" Shell API operator.
Compares an image to a reconstructed image and returns the specified difference image.
Composite one image onto another using the specified gravity.
Enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.
Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available. You can also reduce the influence of a particular channel with a gamma value of 0.
Applies a custom convolution kernel to the image.
Displaces an image's colormap by a given number of positions. If you cycle the colormap a number of times you can produce a psychodelic effect.
Adds an image to the wand comprised of the pixel data you supply. The pixel data must be in scanline order top-to-bottom. The data can be char, short int, int, float, or double. Float and double require the pixels to be normalized [0..1], otherwise [0..Max], where Max is the maximum value the type can accomodate (e.g. 255 for char).
Converts cipher pixels to plain pixels.
Compares each image with the next in a sequence and returns the maximum bounding region of any pixel differences it discovers.
Removes skew from the image. Skew is an artifact that occurs in scanned images because of the camera being misaligned, imperfections in the scanning or surface, or simply because the paper was not placed completely flat when scanned.
Reduces the speckle noise in an image while perserving the edges of the original image.
Displays an image.
Displays an image or image sequence.
Distorts an image using various distortion methods, by mapping color lookups of the source image to a new destination image usally of the same size as the source image, unless 'bestfit' is set to true.
If 'bestfit' is enabled, and distortion allows it, the destination image is adjusted to ensure the whole source 'image' will just fit within the final destination image, which will be sized and offset accordingly. Also in many cases the virtual offset of the source image will be taken into account in the mapping.
Renders the drawing wand on the current image.
Enhance edges within the image with a convolution filter of the given radius. Use a radius of 0 and Edge() selects a suitable radius for you.
Returns a grayscale image with a three-dimensional effect. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and Emboss() selects a suitable radius for you.
Converts plaint pixels to cipher pixels.
Applies a digital filter that improves the quality of a noisy image.
Equalizes the image histogram.
Applys an arithmetic, relational, or logical expression to an image. Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.
Extracts pixel data from an image and returns it to you. The method returns True on success otherwise False if an error is encountered. The data is returned as char, short int, int, ssize_t, float, or double in the order specified by map.
Suppose you want to extract the first scanline of a 640x480 image as character data in red-green-blue order: img:export_pixels(0, 0, 640, 1, "RGB", "Char", pixels)
Extends the image as defined by the geometry, gravity, and wand background color. Set the (x,y) offset of the geometry to move the original wand relative to the extended wand.
Creates a vertical mirror image by reflecting the pixels around the central x-axis.
Changes the color value of any pixel that matches target and is an immediate neighbor. If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.
Creates a horizontal mirror image by reflecting the pixels around the central y-axis.
Implements the discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.
Implements the inverse discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.
Adds a simulated three-dimensional border around the image. The width and height specify the border width of the vertical and horizontal sides of the frame. The inner and outer bevels indicate the width of the inner and outer shadows of the frame.
Applys an arithmetic, relational, or logical expression to an image. Use these operators to lighten or darken an image, to increase or decrease contrast in an image, or to produce the "negative" of an image.
Evaluate expression for each pixel in the image.
Gamma-corrects an image. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.
You can also reduce the influence of a particular channel with a gamma value of 0.
Blurs an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, the radius should be larger than sigma. Use a radius of 0 and gaussian_blur() selects a suitable radius for you.
Gets the image at the current image index.
Returns False if the image alpha channel is not activated. That is, the image is RGB rather than RGBA or CMYK rather than CMYKA.
Gets the image clip mask at the current image index.
Returns the image background color.
Implements direct to memory image formats. It returns the image sequence as a blob and its length. The format of the image determines the format of the returned blob (GIF, JPEG, PNG, etc.).
Returns the chromaticy blue primary point for the image.
Returns the chromaticy red primary point.
Returns the image border color.
Gets the kurtosis and skewness of one or more image channels.
Gets the mean and standard deviation of one or more image channels.
Gets the range for one or more image channels.
Returns the color of the specified colormap index.
Gets the number of unique colors in the image.
Gets the image colorspace.
Returns the composite operator associated with the image.
Gets the image compression.
Gets the image delay.
Gets the image disposal method.
Gets the image endian.
Returns the filename of a particular image in a sequence.
Gets the image fuzz.
Gets the image gamma.
Returns the image histogram as an array of PixelWand wands.
Returns the interpolation method for the sepcified image.
Gets the image iterations.
Returns the image matte color.
Returns the page geometry associated with the image.
Returns the color of the specified pixel.
Extracts a region of the image and returns it as a a new wand.
Gets the image rendering intent.
Gets the image X and Y resolution.
Gets the image scene.
Generates an SHA-256 message digest for the image pixel stream.
Gets the image ticks-per-second.
Gets the potential image type:
Bilevel Grayscale GrayscaleMatte Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte
Gets the image units of resolution.
Returns the virtual pixel method for the sepcified image.
Returns the chromaticy white point.
Returns the number of images associated with a magick wand.
Replaces colors in the image from a Hald color lookup table. A Hald color lookup table is a 3-dimensional color cube mapped to 2 dimensions. Create it with the HALD coder. You can apply any color transformation to the Hald image and then use this method to apply the transform to the image.
Returns True if the wand has more images when traversing the list in the forward direction.
Returns True if the wand has more images when traversing the list in the reverse direction.
Identifies an image by printing its attributes to the file. Attributes include the image width, height, size, and others.
Gets the potential image type:
Bilevel Grayscale GrayscaleMatte Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte
Creates a new image that is a copy of an existing one with the image pixels "implode" by the specified percentage. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Accepts pixel datand stores it in the image at the location you specify. The method returns False on success otherwise True if an error is encountered. The pixel data can be either char, short int, int, ssize_t, float, or double in the order specified by map.
Suppose your want to upload the first scanline of a 640x480 image from character data in red-green-blue order:
img:import_pixels(0,0,640,1,"RGB","Char",pixels);
Resize image using a interpolative method.
Adds a label to your image.
Adjusts the levels of an image by scaling the colors falling between specified white and black points to the full available quantum range. The parameters provided represent the black, mid, and white points. The black point specifies the darkest color in the image. Colors darker than the black point are set to zero. Mid point specifies a gamma correction to apply to the image. White point specifies the lightest color in the image. Colors brighter than the white point are set to the maximum quantum value.
Stretches with saturation the image intensity.
Rescales image with seam carving.
Attempts to increase the appearance of large-scale light-dark transitions. Local contrast enhancement works similarly to sharpening with an unsharp mask, however the mask is instead created using an image with a greater blur distance.
A convenience method that scales an image proportionally to twice its original size.
A convenience method that scales an image proportionally to one-half its original size.
Composes all the image layers from the current given image onward to produce a single image of the merged layers.
The inital canvas's size depends on the given LayerMethod, and is initialized using the first images background color. The images are then compositied onto that image in sequence using the given composition that has been assigned to each individual image.
Creates a composite image by combining several separate images. The images are tiled on the composite image with the name of the image optionally appearing just below the individual tile.
Method morphs a set of images. Both the image pixels and size are linearly interpolated to give the appearance of a meta-morphosis from one image to the next.
Applies a user supplied kernel to the image according to the given mophology method.
Simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion.
Negates the colors in the reference image. The Grayscale option means that only grayscale values within the image are negated.
You can also reduce the influence of a particular channel with a gamma value of 0.
Adds a blank image canvas of the specified size and background color to the wand.
Sets the next image in the wand as the current image.
It is typically used after reset_iterator(), after which its first use will set the first image as the current image (unless the wand is empty).
It will return False when no more images are left to be returned which happens when the wand is empty, or the current image is the last image.
When the above condition (end of image list) is reached, the iterator is automaticall set so that you can start using previous() to again iterate over the images in the reverse direction, starting with the last image (again). You can jump to this condition immeditally using set_last_iterator().
Enhances the contrast of a color image by adjusting the pixels color to span the entire range of colors available
You can also reduce the influence of a particular channel with a gamma value of 0.
Applies a special effect filter that simulates an oil painting. Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.
Changes any pixel that matches color with the color defined by fill.
Compares each image the GIF disposed forms of the previous image in the sequence. From this it attempts to select the smallest cropped image to replace each frame, while preserving the results of the animation.
Takes a frame optimized GIF animation, and compares the overlayed pixels against the disposal image resulting from all the previous frames in the animation. Any pixel that does not change the disposal image (and thus does not effect the outcome of an overlay) is made transparent.
WARNING: This modifies the current images directly, rather than generate a new image sequence.
Performs an ordered dither based on a number of pre-defined dithering threshold maps, but over multiple intensity levels, which can be different for different channels, according to the input arguments.
The same as read() except the only valid information returned is the image width, height, size, and format. It is designed to efficiently obtain this information from a file without reading the entire image sequence into memory.
Pings an image or image sequence from a blob.
Pings an image or image sequence from an open file descriptor.
Simulates a Polaroid picture.
Reduces the image to a limited number of color level.
Tiles 9 thumbnails of the specified image with an image processing operation applied at varying strengths. This helpful to quickly pin-point an appropriate parameter for an image processing operation.
Sets the previous image in the wand as the current image.
It is typically used after set_last_iterator(), after which its first use will set the last image as the current image (unless the wand is empty).
It will return False when no more images are left to be returned which happens when the wand is empty, or the current image is the first image. At that point the iterator is than reset to again process images in the forward direction, again starting with the first image in list. Images added at this point are prepended.
Also at that point any images added to the wand using add() or read() will be prepended before the first image. In this sense the condition is not quite exactly the same as reset_iterator().
Analyzes the colors within a reference image and chooses a fixed number of colors to represent the image. The goal of the algorithm is to minimize the color difference between the input and output image while minimizing the processing time.
Analyzes the colors within a sequence of images and chooses a fixed number of colors to represent the image. The goal of the algorithm is to minimize the color difference between the input and output image while minimizing the processing time.
Rotational blurs an image.
Creates a simulated three-dimensional button-like effect by lightening and darkening the edges of the image. Members width and height of raise_info define the width of the vertical and horizontal edge of the effect.
Changes the value of individual pixels based on the intensity of each pixel compared to threshold. The result is a high-contrast, two color image.
Reads an image or image sequence. The images are inserted just before the current image pointer position.
Use set_first_iterator(), to insert new images before all the current images in the wand, set_last_iterator() to append add to the end, set_iterator_index() to place images just after the given index.
Reads an image or image sequence from a blob. In all other respects it is like read().
Reads an image or image sequence from an already opened file descriptor. Otherwise it is like read().
Replaces the colors of an image with the closest color from a reference image.
Removes an image from the image list.
Resample image to desired resolution.
Bessel Blackman Box Catrom Cubic Gaussian Hanning Hermite Lanczos Mitchell Point Quandratic Sinc Triangle
Most of the filters are FIR (finite impulse response), however, Bessel, Gaussian, and Sinc are IIR (infinite impulse response). Bessel and Sinc are windowed (brought down to zero) with the Blackman filter.
Offsets an image as defined by x and y.
Scales an image to the desired dimensions with pixel sampling. Unlike other scaling methods, this method does not introduce any additional color into the scaled image.
Segments an image by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy C-means technique.
Selectively blur an image within a contrast threshold. It is similar to the unsharpen mask that sharpens everything with contrast above a certain threshold.
Separates a channel from the image and returns a grayscale image. A channel is a particular color component of each pixel in the image.
Applies a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the sepia toning. A threshold of 80 is a good starting point for a reasonable tone.
Replaces the last image returned by set_interator_index(), next(), previous() with the images from the specified wand.
Activates, deactivates, resets, or sets the alpha channel.
Sets the image background color.
Sets the image chromaticity blue primary point.
Sets the image border color.
Sets image channel mask.
Sets image clip mask.
Set the entire wand canvas to the specified color.
Sets the color of the specified colormap index.
Sets the image colorspace. But does not modify the image data.
Sets the image composite operator, useful for specifying how to composite the image thumbnail when using the montage() method.
Sets the image compression.
Sets the image delay.
Sets the image disposal method.
Sets the image endian method.
Sets the image size (i.e. columns & rows).
Sets the filename of a particular image in a sequence.
Sets the image fuzz.
Sets the image gamma.
Sets the image chromaticity green primary point.
Sets the image interpolate pixel method.
Sets the image iterations.
Sets the image matte channel.
Sets the image alpha color.
Sets the page geometry of the image.
Sets the wand image progress monitor to the specified method and returns the previous progress monitor if any.
Sets the image chromaticity red primary point.
Sets the image rendering intent.
Sets the image resolution.
Sets the image scene.
Sets the image ticks-per-second.
Sets the image type.
Sets the image units of resolution
Sets the image virtual pixel method.
Sets the image chromaticity white point.
Shines a distant light on an image to create a three-dimensional effect. You control the positioning of the light with azimuth and elevation; azimuth is measured in degrees off the x axis and elevation is measured in pixels above the Z axis.
Simulates an image shadow.
Shaves pixels from the image edges. It allocates the memory necessary for the new Image structure and returns a pointer to the new image.
Slides one edge of an image along the X or Y axis, creating a parallelogram. An X direction shear slides an edge along the X axis, while a Y direction shear slides an edge along the Y axis. The amount of the shear is controlled by a shear angle. For X direction shears, x_shear is measured relative to the Y axis, and similarly, for Y direction shears y_shear is measured relative to the X axis. Empty triangles left over from shearing the image are filled with the background color.
Adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. Increase the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in the resultant image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to True to increase the image contrast otherwise the contrast is reduced.
Compares the reference image of the image and returns the best match offset. In addition, it returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between.
Simulates a pencil sketch. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and sketch() selects a suitable radius for you. Angle gives the angle of the blurring motion.
Takes all images from the current image pointer to the end of the image list and smushs them to each other top-to-bottom if the stack parameter is true, otherwise left-to-right.
Applies a special effect to the image, similar to the effect achieved in a photo darkroom by selectively exposing areas of photo sensitive paper to light. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the solarization.
Given a set of coordinates, interpolates the colors found at those coordinates, across the whole image, using various methods.
Splices a solid color into the image.
A special effects method that randomly displaces each pixel in a block defined by the radius parameter.
Replace each pixel with corresponding statistic from the neighborhood of the specified width and height.
Hides a digital watermark within the image. Recover the hidden watermark later to prove that the authenticity of an image. Offset defines the start position within the image to hide the watermark.
Composites two images and produces a single image that is the composite of a left and right image of a stereo pair.
Swirls the pixels about the center of the image, where degrees indicates the sweep of the arc through which each pixel is moved. You get a more dramatic effect as the degrees move from 1 to 360.
Repeatedly tiles the texture image across and down the image canvas.
Changes the value of individual pixels based on the intensity of each pixel compared to threshold.
Changes the size of an image to the given dimensions and removes any associated profiles. The goal is to produce small low cost thumbnail images suited for display on the Web.
Applies a color vector to each pixel in the image. The length of the vector is 0 for black and white and at its maximum for the midtones. The vector weighting function is f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
Transform the image colorspace, setting the images colorspace while transforming the images data to that colorspace.
Changes any pixel that matches color with the color defined by fill.
Remove edges that are the background color from the image.
Discards all but one of any pixel color.
Sharpens an image. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and UnsharpMaskImage() selects a suitable radius for you.
Softens the edges of the image in vignette style.
Creates a "ripple" effect in the image by shifting the pixels vertically along a sine wave whose amplitude and wavelength is specified by the given parameters.
Like threshold() but force all pixels above the threshold into white while leaving all pixels below the threshold unchanged.
Writes an image to the specified filename. If the filename parameter is NULL, the image is written to the filename set by read() or set_filename().
Writes an image to an open file descriptor.
Writes an image or image sequence.
Writes an image sequence to an open file descriptor.
kwanhur [email protected], VIPS Inc.
This module is licensed under the MIT License .
Copyright (C) 2018, by kwanhur [email protected], VIPS Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.