Shaping an image like a circle
A circular shape can add a stylish touch to portrait photographs, an organizational chart, or photos on a website.
How to do it...
As in the previous recipe, we will define a TikZ macro for this purpose. Take a look at the following steps:
- Load the TikZ package:
\usepackage{tikz}
- Define a macro so we can use it often:
\newcommand{\roundpic}[4][]{ \tikz\node [circle, minimum width = #2, path picture = { \node[#1] at (path picture bounding box.center){ \includegraphics[width=#3]{#4}}; }] {};}
- Use the new macro within your document to include an image:
\roundpic[xshift=-1cm, yshift=-2.6cm]{5.8cm}{9cm}{filename}
- Compile the document. When I used a photo of my dog (here using xshift and yshift to select the desired area of the photo), I got the following image:
...