I want to annotate an image using tikz callout boxes, but the final size of each image is unknown. Therefore, I would like to be able to adjust the image size and have the tikz callout box still ‘point’ to the correct place.
This MWE explains my problem.
\documentclass[a4paper,10pt]{scrreprt}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.callouts}
\begin{document}
{\huge a}
\newline
\begin{tikzpicture}
\node[] at (3.4,-2.) {\includegraphics[]{example-image}};
\node[draw, fill=red!20,ellipse callout] {Example text};
\end{tikzpicture}
{\huge b}
\newline
\begin{tikzpicture}
\node[] at (3.4,-2.) {\includegraphics[width=5cm]{example-image}};
\node[draw, fill=red!20,ellipse callout] {Example text};
\end{tikzpicture}
\end{document}
In a, the callout box points to the desired position (the top of the I).
In b, I have resized the image but the callout box stays relative to its original positions.



