# Cropping an image for use in a tikzpicture

How should I crop an image to use in a tikzpicture?

I declare an image in my header

\pgfdeclareimage{myimage}{image.png}


Then I want to use a cropped version of myimage in a tikzpicture

\begin{tikzpicture}
[...things being drawn...]
\pgfuseimage{image}
\end{tikzpicture}


Is there an option akin to \includegraphics[trim={0 1cm 0 0}]{image}?

• why not \node[inner sep=0pt]{\includegraphics[trim={0 1cm 0 0}]{image}};? – Ignasi Jun 26 '18 at 13:13
• @CarLaTeX Done! – Ignasi Apr 23 '19 at 8:34

An \includegraphics command can be used in node's contents part, therefore if \includegraphics[trim={0 1cm 0 0}]{image} is the desired solution, just insert it into a node:
\node[inner sep=0pt]{\includegraphics[trim={0 1cm 0 0}]{image}};

inner sep=0pt is included to avoid any empty space between the image and node's border.