Inserted graphic - jagged edges to show that it is just part of the whole

I would like to make visibly clear, that an inserted graphic is just part of the whole. Since a straight cut just appears as inserted falsy, I was wondering if there are any tricks to show jags for the trimmed sides. Something like this for instance:

-
I will have a look for this, thanks! – Eric Mar 25 at 15:55
– touhami Mar 25 at 16:11

You can use decorations in TikZ to morph a path using random steps. Of course, you can customize these random steps.

I used a \clip with hard-coded coordinates starting from the top left of the image, then top right, down to about 2/3 then left again before closing the path. If you change the width of the includegraphics, make sure to change the clipping coordinates accordingly.

Although this can be solved easily using variables.

Code

\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}

-
This seems to be a great solution. Would you mind to show quickly how to apply this TikZ effect on a includegraphic? – Eric Mar 25 at 16:36
@Eric This effect was applied on an includegraphics from the start. I only edited it because the randomized line was not horizontal. :D – Alenanno Mar 25 at 16:37
I have some tricky effects of resolution --- namely, sometime half of the border line of the graphics appears. Changing \fill to draw[red, fill=white] I have this: i.imgur.com/QIi04xU.png (viewer dependent, but also probably printer dependent...) – Rmano Mar 25 at 17:21
@Rmano That's not a tricky effect, that's the rectangle I have drawn on top of the graphics that is filled with white. I'll find a solution to draw only the decoration. – Alenanno Mar 25 at 17:28
@Eric See new edit. If using this in an article class gives you an overfull \hbox I suggest reducing the width. – Alenanno Mar 25 at 19:11