Learn R Programming

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

imager (version 0.42.10)

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.10

License

LGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

June 10th, 2021

Functions in imager (0.42.10)

at

Return or set pixel value at coordinates
capture.plot

Capture the current R plot device as a cimg image
bbox

Compute the bounding box of a pixset
cimg

Create a cimg object
crop.borders

Crop the outer margins of an image
blur_anisotropic

Blur image anisotropically, in an edge-preserving way.
deriche

Apply recursive Deriche filter.
cimg.dimensions

Image dimensions
as.cimg.raster

Convert a raster object to a cimg object
center.stencil

Center stencil at a location
frames

Split a video into separate frames
as.igraph.pixset

Form an adjacency graph from a pixset
boxblur

Blur image with a box filter (square window)
clean

Clean up and fill in pixel sets (morphological opening and closing)
as.imlist.list

Convert various objects to image lists
boxblur_xy

Blur image with a box filter.
grayscale

Convert an RGB image to grayscale
RGBtoHSL

Colour space conversions in imager
%inr%

Check that value is in a range
get.locations

Return coordinates of subset of pixels
imager.combine

Combining images
as.pixset

Methods to convert various objects to pixsets
as.data.frame.imlist

Convert image list to data.frame
boats

Photograph of sailing boats from Kodak set
boundary

Find the boundary of a shape in a pixel set
imhessian

Compute image hessian.
cimg2im

Convert cimg to spatstat im object
grow

Grow/shrink a pixel set
draw_circle

Draw circle on image
draw_rect

Draw rectangle on image
colorise

Fill in a colour in an area given by a pixset
circles

Add circles to plot
as.raster.cimg

Convert a cimg object to a raster object for plotting
channels

Split a colour image into a list of separate channels
ci

Concatenation for image lists
bucketfill

Bucket fill
autocrop

Autocrop image region
common_pixsets

Various useful pixsets
displacement

Estimate displacement field between two images.
diffusion_tensors

Compute field of diffusion tensors for edge-preserving smoothing.
haar

Compute Haar multiscale wavelet transform.
contours

Return contours of image/pixset
implot

Plot objects on image using base graphics
iminfo

Return information on image file
imnoise

Generate (Gaussian) white-noise image
highlight

Highlight pixel set on image
imager.replace

Replace part of an image with another
coord.index

Coordinates from pixel index
as.igraph.cimg

Form a graph from an image
as.data.frame.pixset

Methods to convert pixsets to various objects
display

Display object using CImg library
correlate

Correlation/convolution of image by filter
draw_text

Draw text on an image
display.cimg

Display image using CImg library
erode

Erode/dilate image by a structuring element.
cimg.extract

Various shortcuts for extracting colour channels, frames, etc
cannyEdges

Canny edge detector
label

Label connected components.
isoblur

Blur image isotropically.
liply

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

Circle detection using Hough transform
hough_line

Hough transform for lines
imager.subset

Array subset operator for cimg objects
im2cimg

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

Combine a list of images into a single image
ilply

Split an image along axis, apply function, return a list
imchange

Modify parts of an image
grab

Select image regions interactively
flatten.alpha

Flatten alpha channel
imsub

Select part of an image
imeval

Evaluation in an image context
imsplit

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

Return image hessian.
extract_patches

Extract image patches and return a list
interp

Interpolate image values
imdraw

Draw image on another image
gsdim

Grayscale dimensions of image
cimg.use.openmp

Control CImg's parallelisation
distance_transform

Compute Euclidean distance function to a specified value.
display.list

Display image list using CImg library
get.stencil

Return pixel values in a neighbourhood defined by a stencil
idply

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

Sharpen image.
imfill

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

Compute image gradient.
imgradient

Compute image gradient
iiply

Split an image, apply function, recombine the results as an image
index.coord

Linear index in internal vector from pixel coordinates
imwarp

Image warping
load.example

Load example image
imshift

Shift image content.
is.imlist

Check that an object is an imlist object
make.video

Make/save a video using ffmpeg
is.cimg

Checks that an object is a cimg object
map_il

Type-stable map for use with the purrr package
pixel.grid

Return the pixel grid for an image
load.image

Load image from file or URL
imager

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

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

Coordinates as images
patch_summary_cimg

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

Pad image with n pixels along specified axis
load.dir

Load all images in a directory
patchstat

Return image patch summary
imrep

Replicate images
imrotate

Rotate an image along the XY plane.
pixset

Pixel sets (pixsets)
px.flood

Select a region of homogeneous colour
plot.imlist

Plot an image list
periodic.part

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

Remove empty dimensions from an array
split_connected

Split pixset into connected components
imdirac

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

Young-Van Vliet recursive Gaussian filter.
warp

Warp image
magick

Convert a magick image to a cimg image or image list and vice versa
load.video

Load a video using ffmpeg
is.pixset

Check that an object is a pixset object
imlap

Compute image Laplacian
permute_axes

Permute image axes
imlist

Image list
renorm

Renormalise image
%>%

Pipe operator
resize

Resize image
rotate_xy

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

Save image
interact

Build simple interactive interfaces using imager
inpaint

Fill-in NA values in an image
px.na

A pixset for NA values
mutate_plyr

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

Play a video
plot.cimg

Display an image using base graphics
nfline

Plot a line, Hesse normal form parameterisation
px.remove_outer

Remove all connected regions that touch image boundaries
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.
where

Return locations in pixel set
watershed

Compute watershed transform.
mirror

Mirror image content along specified axis
resize_doubleXY

Resize image uniformly
stencil.cross

A cross-shaped stencil
rm.alpha

Remove alpha channel and store as attribute
threshold

Threshold grayscale image
FFT

Compute the Discrete Fourier Transform of an image
as.cimg.array

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

Create an image from a data.frame
RasterPackage

Convert a RasterLayer/RasterBrick to a cimg image/image list
as.cimg.function

Create an image by sampling a function
as.data.frame.cimg

Convert a pixel image to a data.frame
add.colour

Add colour channels to a grayscale image or pixel set
as.cimg

Convert to cimg object