Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.cimg.raster

Convert a raster object to a cimg object


Description

R's native object for representing images is a "raster". This function converts raster objects to cimg objects.

Usage

## S3 method for class 'raster'
as.cimg(obj, ...)

Arguments

obj

a raster object

...

ignored

Value

a cimg object

Author(s)

Simon Barthelme

Examples

rst <- as.raster(matrix((1:4)/4,2,2))
as.cimg(rst) %>% plot(int=FALSE)
all.equal(rst,as.raster(as.cimg(rst)))

imager

Image Processing Library Based on 'CImg'

v0.42.10
LGPL-3
Authors
Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.