nativeRaster
images to/from PNG and JPEGBoth the {png}
and {jpeg}
packages allow
images to be loaded directly as nativeRaster
images.
img <- jpeg::readJPEG(system.file("img", "Rlogo.jpg", package="jpeg"), native = TRUE)
class(img)
#> [1] "nativeRaster"
grid.raster(img, interpolate = FALSE)
raster
image to/from
nativeRaster
array
image to/from
nativeRaster