Package: imager 1.0.2

Aaron Robotham

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', <http://cimg.eu>, a simple, modern C++ library for image processing.

Authors:Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [ctb], Aaron Robotham [cre], Rodrigo Tobar [ctb]

imager_1.0.2.tar.gz
imager_1.0.2.tar.gz(r-4.5-noble)imager_1.0.2.tar.gz(r-4.4-noble)
imager_1.0.2.tgz(r-4.4-emscripten)imager_1.0.2.tgz(r-4.3-emscripten)
imager.pdf |imager.html
imager/json (API)
NEWS

# Install 'imager' in R:
install.packages('imager', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/asgr/imager/issues

Uses libs:
  • libx11– X11 client-side library
  • fftw3– Library for computing Fast Fourier Transforms
  • tiff– Tag Image File Format (TIFF) library
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • boats - Photograph of sailing boats from Kodak set

libx11fftw3tiffcppopenmp

7.14 score 1 stars 41 packages 2.3k scripts 9.3k downloads 15 mentions 224 exports 22 dependencies

Last updated 8 months agofrom:089c9553d1. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 10 2024
R-4.5-linux-x86_64OKDec 10 2024

Exports:%>%%inr%addadd.coloradd.colouras.cimgas.imlistas.pixsetatat<-autocropaverageBB<-bboxblur_anisotropicboundaryboxblurboxblur_xybucketfillcannyEdgescapture.plotCccenter.stencilchannelchannel<-channelscicimgcimg.limit.openmpcimg.use.openmpcimg2imcimg2magickcirclescleancolor.atcolor.at<-colorisecontoursconvolvecoord.indexcorrelatecrop.bboxcrop.bordersdepthderichediffusion_tensorsdilatedilate_rectdilate_squaredisplacementdisplaydistance_transformdraw_circledraw_rectdraw_textenormequalerodeerode_recterode_squareextract_patchesextract_patches3DFFTfillflatten.alphaframeframe<-framesGG<-get_gradientget.locationsget.stencilgrabLinegrabPointgrabRectgrayscalegrowgsdimhaarheighthighlighthough_circlehough_lineHSItoRGBHSLtoRGBHSVtoRGBidplyiiplyilplyimappendimchangeimcolimdiracimdoimdrawimevalimfillimgradientimhessianiminfoimlapimlistimnoiseimplotimrepimresizeimrotateimrowimsharpenimshiftimsplitimsubimwarpindex.coordinpaintinteractinterpis.cimgis.imlistis.pixsetisoblurlabelLabtoRGBLabtosRGBLabtoXYZliplyload.dirload.exampleload.imageload.videomagick2cimgmagick2imlistmake.videomap_ilmap2_ilmclosingmclosing_squaremedianblurmirrormopeningmopening_squaremultnflinenPixpadparallparanyparmaxparmax.absparmedparminparmin.absparorderparquanparrankparsdparsortparvarpatch_summary_cimgpatchstatperiodic.partpermute_axespixel.gridpixsetplaypmap_ilpx.allpx.borderspx.bottompx.circlepx.diamondpx.floodpx.leftpx.napx.nonepx.remove_outerpx.rightpx.squarepx.topRR<-renormresizeresize_doubleXYresize_halfXYresize_tripleXYRGBtoHSIRGBtoHSLRGBtoHSVRGBtoLabRGBtosRGBRGBtoXYZRGBtoYCbCrRGBtoYUVrm.alpharotate_xysave.imagesave.videoshrinkspectrumsplit_connectedsqueezesRGBtoLabsRGBtoRGBstencil.crosssubimthresholdvanvlietwarpwatershedwherewhich.parmaxwhich.parminwidthwsumXcXYZtoLabXYZtoRGBYcYCbCrtoRGBYUVtoRGBZc

Dependencies:bmpclicpp11digestdownloaderglueigraphjpeglatticelifecyclemagrittrMatrixpkgconfigpngpurrrRcppreadbitmaprlangstringistringrtiffvctrs

Getting started with imager

Rendered fromgettingstarted.Rmdusingknitr::rmarkdownon Dec 10 2024.

Last update: 2024-02-21
Started: 2016-04-28

Pixsets: representing pixel sets in imager

Rendered frompixsets.Rmdusingknitr::rmarkdownon Dec 10 2024.

Last update: 2024-02-21
Started: 2017-03-10

Readme and manuals

Help Manual

Help pageTopics
Check that value is in a range%inr%
Add colour channels to a grayscale image or pixel setadd.color add.colour
Convert to cimg objectas.cimg as.cimg.cimg as.cimg.double as.cimg.logical as.cimg.matrix as.cimg.numeric as.cimg.vector
Turn an numeric array into a cimg objectas.cimg.array
Create an image from a data.frameas.cimg.data.frame
Create an image by sampling a functionas.cimg.function
Convert an image in spatstat format to an image in cimg formatas.cimg.im
Convert a raster object to a cimg objectas.cimg.raster
Convert a pixel image to a data.frameas.data.frame.cimg
Convert image list to data.frameas.data.frame.imlist
Methods to convert pixsets to various objectsas.data.frame.pixset convert_pixset
Form a graph from an imageas.igraph.cimg
Form an adjacency graph from a pixsetas.igraph.pixset
Convert various objects to image listsas.imlist as.imlist.cimg as.imlist.imlist as.imlist.list
Methods to convert various objects to pixsetsas.cimg.pixset as.pixset as.pixset.cimg
Convert a cimg object to a raster object for plottingas.raster.cimg
Return or set pixel value at coordinatesat at<- color.at color.at<-
Autocrop image regionautocrop
Compute the bounding box of a pixsetbbox crop.bbox
Blur image anisotropically, in an edge-preserving way.blur_anisotropic
Photograph of sailing boats from Kodak setboats
Find the boundary of a shape in a pixel setboundary
Blur image with a box filter (square window)boxblur
Blur image with a box filter.boxblur_xy
Bucket fillbucketfill
Canny edge detectorcannyEdges
Capture the current R plot device as a cimg imagecapture.plot
Center stencil at a locationcenter.stencil
Split a colour image into a list of separate channelschannels
Concatenation for image listsci
Create a cimg objectcimg
Image dimensionscimg.dimensions depth height nPix spectrum width
Various shortcuts for extracting colour channels, frames, etcB channel cimg.extract frame G imcol imrow R
Control CImg's parallelisationcimg.limit.openmp cimg.openmp cimg.use.openmp
Convert cimg to spatstat im objectcimg2im
Add circles to plotcircles
Clean up and fill in pixel sets (morphological opening and closing)clean fill
Fill in a colour in an area given by a pixsetcolorise
Various useful pixsetscommon_pixsets px.all px.borders px.bottom px.circle px.diamond px.left px.none px.right px.square px.top
Return contours of image/pixsetcontours
Coordinates from pixel indexcoord.index
Correlation/convolution of image by filterconvolve correlate
Crop the outer margins of an imagecrop.borders
Apply recursive Deriche filter.deriche
Compute field of diffusion tensors for edge-preserving smoothing.diffusion_tensors
Estimate displacement field between two images.displacement
Display object using CImg librarydisplay
Display image using CImg librarydisplay.cimg
Display image list using CImg librarydisplay.list
Compute Euclidean distance function to a specified value.distance_transform
Draw circle on imagedraw_circle
Draw rectangle on imagedraw_rect
Draw text on an imagedraw_text
Erode/dilate image by a structuring element.dilate dilate_rect dilate_square erode erode_rect erode_square mclosing mclosing_square mopening mopening_square
Extract image patches and return a listextract_patches extract_patches3D
Compute the Discrete Fourier Transform of an imageFFT
Flatten alpha channelflatten.alpha
Split a video into separate framesframes
Compute image gradient.get_gradient
Return image hessian.get_hessian
Return coordinates of subset of pixelsget.locations
Return pixel values in a neighbourhood defined by a stencilget.stencil
Select image regions interactivelygrab grabLine grabPoint grabRect
Convert an RGB image to grayscalegrayscale
Grow/shrink a pixel setgrow shrink
Grayscale dimensions of imagegsdim
Compute Haar multiscale wavelet transform.haar
Highlight pixel set on imagehighlight
Circle detection using Hough transformhough_circle
Hough transform for lineshough_line
Split an image along axis, map function, return a data.frameidply
Split an image, apply function, recombine the results as an imageiiply
Split an image along axis, apply function, return a listilply
Split an image along a certain axis (producing a list)im_split
imager: an R library for image processing, based on CImgimager-package imager
Combining imagesadd average enorm equal imager.combine mult parall parany parmax parmax.abs parmed parmin parmin.abs parorder parquan parrank parsd parsort parvar which.parmax which.parmin wsum
Replace part of an image with anotherB<- channel<- frame<- G<- imager.replace R<-
Array subset operator for cimg objectsimager.subset
Combine a list of images into a single imageimappend
Modify parts of an imageimchange
Coordinates as imagesCc imcoord Xc Yc Zc
Generates a "dirac" image, i.e. with all values set to 0 except one.imdirac
Draw image on another imageimdraw
Evaluation in an image contextimdo imeval
Create an image of custom size by filling in repeated valuesimfill
Compute image gradientimgradient
Compute image hessian.imhessian
Return information on image fileiminfo
Compute image Laplacianimlap
Image listimlist
Generate (Gaussian) white-noise imageimnoise
Plot objects on image using base graphicsimplot
Replicate imagesimrep
Rotate an image along the XY plane.imrotate
Sharpen image.imsharpen
Shift image content.imshift
Split an image along a certain axis (producing a list)imsplit
Select part of an imageimsub subim
Image warpingimwarp
Linear index in internal vector from pixel coordinatesindex.coord
Fill-in NA values in an imageinpaint
Build simple interactive interfaces using imagerinteract
Interpolate image valuesinterp
Checks that an object is a cimg objectis.cimg
Check that an object is an imlist objectis.imlist
Check that an object is a pixset objectis.pixset
Blur image isotropically.isoblur
Label connected components.label
Apply function to each element of a list, then combine the result as an image by appending along specified axisliply
Load all images in a directoryload.dir
Load example imageload.example
Load image from file or URLload.image
Load a video using ffmpegload.video
Convert a magick image to a cimg image or image list and vice versacimg2magick magick magick2cimg magick2imlist
Make/save a video using ffmpegmake.video save.video
Type-stable map for use with the purrr packagemap2_il map_il pmap_il
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.medianblur
Mirror image content along specified axismirror
Mutate a data frame by adding new or replacing existing columns.mutate_plyr
Plot a line, Hesse normal form parameterisationnfline
Pad image with n pixels along specified axispad
Extract a numerical summary from image patches, using CImg's mini-language Experimental feature.patch_summary_cimg
Return image patch summarypatchstat
Compute the periodic part of an image, using the periodic/smooth decomposition of Moisan (2011)periodic.part
Permute image axespermute_axes
Return the pixel grid for an imagepixel.grid
Pixel sets (pixsets)pixset
Play a videoplay
Display an image using base graphicsplot.cimg
Plot an image listplot.imlist
Select a region of homogeneous colourpx.flood
A pixset for NA valuespx.na
Remove all connected regions that touch image boundariespx.remove_outer
Convert a RasterLayer/RasterBrick to a cimg image/image listas.cimg.RasterLayer as.imlist.RasterStackBrick RasterPackage
Renormalise imagerenorm
Resize imageresize
Resize image uniformlyimresize resize_doubleXY resize_halfXY resize_tripleXY resize_uniform
Colour space conversions in imagerHSItoRGB HSLtoRGB HSVtoRGB imager.colourspaces LabtoRGB LabtosRGB LabtoXYZ RGBtoHSI RGBtoHSL RGBtoHSV RGBtoLab RGBtosRGB RGBtoXYZ RGBtoYCbCr RGBtoYUV sRGBtoLab sRGBtoRGB XYZtoLab XYZtoRGB YCbCrtoRGB YUVtoRGB
Remove alpha channel and store as attributerm.alpha
Rotate image by an arbitrary angle, around a center point.rotate_xy
Save imagesave.image
Split pixset into connected componentssplit_connected
Remove empty dimensions from an arraysqueeze
A cross-shaped stencilstencil.cross
Threshold grayscale imagethreshold
Young-Van Vliet recursive Gaussian filter.vanvliet
Warp imagewarp
Compute watershed transform.watershed
Return locations in pixel setwhere