If I have two images side by side, how do I include an inset using tikz as shown below: enter image description here

Thank you very much!


I use three nodes: first node a contains left image, the second b contains the right image and is shifted of 1 cm from first one. Last node c points out the area you want. Right image is repeated a second time to overlap partially the \draw(c.north east) -- (b.north east); and \draw(c.south east) -- (b.south east);.

\node(b)[inner sep=0pt,right = 1cm of a] {\phantom{\includegraphics[width=.4\textwidth]{example-image-b}}};
\node(c)[draw,minimum size=2cm, at=(a)]{};
\draw(c.north east) -- (b.north east);
\draw(c.south east) -- (b.south east);
\draw(c.north west) -- (b.north west);
\draw(c.south west) -- (b.south west);
\node [at=(b),inner sep=0pt,right = 1cm of a] {\includegraphics[width=.4\textwidth]{example-image-b}};


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.