Consider this application:
\documentclass[border=5pt]{standalone}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node(a) at (0.0, 0.0)[anchor=south west]{\includegraphics[width=0.3\paperwidth]{example-image-a}};
\draw[blue, fill=red] (0.15\paperwidth, 0.0\paperwidth) rectangle (0.3\paperwidth, 0.15\paperwidth);
\end{tikzpicture}
\end{document}
My goal is to draw a rectangle over the right half of the example image. I am guessing the rectangle coordinates knowing that the width is width=0.3\paperwidth
and approximately the aspect ratio.
I would like to be very precise. How can I draw the rectangle over exactly the half of example image a? Such as knowing the height and width of node a
.