Convert from an image array to a raster stack, optionally using the alpha channel as a mask.
array_to_RasterStack(
img_array,
type = c("stack", "brick"),
alpha_mask = TRUE,
return_alpha = FALSE
)
A Raster* object, either RasterStack
or RasterBrick
depending
on the type
argument.
An RGB array.
Type of Raster* object to return. One of either "stack" (raster::stack) or "brick" (raster::brick).
Logical. Use the alpha channel as a background mask?
Logical. Return the alpha channel as a layer?