\HeaderA{Combine}{Combining images}{Combine}
\aliasA{combine}{Combine}{combine}
\begin{Description}\relax
Merges images to create image sequences.
\end{Description}
\begin{Usage}
\begin{verbatim}
  combine(x, ..., along)        
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An \code{Image} object, an array, or a list of \code{Image} objects and arrays.
\item[\code{...}] \code{Image} objects or arrays.
\item[\code{along}] an optional numeric. See details.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The function \code{combine} uses \code{abind} to merge multi-dimensionnal
arrays along the dimension specified by the value \code{along}.

If \code{along} is missing, a default value depending on the
color mode of \code{x} is used. If \code{x} is a \code{Grayscale} image or an array,
\code{along} is set to 3 and image objects are combined on this dimension. If
\code{x} is a \code{Color} image, \code{along} is set to 4 and image objects
are combined on this dimension, leaving room on the third dimension for color
channels.
\end{Details}
\begin{Value}
An \code{Image} object or an array.
\end{Value}
\begin{Author}\relax
Gregoire Pau
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{Image}{Image}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  if (interactive()) {
    ## combination of color images
    lena = readImage(system.file("images", "lena-color.png", package="EBImage"))
    x = combine(lena, flip(lena), flop(lena))
    if (interactive()) display(x)

    ## Blurred lenas
    x = resize(lena, 128, 128)
    xt = list()
    for (t in seq(0.1, 5, len=9)) xt=c(xt, list(blur(x, s=t)))
    xt = combine(xt)
    if (interactive()) display(xt, title='Blurred Lenas')
  }
\end{ExampleCode}
\end{Examples}

