Expand description
Image Processing Functions
Modules§
- colorops
- Functions for altering and converting the color of pixelbufs
Structs§
- BiLevel
- A bi-level color map
Enums§
- Filter
Type - Available Sampling Filters.
Traits§
- Color
Map - A color map
Functions§
- blur
- Performs a Gaussian blur on the supplied image.
sigma
is a measure of how much to blur by. Usecrate::imageops::fast_blur()
for a faster but less accurate version. This method assumes alpha pre-multiplication for images that contain non-constant alpha. - brighten
- Brighten the supplied image.
value
is the amount to brighten each pixel by. Negative values decrease the brightness and positive values increase it. - contrast
- Adjust the contrast of the supplied image.
contrast
is the amount to adjust the contrast by. Negative values decrease the contrast and positive values increase the contrast. - crop
- Return a mutable view into an image The coordinates set the position of the top left corner of the crop.
- crop_
imm - Return an immutable view into an image The coordinates set the position of the top left corner of the crop.
- dither
- Reduces the colors of the image using the supplied
color_map
while applying Floyd-Steinberg dithering to improve the visual conception - fast_
blur - Approximation of Gaussian blur after Kovesi, P.: Fast Almost-Gaussian Filtering The Australian Pattern Recognition Society Conference: DICTA 2010. December 2010. Sydney. This method assumes alpha pre-multiplication for images that contain non-constant alpha.
- filter3x3
- Perform a 3x3 box filter on the supplied image.
kernel
is an array of the filter weights of length 9. - flip_
horizontal - Flip an image horizontally
- flip_
horizontal_ in - Flip an image horizontally and put the result into the destination
ImageBuffer
. - flip_
horizontal_ in_ place - Flip an image horizontally in place.
- flip_
vertical - Flip an image vertically
- flip_
vertical_ in - Flip an image vertically and put the result into the destination
ImageBuffer
. - flip_
vertical_ in_ place - Flip an image vertically in place.
- grayscale
- Convert the supplied image to grayscale. Alpha channel is discarded.
- grayscale_
alpha - Convert the supplied image to grayscale. Alpha channel is preserved.
- grayscale_
with_ type - Convert the supplied image to a grayscale image with the specified pixel type. Alpha channel is discarded.
- grayscale_
with_ type_ alpha - Convert the supplied image to a grayscale image with the specified pixel type. Alpha channel is preserved.
- horizontal_
gradient - Fill the image with a linear horizontal gradient
- huerotate
- Hue rotate the supplied image.
value
is the degrees to rotate each pixel by. 0 and 360 do nothing, the rest rotates by the given degree value. just like the css webkit filter hue-rotate(180) - index_
colors - Reduces the colors using the supplied
color_map
and returns an image of the indices - interpolate_
bilinear - Linearly sample from an image using coordinates in [0, w-1] and [0, h-1].
- interpolate_
nearest - Sample from an image using coordinates in [0, w-1] and [0, h-1], taking the nearest pixel.
- invert
- Invert each pixel within the supplied image. This function operates in place.
- overlay
- Overlay an image at a given coordinate (x, y)
- overlay_
bounds - Calculate the region that can be copied from top to bottom.
- replace
- Replace the contents of an image at a given coordinate (x, y)
- resize
- Resize the supplied image to the specified dimensions.
nwidth
andnheight
are the new dimensions.filter
is the sampling filter to use. This method assumes alpha pre-multiplication for images that contain non-constant alpha. - rotate90
- Rotate an image 90 degrees clockwise.
- rotate90_
in - Rotate an image 90 degrees clockwise and put the result into the destination
ImageBuffer
. - rotate180
- Rotate an image 180 degrees clockwise.
- rotate270
- Rotate an image 270 degrees clockwise.
- rotate180_
in - Rotate an image 180 degrees clockwise and put the result into the destination
ImageBuffer
. - rotate180_
in_ place - Rotate an image 180 degrees clockwise in place.
- rotate270_
in - Rotate an image 270 degrees clockwise and put the result into the destination
ImageBuffer
. - sample_
bilinear - Linearly sample from an image using coordinates in [0, 1].
- sample_
nearest - Sample from an image using coordinates in [0, 1], taking the nearest coordinate.
- thumbnail
- Resize the supplied image to the specific dimensions.
- tile
- Tile an image by repeating it multiple times
- unsharpen
- Performs an unsharpen mask on the supplied image.
sigma
is the amount to blur the image by.threshold
is the threshold for minimal brightness change that will be sharpened. - vertical_
gradient - Fill the image with a linear vertical gradient