Learn R Programming

⚠️There's a newer version (0.45.8) of this package.Take me there.

imager (version 0.42.19)

Image Processing Library Based on 'CImg'

Description

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.

Copy Link

Version

Install

install.packages('imager')

Monthly Downloads

9,194

Version

0.42.19

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

March 25th, 2023

Functions in imager (0.42.19)

RasterPackage

Convert a RasterLayer/RasterBrick to a cimg image/image list
as.data.frame.imlist

Convert image list to data.frame
add.colour

Add colour channels to a grayscale image or pixel set
FFT

Compute the Discrete Fourier Transform of an image
as.data.frame.cimg

Convert a pixel image to a data.frame
as.cimg.function

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

Convert a raster object to a cimg object
as.cimg.array

Turn an numeric array into a cimg object
as.cimg.data.frame

Create an image from a data.frame
as.cimg

Convert to cimg object
at

Return or set pixel value at coordinates
as.data.frame.pixset

Methods to convert pixsets to various objects
as.pixset

Methods to convert various objects to pixsets
channels

Split a colour image into a list of separate channels
autocrop

Autocrop image region
bbox

Compute the bounding box of a pixset
as.raster.cimg

Convert a cimg object to a raster object for plotting
cannyEdges

Canny edge detector
bucketfill

Bucket fill
ci

Concatenation for image lists
boundary

Find the boundary of a shape in a pixel set
as.igraph.pixset

Form an adjacency graph from a pixset
as.imlist.list

Convert various objects to image lists
boats

Photograph of sailing boats from Kodak set
colorise

Fill in a colour in an area given by a pixset
capture.plot

Capture the current R plot device as a cimg image
center.stencil

Center stencil at a location
as.igraph.cimg

Form a graph from an image
clean

Clean up and fill in pixel sets (morphological opening and closing)
cimg2im

Convert cimg to spatstat im object
blur_anisotropic

Blur image anisotropically, in an edge-preserving way.
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
boxblur_xy

Blur image with a box filter.
boxblur

Blur image with a box filter (square window)
display

Display object using CImg library
cimg

Create a cimg object
display.cimg

Display image using CImg library
cimg.dimensions

Image dimensions
circles

Add circles to plot
correlate

Correlation/convolution of image by filter
coord.index

Coordinates from pixel index
draw_text

Draw text on an image
draw_circle

Draw circle on image
display.list

Display image list using CImg library
erode

Erode/dilate image by a structuring element.
distance_transform

Compute Euclidean distance function to a specified value.
common_pixsets

Various useful pixsets
haar

Compute Haar multiscale wavelet transform.
extract_patches

Extract image patches and return a list
frames

Split a video into separate frames
cimg.use.openmp

Control CImg's parallelisation
displacement

Estimate displacement field between two images.
diffusion_tensors

Compute field of diffusion tensors for edge-preserving smoothing.
%inr%

Check that value is in a range
get.locations

Return coordinates of subset of pixels
imager.replace

Replace part of an image with another
highlight

Highlight pixel set on image
draw_rect

Draw rectangle on image
contours

Return contours of image/pixset
crop.borders

Crop the outer margins of an image
deriche

Apply recursive Deriche filter.
RGBtoHSL

Colour space conversions in imager
imappend

Combine a list of images into a single image
imdraw

Draw image on another image
grayscale

Convert an RGB image to grayscale
imeval

Evaluation in an image context
imager.combine

Combining images
imchange

Modify parts of an image
imhessian

Compute image hessian.
imager.subset

Array subset operator for cimg objects
hough_circle

Circle detection using Hough transform
imfill

Create an image of custom size by filling in repeated values
hough_line

Hough transform for lines
grow

Grow/shrink a pixel set
ilply

Split an image along axis, apply function, return a list
get.stencil

Return pixel values in a neighbourhood defined by a stencil
im2cimg

Convert an image in spatstat format to an image in cimg format
imlap

Compute image Laplacian
get_gradient

Compute image gradient.
imrep

Replicate images
imwarp

Image warping
imlist

Image list
flatten.alpha

Flatten alpha channel
gsdim

Grayscale dimensions of image
index.coord

Linear index in internal vector from pixel coordinates
grab

Select image regions interactively
get_hessian

Return image hessian.
idply

Split an image along axis, map function, return a data.frame
iiply

Split an image, apply function, recombine the results as an image
load.image

Load image from file or URL
load.example

Load example image
imgradient

Compute image gradient
imnoise

Generate (Gaussian) white-noise image
implot

Plot objects on image using base graphics
isoblur

Blur image isotropically.
imshift

Shift image content.
imsharpen

Sharpen image.
im_split

Split an image along a certain axis (producing a list)
imcoord

Coordinates as images
is.imlist

Check that an object is an imlist object
imager

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

Check that an object is a pixset object
imdirac

Generates a "dirac" image, i.e. with all values set to 0 except one.
inpaint

Fill-in NA values in an image
interact

Build simple interactive interfaces using imager
mutate_plyr

Mutate a data frame by adding new or replacing existing columns.
resize_doubleXY

Resize image uniformly
label

Label connected components.
renorm

Renormalise image
nfline

Plot a line, Hesse normal form parameterisation
rm.alpha

Remove alpha channel and store as attribute
stencil.cross

A cross-shaped stencil
imrotate

Rotate an image along the XY plane.
load.video

Load a video using ffmpeg
magick

Convert a magick image to a cimg image or image list and vice versa
play

Play a video
liply

Apply function to each element of a list, then combine the result as an image by appending along specified axis
permute_axes

Permute image axes
load.dir

Load all images in a directory
%>%

Pipe operator
split_connected

Split pixset into connected components
squeeze

Remove empty dimensions from an array
plot.cimg

Display an image using base graphics
iminfo

Return information on image file
imsplit

Split an image along a certain axis (producing a list)
resize

Resize image
threshold

Threshold grayscale image
mirror

Mirror image content along specified axis
imsub

Select part of an image
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.
rotate_xy

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

Pixel sets (pixsets)
px.na

A pixset for NA values
px.remove_outer

Remove all connected regions that touch image boundaries
pixel.grid

Return the pixel grid for an image
patchstat

Return image patch summary
periodic.part

Compute the periodic part of an image, using the periodic/smooth decomposition of Moisan (2011)
save.image

Save image
watershed

Compute watershed transform.
where

Return locations in pixel set
make.video

Make/save a video using ffmpeg
is.cimg

Checks that an object is a cimg object
pad

Pad image with n pixels along specified axis
interp

Interpolate image values
map_il

Type-stable map for use with the purrr package
vanvliet

Young-Van Vliet recursive Gaussian filter.
patch_summary_cimg

Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.
px.flood

Select a region of homogeneous colour
plot.imlist

Plot an image list
warp

Warp image