![삽입된 그래픽 - 가장자리가 들쭉날쭉하여 전체의 일부임을 보여줍니다.](https://rvso.com/image/330744/%EC%82%BD%EC%9E%85%EB%90%9C%20%EA%B7%B8%EB%9E%98%ED%94%BD%20-%20%EA%B0%80%EC%9E%A5%EC%9E%90%EB%A6%AC%EA%B0%80%20%EB%93%A4%EC%AD%89%EB%82%A0%EC%AD%89%ED%95%98%EC%97%AC%20%EC%A0%84%EC%B2%B4%EC%9D%98%20%EC%9D%BC%EB%B6%80%EC%9E%84%EC%9D%84%20%EB%B3%B4%EC%97%AC%EC%A4%8D%EB%8B%88%EB%8B%A4..png)
답변1
TikZ에서 를 사용하여 decorations
경로를 모핑 할 수 있습니다 random steps
. 물론 이러한 무작위 단계를 사용자 정의할 수도 있습니다.
\clip
이미지의 왼쪽 상단부터 시작하여 오른쪽 상단, 약 2/3까지 내려간 다음 경로를 닫기 전에 다시 왼쪽으로 하드 코딩된 좌표를 사용했습니다 . 포함 그래픽 을 변경하는 경우 width
이에 따라 클리핑 좌표를 변경해야 합니다.
이 문제는 변수를 사용하여 쉽게 해결할 수 있습니다.
산출
암호
\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}