
答え1
decorations
TikZ で を使用してパスをモーフィングすることができますrandom steps
。もちろん、これらのランダム ステップをカスタマイズすることもできます。
私は、\clip
画像の左上から始めて右上、約 2/3 まで下がってからパスを閉じる前に再び左に移動する、ハードコードされた座標を持つ を使用しましたwidth
。includegraphics の を変更する場合は、クリッピング座標もそれに応じて変更してください。
ただし、これは変数を使用して簡単に解決できます。
出力
コード
\documentclass[margin=15pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, decorations.pathmorphing}
\newcommand\myimgwidth{\linewidth} % one measure to rule them all
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro\myheight{(\myimgwidth/4)*2}
\clip[preaction={draw, line width=.8pt}] (0,0) -- (\myimgwidth,0) -- (\myimgwidth,-\myheight pt) decorate[decoration={random steps,segment length=2mm,amplitude=.1cm}] {(\myimgwidth,-\myheight pt) -- (0,-\myheight pt)} -- (0,0);
\node[inner sep=0pt, outer sep=0pt, anchor=north west] at (0,0) {\includegraphics[width=\myimgwidth,keepaspectratio]{example-image-a}};
\end{tikzpicture}
\end{document}