- Is there a way to achieve this kind of clipping for raster images as well, not only for tikz pictures? -- Solved, see Edit #1.
- Are there any easier solution to achieve this with TikZ? -- Solved, see Edit #1.
- How to smooth the random step line a little more?

Here is my minimal working example:
\documentclass{article}
\usepackage{tikz}
\usepgflibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}
\fill[black](0, 0) rectangle (72pt, 72pt);
\end{tikzpicture}
\hspace{72pt}
\begin{tikzpicture}
\clip (0, 0) rectangle (72pt, 36pt);
\fill[black](0, 0) rectangle (72pt, 72pt);
\filldraw[white] (0pt, 0pt) -- (72pt, 0pt) -- (72pt, 7pt)
decorate [decoration={random steps,segment length=2pt,amplitude=1pt}] {-- (0pt, 7pt)}
-- cycle;
\end{tikzpicture}
\end{document}
Edit #1: Found a better solution myself. I've merged the clip and filldraw commands, so clipping with a zigzag like random line at the bottom became a little easier.

Working code:
\begin{tikzpicture}
\draw[clip] (0, 36pt)
-- (0, 7pt)
decorate [decoration={random steps,segment length=2pt,amplitude=1pt}] {-- (72pt, 7pt)}
-- (72pt, 36pt)
--cycle;
\fill[black](0, 0) rectangle (72pt, 72pt);
\end{tikzpicture}
Clippnig a 72pt * 72pt png image (or any raster images):
\begin{tikzpicture}
\draw[clip] (0, 36pt)
-- (0, 7pt)
decorate [decoration={random steps,segment length=2pt,amplitude=1pt}] {-- (72pt, 7pt)}
-- (72pt, 36pt)
--cycle;
\node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=72pt]{black.png}};
\end{tikzpicture}
Still, there remain two unanswered questions. Let me rephrase my original third quiestion:
- How to round the edges of the random step line?
Clipping a picture in an easy way raises another question:
- Is there any way to set up a coordinate system at the beginning of the
tikzpicture, so one shouldn't have to use exact lengths while clipping but scales instead?


smoothkeyword (manual page 229) – Tom Bombadil Nov 5 '11 at 0:53