imager: 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.

AuthorSimon Barthelme [aut, cre]
Date of publication2017-03-13 16:49:18
MaintainerSimon Barthelme <>

View on CRAN

Man pages

add.colour: Add colour channels to a grayscale image or pixel set

as.cimg: Convert to cimg object

as.cimg.array: Turn an numeric array into a cimg object Create an image from a data.frame

as.cimg.function: Create an image by sampling a function

as.cimg.raster: Convert a raster object to a cimg object Convert a pixel image to a data.frame Convert image list to data.frame Methods to convert pixsets to various objects

as.imlist: Convert various objects to image lists

as.pixset: Methods to convert various objects to pixsets

as.raster.cimg: Convert a cimg object to a raster object for plotting

at: Return or set pixel value at coordinates

autocrop: Autocrop image region

bbox: Compute the bounding box of a pixset

blur_anisotropic: Blur image anisotropically, in an edge-preserving way.

boats: Photograph of sailing boats from Kodak set

boundary: Find the boundary of a shape in a pixel set

boxblur: Blur image with a box filter (square window)

boxblur_xy: Blur image with a box filter.

bucketfill: Bucket fill

cannyEdges: Canny edge detector

capture.plot: Capture the current R plot device as a cimg image

center.stencil: Center stencil at a location

channels: Split a colour image into a list of separate channels

ci: Concatenation for image lists

cimg: Create a cimg object

cimg2im: Convert cimg to spatstat im object

cimg.dimensions: Image dimensions

cimg.extract: Various shortcuts for extracting colour channels, frames, etc

cimg.use.openmp: Control CImg's parallelisation

