%% This file is part of Enblend.
%% Licence details can be found in the file COPYING.


\newcommand*{\multiresolutiontext}{mul\-ti-res\-o\-lu\-tion}


\section[External Masks]{\label{sec:external-masks}%
  \genidx{external mask}%
  \genidx{mask!external}%
  External Masks}

In the usual workflow \App{} and \OtherApp{} generate the blending and fusing masks according to
the command-line options and the input images including their associated alpha-channels, and
then they immediately use these masks for \multiresolutiontext{} blending or
\multiresolutiontext{} fusing the output image.

Sometimes more control over the masks is wanted.  To this end, both applications provide the
option pair \option{--load-masks} and \option{--save-masks}.  See
\chapterName~\fullref{sec:invocation}, for detailed explanations of both options.  With the help
of these options the processing can be broken up into two phases:

\begin{enumerate}%
  \optidx{--save-masks}%
  \optidx{--output}%
\item
  Save masks with \option{--save-masks}.  Generate masks and save them into image files.

  Avoid option~\option{--output} here unless the blended or fused image at this point is wanted.

  \optidx{--load-masks}%
\item
  Load possibly modified masks with \option{--load-masks} from files and then blend or fuse the
  final image with the help of the loaded masks only.

  Neither application (re-)generates any mask in this phase.  The loaded masks completely
  control the \multiresolutiontext{} blending or \multiresolutiontext{} fusing the output image.
\end{enumerate}

In between these two steps the user may apply whatever transformation to the mask files, as long
as their geometries and offsets remain the same.  Thus the ``Combine Images'' box of
\figureName~\ref{fig:photographic-workflow} becomes three activities as is depicted in
\figureName~\ref{fig:external-mask-workflow}.

\begin{figure}
  \begin{maxipage}
    \centering
    \includeimage{external-mask-workflow}
  \end{maxipage}

  \caption[External mask workflow]{\label{fig:external-mask-workflow}%
    \genidx{workflow!external mask}%
    Workflow for externally modified masks.  The ``Blend or Fuse Using Masks'' step utilizes the
    \multiresolutiontext{} algorithm just as for internal workflow without mask files.}
\end{figure}

To further optimize this kind of workflow, both \App{} and \OtherApp{} stop after mask
generation if option~\option{--save-masks} is given, but \emph{no output file} is specified with
the \option{--output} option.  This way the time for pyramid generation, blending, fusing, and
writing the final image to disk is saved, as well as no output image gets generated.

Note that options~\option{--save-masks} and \option{--load-masks} cannot be used simultaneously.


%%% Local Variables:
%%% fill-column: 96
%%% End:
