imager v0.42.7


Monthly downloads



Image Processing Library Based on 'CImg'

Fast image processing for images in up to 4 dimensions (two spatial dimensions, one time/depth dimension, one colour dimension). Provides most traditional image processing tools (filtering, morphology, transformations, etc.) as well as various functions for easily analysing image data using R. The package wraps 'CImg', <>, a simple, modern C++ library for image processing.

Functions in imager

Name Description
RasterPackage Convert a RasterLayer/RasterBrick to a cimg image/image list
as.cimg.function Create an image by sampling a function Create an image from a data.frame
add.colour Add colour channels to a grayscale image or pixel set Convert a pixel image to a data.frame
as.cimg.raster Convert a raster object to a cimg object
as.cimg.array Turn an numeric array into a cimg object
FFT Compute the Discrete Fourier Transform of an image
bbox Compute the bounding box of a pixset
as.cimg Convert to cimg object
as.igraph.cimg Form a graph from an image Convert image list to data.frame Methods to convert pixsets to various objects
boats Photograph of sailing boats from Kodak set
colorise Fill in a colour in an area given by a pixset
boundary Find the boundary of a shape in a pixel set
clean Clean up and fill in pixel sets (morphological opening and closing)
at Return or set pixel value at coordinates
autocrop Autocrop image region
blur_anisotropic Blur image anisotropically, in an edge-preserving way.
channels Split a colour image into a list of separate channels
capture.plot Capture the current R plot device as a cimg image
flatten.alpha Flatten alpha channel
deriche Apply recursive Deriche filter.
crop.borders Crop the outer margins of an image
extract_patches Extract image patches and return a list
hough_circle Circle detection using Hough transform
as.raster.cimg Convert a cimg object to a raster object for plotting
as.pixset Methods to convert various objects to pixsets
ci Concatenation for image lists
center.stencil Center stencil at a location
hough_line Hough transform for lines
boxblur Blur image with a box filter (square window)
as.igraph.pixset Form an adjacency graph from a pixset
display.list Display image list using CImg library
cimg2im Convert cimg to spatstat im object
cannyEdges Canny edge detector
bucketfill Bucket fill
common_pixsets Various useful pixsets
boxblur_xy Blur image with a box filter.
imager.replace Replace part of an image with another
cimg.extract Various shortcuts for extracting colour channels, frames, etc
distance_transform Compute Euclidean distance function to a specified value.
contours Return contours of image/pixset
diffusion_tensors Compute field of diffusion tensors for edge-preserving smoothing.
as.imlist.list Convert various objects to image lists
cimg.use.openmp Control CImg's parallelisation
cimg Create a cimg object
cimg.dimensions Image dimensions
erode Erode/dilate image by a structuring element.
displacement Estimate displacement field between two images.
draw_text Draw text on an image
frames Split a video into separate frames
imcoord Coordinates as images
imager.subset Array subset operator for cimg objects
display Display object using CImg library
coord.index Coordinates from pixel index
circles Add circles to plot
correlate Correlation/convolution of image by filter
get.locations Return coordinates of subset of pixels
get_gradient Compute image gradient.
get.stencil Return pixel values in a neighbourhood defined by a stencil
haar Compute Haar multiscale wavelet transform.
draw_rect Draw rectangle on image
draw_circle Draw circle on image
interp Interpolate image values Make/save a video using ffmpeg
is.cimg Checks that an object is a cimg object
imdirac Generates a "dirac" image, i.e. with all values set to 0 except one.
display.cimg Display image using CImg library
pixel.grid Return the pixel grid for an image
map_il Type-stable map for use with the purrr package
highlight Highlight pixel set on image
im_split Split an image along a certain axis (producing a list)
%inr% Check that value is in a range
grow Grow/shrink a pixel set
grayscale Convert an RGB image to grayscale
gsdim Grayscale dimensions of image
RGBtoHSL Colour space conversions in imager
imager.combine Combining images
pixset Pixel sets (pixsets)
plot.imlist Plot an image list
imsplit Split an image along a certain axis (producing a list)
imhessian Compute image hessian.
iminfo Return information on image file
imfill Create an image of custom size by filling in repeated values
imgradient Compute image gradient
get_hessian Return image hessian.
grab Select image regions interactively
imager imager: an R library for image processing, based on CImg
imlap Compute image Laplacian
px.flood Select a region of homogeneous colour
iiply Split an image, apply function, recombine the results as an image
idply Split an image along axis, map function, return a data.frame
imshift Shift image content.
imsharpen Sharpen image.
im2cimg Convert an image in spatstat format to an image in cimg format
imdraw Draw image on another image
ilply Split an image along axis, apply function, return a list
isoblur Blur image isotropically.
imsub Select part of an image
imappend Combine a list of images into a single image
is.imlist Check that an object is an imlist object
medianblur Blur image with the median filter. In a window of size n x n centered at pixel (x,y), compute median pixel value over the window. Optionally, ignore values that are too far from the value at current pixel.
is.pixset Check that an object is a pixset object
mirror Mirror image content along specified axis
label Label connected components.
imeval Evaluation in an image context
save.image Save image
rotate_xy Rotate image by an arbitrary angle, around a center point.
patchstat Return image patch summary
imchange Modify parts of an image Load a video using ffmpeg
imrotate Rotate an image along the XY plane.
imrep Replicate images
magick Convert a magick image to a cimg image or image list and vice versa
renorm Renormalise image
split_connected Split pixset into connected components
periodic.part Compute the periodic part of an image, using the periodic/smooth decomposition of Moisan (2011)
imlist Image list
load.example Load example image
imwarp Image warping
squeeze Remove empty dimensions from an array
resize Resize image
pad Pad image with n pixels along specified axis A pixset for NA values
warp Warp image
liply Apply function to each element of a list, then combine the result as an image by appending along specified axis
index.coord Linear index in internal vector from pixel coordinates
patch_summary_cimg Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.
vanvliet Young-Van Vliet recursive Gaussian filter.
load.image Load image from file or URL
px.remove_outer Remove all connected regions that touch image boundaries
load.dir Load all images in a directory
imnoise Generate (Gaussian) white-noise image
mutate_plyr Mutate a data frame by adding new or replacing existing columns.
nfline Plot a line, Hesse normal form parameterisation
plot.cimg Display an image using base graphics
where Return locations in pixel set
play Play a video
watershed Compute watershed transform.
implot Plot objects on image using base graphics
inpaint Fill-in NA values in an image
permute_axes Permute image axes
interact Build simple interactive interfaces using imager
%>% Pipe operator
resize_doubleXY Resize image uniformly
rm.alpha Remove alpha channel and store as attribute
threshold Threshold grayscale image
stencil.cross A cross-shaped stencil
No Results!

Vignettes of imager

No Results!

Last month downloads


Type Package
License LGPL-3
SystemRequirements fftw3,libtiff,C++11,X11
LinkingTo Rcpp
LazyData true
RoxygenNote 7.1.1
VignetteBuilder knitr
NeedsCompilation yes
Packaged 2021-01-26 00:58:19 UTC; tanuki
Repository CRAN
Date/Publication 2021-02-23 12:20:21 UTC

Include our badge in your README