clean: Clean up and fill in pixel sets (morphological opening and...

common_pixsets: Various useful pixsets

contours: Return contours of image/pixset

convolve: Convolve image by filter.

coord.index: Coordinates from pixel index

correlate: Correlation of image by filter

crop.borders: Crop the outer margins of an image

deriche: Apply recursive Deriche filter.

diffusion_tensors: Compute field of diffusion tensors for edge-preserving...

displacement: Estimate displacement field between two images.

display: Display object using CImg library

display.cimg: Display image using CImg library

display.list: Display image list using CImg library

distance_transform: Compute Euclidean distance function to a specified value.

erode: Erode/dilate image by a structuring element.

extract_patches: Extract image patches and return a list

FFT: Compute the Discrete Fourier Transform of an image

flatten.alpha: Flatten alpha channel

frames: Split a video into separate frames

get_gradient: Compute image gradient.

get_hessian: Return image hessian.

get.locations: Return coordinates of subset of pixels

get.stencil: Return pixel values in a neighbourhood defined by a stencil

grab: Select image regions interactively

grapes-inr-grapes: Check that value is in a range

grayscale: Convert an RGB image to grayscale

grow: Grow/shrink a pixel set

haar: Compute Haar multiscale wavelet transform.

highlight: Highlight pixel set on image

idply: Split an image along axis, apply function, return a...

iiply: Split an image, apply function, recombine the results as an...

ilply: Split an image along axis, apply function, return a list

im2cimg: Convert an image in spatstat format to an image in cimg...

imager: imager: an R library for image processing, based on CImg

imager.colourspaces: Colour space conversions in imager

imager.combine: Combining images

imager.replace: Replace part of an image with another

imager.subset: Array subset operator for cimg objects

imappend: Combine a list of images into a single image

imcoord: Coordinates as images

imdirac: Generates a "dirac" image, i.e. with all values set to 0...

imdraw: Draw image on another image

imeval: Pixel-wise evaluation of a CImg expression

imfill: Create an image of custom size by filling in repeated values

imgradient: Compute image gradient

imhessian: Compute image hessian.

iminfo: Return information on image file

imlap: Compute image Laplacian

imlist: Image list

imnoise: Generate (Gaussian) white-noise image

implot: Plot objects on image using base graphics

imrep: Replicate images

imrotate: Rotate an image along the XY plane.

imsharpen: Sharpen image.

imshift: Shift image content.

imsplit: Split an image along a certain axis (producing a list)

im_split: Split an image along a certain axis (producing a list)

imsub: Select part of an image

imwarp: Image warping

index.coord: Linear index in internal vector from pixel coordinates

interp: Interpolate image values

is.cimg: Checks that an object is a cimg object

is.imlist: Check that an object is an imlist object

isoblur: Blur image isotropically.

is.pixset: Check that an object is a pixset object

label: Label connected components.

liply: Apply function to each element of a list, then combine the...

load.example: Load example image

load.image: Load image from file or URL Load a video using ffmpeg

magick: Convert a magick image to a cimg image or image list Make/save a video using ffmpeg

map_il: Type-stable map for use with the purrr package

medianblur: Blur image with the median filter. In a window of size n x n...

mirror: Mirror image content along specified axis

pad: Pad image with n pixels along specified axis

patchstat: Return image patch summary

patch_summary_cimg: Extract a numerical summary from image patches, using CImg's...

periodic.part: Compute the periodic part of an image, using the...

permute_axes: Permute image axes

pixel.grid: Return the pixel grid for an image

pixset: Pixel sets (pixsets)

play: Play a video

plot.cimg: Display an image using base graphics

plot.imlist: Plot an image list

px.flood: Select a region of homogeneous colour A pixset for NA values

RasterPackage: Convert a RasterLayer/RasterBrick to a cimg image/image list

renorm: Renormalise image

resize: Resize image to new dimensions. If pd[x,y,z,v]<0, it...

resize_uniform: Resize image uniformly

rm.alpha: Remove alpha channel and store as attribute

rotate_xy: Rotate image by an arbitrary angle, around a center point.

save.image: Save image

split_connected: Split pixset into connected components

squeeze: Remove empty dimensions from an array

stencil.cross: A cross-shaped stencil

threshold: Threshold grayscale image

vanvliet: Young-Van Vliet recursive Gaussian filter.

warp: Warp image

watershed: Compute watershed transform.

where: Return locations in pixel set


add Man page
add.color Man page
add.colour Man page
as.cimg Man page
as.cimg.array Man page
as.cimg.cimg Man page Man page
as.cimg.double Man page
as.cimg.function Man page
as.cimg.logical Man page
as.cimg.matrix Man page
as.cimg.numeric Man page
as.cimg.pixset Man page
as.cimg.raster Man page
as.cimg.RasterLayer Man page
as.cimg.vector Man page Man page Man page Man page
as.imlist Man page
as.imlist.cimg Man page
as.imlist.imlist Man page
as.imlist.list Man page
as.imlist.RasterStackBrick Man page
as.pixset Man page
as.pixset.cimg Man page
as.raster.cimg Man page
at Man page
at<- Man page
autocrop Man page
average Man page
B Man page
B<- Man page
bbox Man page
blur_anisotropic Man page
boats Man page
boundary Man page
boxblur Man page
boxblur_xy Man page
bucketfill Man page
cannyEdges Man page
capture.plot Man page
Cc Man page
center.stencil Man page
channel Man page
channel<- Man page
channels Man page
ci Man page
cimg Man page
cimg2im Man page
cimg.dimensions Man page
cimg.extract Man page
cimg.use.openmp Man page
clean Man page Man page<- Man page
common_pixsets Man page
contours Man page
convert_pixset Man page
convolve Man page
coord.index Man page
correlate Man page
crop.borders Man page
depth Man page
deriche Man page
diffusion_tensors Man page
dilate Man page
dilate_rect Man page
dilate_square Man page
displacement Man page
display Man page
display.cimg Man page
display.list Man page
distance_transform Man page
enorm Man page
equal Man page
erode Man page
erode_rect Man page
erode_square Man page
extract_patches Man page
extract_patches3D Man page
FFT Man page
fill Man page
flatten.alpha Man page
frame Man page
frame<- Man page
frames Man page
G Man page
G<- Man page
get_gradient Man page
get_hessian Man page
get.locations Man page
get.stencil Man page
grab Man page
grabLine Man page
grabPoint Man page
grabRect Man page
grayscale Man page
grow Man page
haar Man page
height Man page
highlight Man page
HSItoRGB Man page
HSLtoRGB Man page
HSVtoRGB Man page
idply Man page
iiply Man page
ilply Man page
im2cimg Man page
imager Man page
imager.colourspaces Man page
imager.combine Man page
imager-package Man page
imager.replace Man page
imager.subset Man page
imappend Man page
imcol Man page
imcoord Man page
imdirac Man page
imdraw Man page
imeval Man page
imfill Man page
imgradient Man page
imhessian Man page
iminfo Man page
imlap Man page
imlist Man page
imnoise Man page
implot Man page
imrep Man page
imresize Man page
imrotate Man page
imrow Man page
imsharpen Man page
imshift Man page
imsplit Man page
im_split Man page
imsub Man page
imwarp Man page
index.coord Man page
\%inr\% Man page
interp Man page
is.cimg Man page
is.imlist Man page
isoblur Man page
is.pixset Man page
label Man page
LabtoRGB Man page
LabtosRGB Man page
LabtoXYZ Man page
liply Man page
load.example Man page
load.image Man page Man page
magick Man page
magick2cimg Man page
magick2imlist Man page Man page
map_il Man page
mclosing Man page
mclosing_square Man page
medianblur Man page
mirror Man page
mopening Man page
mopening_square Man page
mult Man page
nPix Man page
pad Man page
parall Man page
parany Man page
parmax Man page
parmax.abs Man page
parmed Man page
parmin Man page
parmin.abs Man page
parorder Man page
parrank Man page
parsd Man page
parsort Man page
parvar Man page
patchstat Man page
patch_summary_cimg Man page
periodic.part Man page
permute_axes Man page
pixel.grid Man page
pixset Man page
play Man page
plot.cimg Man page
plot.imlist Man page
px.all Man page
px.borders Man page
px.bottom Man page Man page
px.diamond Man page
px.flood Man page
px.left Man page Man page
px.none Man page
px.right Man page
px.square Man page Man page
R Man page
R<- Man page
RasterPackage Man page
renorm Man page
resize Man page
resize_doubleXY Man page
resize_halfXY Man page
resize_tripleXY Man page
resize_uniform Man page
RGBtoHSI Man page
RGBtoHSL Man page
RGBtoHSV Man page
RGBtoLab Man page
RGBtosRGB Man page
RGBtoXYZ Man page
RGBtoYCbCr Man page
RGBtoYUV Man page
rm.alpha Man page
rotate_xy Man page
save.image Man page Man page
shrink Man page
spectrum Man page
split_connected Man page
squeeze Man page
sRGBtoLab Man page
sRGBtoRGB Man page
stencil.cross Man page
subim Man page
threshold Man page
vanvliet Man page
warp Man page
watershed Man page
where Man page
which.parmax Man page
which.parmin Man page
width Man page
wsum Man page
Xc Man page
XYZtoLab Man page
XYZtoRGB Man page
Yc Man page
YCbCrtoRGB Man page
YUVtoRGB Man page
Zc Man page


imager/R/basegraphics.R imager/R/utils.R imager/R/transformations.R imager/R/stencils.R imager/R/drawing.R imager/R/loading.R imager/R/canny.R imager/R/interpolation.R imager/R/inline.R imager/R/interactive.R imager/R/RcppExports.R imager/R/splitcombine.R imager/R/imgen.R imager/R/coordinates.R imager/R/pixset.R imager/R/imglist.R imager/R/cimg_class.R imager/R/filtering.R imager/R/datasets.R imager/R/conversions.R
imager/man/boats.Rd imager/man/imdraw.Rd imager/man/isoblur.Rd imager/man/save.image.Rd imager/man/imlist.Rd imager/man/map_il.Rd imager/man/ imager/man/add.colour.Rd imager/man/is.pixset.Rd imager/man/periodic.part.Rd imager/man/imdirac.Rd imager/man/magick.Rd imager/man/patchstat.Rd imager/man/permute_axes.Rd imager/man/imnoise.Rd imager/man/ imager/man/imager.subset.Rd imager/man/ci.Rd imager/man/threshold.Rd imager/man/imrep.Rd imager/man/resize_uniform.Rd imager/man/channels.Rd imager/man/patch_summary_cimg.Rd imager/man/blur_anisotropic.Rd imager/man/as.pixset.Rd imager/man/ imager/man/index.coord.Rd imager/man/where.Rd imager/man/erode.Rd imager/man/bucketfill.Rd imager/man/imappend.Rd imager/man/plot.cimg.Rd imager/man/FFT.Rd imager/man/autocrop.Rd imager/man/displacement.Rd imager/man/cimg.use.openmp.Rd imager/man/cimg.extract.Rd imager/man/imlap.Rd imager/man/medianblur.Rd imager/man/center.stencil.Rd imager/man/clean.Rd imager/man/grab.Rd imager/man/imfill.Rd imager/man/squeeze.Rd imager/man/display.cimg.Rd imager/man/cimg2im.Rd imager/man/vanvliet.Rd imager/man/pad.Rd imager/man/implot.Rd imager/man/is.cimg.Rd imager/man/iminfo.Rd imager/man/imgradient.Rd imager/man/rm.alpha.Rd imager/man/display.list.Rd imager/man/grow.Rd imager/man/correlate.Rd imager/man/cimg.Rd imager/man/common_pixsets.Rd imager/man/coord.index.Rd imager/man/imeval.Rd imager/man/mirror.Rd imager/man/at.Rd imager/man/flatten.alpha.Rd imager/man/imrotate.Rd imager/man/imhessian.Rd imager/man/contours.Rd imager/man/grayscale.Rd imager/man/watershed.Rd imager/man/display.Rd imager/man/imager.Rd imager/man/liply.Rd imager/man/bbox.Rd imager/man/as.cimg.array.Rd imager/man/ imager/man/get_gradient.Rd imager/man/frames.Rd imager/man/ imager/man/capture.plot.Rd imager/man/pixset.Rd imager/man/convolve.Rd imager/man/iiply.Rd imager/man/get_hessian.Rd imager/man/get.stencil.Rd imager/man/extract_patches.Rd imager/man/get.locations.Rd imager/man/load.example.Rd imager/man/play.Rd imager/man/imager.combine.Rd imager/man/label.Rd imager/man/diffusion_tensors.Rd imager/man/ imager/man/grapes-inr-grapes.Rd imager/man/highlight.Rd imager/man/as.raster.cimg.Rd imager/man/imsub.Rd imager/man/boundary.Rd imager/man/haar.Rd imager/man/px.flood.Rd imager/man/RasterPackage.Rd imager/man/imcoord.Rd imager/man/renorm.Rd imager/man/boxblur.Rd imager/man/boxblur_xy.Rd imager/man/cimg.dimensions.Rd imager/man/crop.borders.Rd imager/man/imshift.Rd imager/man/idply.Rd imager/man/as.cimg.Rd imager/man/resize.Rd imager/man/plot.imlist.Rd imager/man/rotate_xy.Rd imager/man/ imager/man/pixel.grid.Rd imager/man/stencil.cross.Rd imager/man/ilply.Rd imager/man/im_split.Rd imager/man/imwarp.Rd imager/man/imsplit.Rd imager/man/as.cimg.raster.Rd imager/man/warp.Rd imager/man/as.cimg.function.Rd imager/man/imager.colourspaces.Rd imager/man/interp.Rd imager/man/split_connected.Rd imager/man/im2cimg.Rd imager/man/as.imlist.Rd imager/man/imsharpen.Rd imager/man/is.imlist.Rd imager/man/deriche.Rd imager/man/cannyEdges.Rd imager/man/imager.replace.Rd imager/man/load.image.Rd imager/man/distance_transform.Rd

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.