% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ImageArray.R
\name{writeImageArray}
\alias{writeImageArray}
\title{writeImageArray}
\usage{
writeImageArray(
  image,
  output = "my_image",
  name = "",
  format = NULL,
  replace = FALSE,
  n.levels = NULL,
  chunkdim = NULL,
  level = NULL,
  engine = "EBImage",
  verbose = FALSE,
  ...
)
}
\arguments{
\item{image}{an Image object (EBImage), a magick object or the path
to an image file,}

\item{output}{output file name}

\item{name}{name of the group}

\item{format}{on disk format, either "h5" for HDF5 format, "zarr" for
zarr format, or "in-memory" for in-memory ImageArray object.
If not provided, the format will be inferred from the file extension of
the output path.}

\item{replace}{Should the existing file be
removed or not}

\item{n.levels}{the number of levels if the image supposed to be
pyramidal.}

\item{chunkdim}{The dimensions of the chunks
to use for writing the data to disk.}

\item{level}{The compression level to use for
writing the data to disk.}

\item{engine}{the package to use for each image layer: either
\code{EBImage} or \code{magick-image}}

\item{verbose}{verbose}

\item{...}{additional parameters passed to
\link[ImageArray]{createImageArray}.}
}
\value{
An ImageArray object
}
\description{
Writing image arrays on disk
}
\examples{
# get image
library(EBImage)
img.file <- system.file("images", "sample.png", package="EBImage")

# create ImageArray
dir.create(td <- tempfile())
output_h5 <- tempfile(fileext = ".h5")
imgarray <- writeImageArray(img.file,
                          output = output_h5,
                          name = "image",
                          verbose = FALSE)
imgarray_raster <- as.raster(imgarray)
plot(imgarray_raster)

}
