Learn R Programming

pavo (version 2.0.0)

img_conversion: Convert images between class rimg and cimg

Description

Conveniently convert single objects of class rimg and cimg (from the package imager, which contains a suite of useful image-processing capabilities).

Usage

rimg2cimg(image)

cimg2rimg(image, name = "img")

Arguments

image

an object of class rimg or cimg.

name

the name(s) of the image(s).

Value

an image of the specified class

Examples

Run this code
# NOT RUN {
papilio <- getimg(system.file("testdata/images/papilio.png", package = 'pavo'))

# From class rimg to cimg
papilio_cimg <- rimg2cimg(papilio)
class(papilio_cimg)

# From class cimg to rimg
papilio_rimg <- cimg2rimg(papilio_cimg)
class(papilio_rimg)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab