% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/handle_image_output.R
\name{handle_image_output}
\alias{handle_image_output}
\title{Handle Image Output}
\usage{
handle_image_output(image, filename = NULL, preview = FALSE)
}
\arguments{
\item{image}{3-layer RGB/4-layer RGBA array, \code{rayimg} class, or filename of an image.}

\item{filename}{Default \code{NULL}. String specifying the file path to save the image.
If \code{NULL}, the image is returned or displayed.}

\item{preview}{Default \code{FALSE}. If \code{TRUE}, the image is displayed.}
}
\value{
If \code{filename = NULL} and \code{preview = FALSE}, returns the image array invisibly.
Otherwise, saves to file or displays the image.
}
\description{
Handles image output logic: returning, saving to a file, or previewing.
}
\keyword{internal}
