[Tex/LaTex] Crop Image to Circle

tikz-pgf

Can somebody help me figure out how to include a jpg in my CV that is then cropped to a circle?
I already found this question that closely resembles what I am trying to do – however I also would like to reposition the image inside the circle (in case for example the image is larger than the circle and the section I want to show is placed not in the center of the image).

A MWE of what I have right now:

\documentclass{article}

\usepackage{tikz}
\usepackage{mwe}

\begin{document}

\begin{tikzpicture}
    \clip (0,0) circle (2cm) node {\includegraphics[width=10cm]{example-image}};
\end{tikzpicture}

\end{document}

How can one reposition the graphic inside the node?

Best Answer

You can do something like this:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\clip (0,0)  circle (2cm) ;
\node[anchor=center] at (2,1) {\includegraphics[width=10cm]{example-image}}; 
%adjust this coordinate to move image
\end{tikzpicture}

\end{document}

and then shift the image by adjusting the coordinate and anchor of the node. See sample outputs for different coordinates.

enter image description here enter image description here enter image description here