probably like this?
Code
\documentclass[parskip]{scrartcl}
\usepackage[margin=15mm]{geometry}
\usepackage{tikz}
\usepackage{xifthen}
\newcommand{\layerpic}[2]% layers, commands
{ \foreach \x in {1,...,#1}
{ \begin{tikzpicture}
\pgfmathtruncatemacro{\i}{\x+1}
#2
\end{tikzpicture}\\[1cm]
}
}
\newcommand{\mylayer}[2]% layer, layer commands
{ \ifthenelse{\i>#1}
{#2}
{}
}
\begin{document}
\layerpic{4}
{ \mylayer{1}
{ \fill[green!50!gray] (0,0) rectangle (12,4);
}
\mylayer{2}
{ \fill[red!50!gray] (6,2) ellipse (5.5 and 1.5);
}
\mylayer{3}
{ \fill[blue!50!gray] (1,1) circle (0.5);
\fill[blue!50!gray] (11,1) circle (0.5);
\fill[blue!50!gray] (1,3) circle (0.5);
\fill[blue!50!gray] (11,3) circle (0.5);
}
\mylayer{4}
{ \fill[yellow!50!gray] (3,0.1) -- (6,3.9) -- (9,0.1) -- cycle;
}
}
\end{document}
Result

Edit 1: Here's a command that will act differently in beamer and non-beamer documents:
Code
\makeatletter
\@ifclassloaded{beamer}
{\xdef\isbeamer{1}}
{\xdef\isbeamer{0}}%
\makeatother
\newcommand{\layerpic}[2]% layers, commands
{ \ifthenelse{\isbeamer=1}
{ \begin{tikzpicture}[scale=0.5]
#2
\end{tikzpicture}
}
{ \foreach \x in {1,...,#1}
{ \begin{tikzpicture}
\pgfmathtruncatemacro{\i}{\x+1}
#2
\end{tikzpicture}\\[1cm]
}
}
}
\newcommand{\mylayer}[2]% layer, layer commands
{ \ifthenelse{\isbeamer=1}
{ \only<#1->{#2}
}
{ \ifthenelse{\i>#1}
{#2}
{}
}
}
Output
In a non-beamer document (e.g. scrartcl), the output is exactly the same as before. In beamer however (the tikzpicture is scaled to 0.5 in beamer mode, as slides are only 128mm wide):

beamerclass defines the primitives for incremental presentations. – Sep 08 '12 at 08:32