as.cimg.array: Turn an numeric array into a cimg object

as.cimg.arrayR Documentation

Turn an numeric array into a cimg object

Description

If the array has two dimensions, we assume it's a grayscale image. If it has three dimensions we assume it's a video, unless the third dimension has a depth of 3, in which case we assume it's a colour image,

Usage

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

Arguments

obj

an array

...

ignored

Examples

as.cimg(array(1:9,c(3,3)))
as.cimg(array(1,c(10,10,3))) #Guesses colour image
as.cimg(array(1:9,c(10,10,4))) #Guesses video

dahtah/imager documentation built on Feb. 23, 2023, 10:16 p.m.