I have a long article with many, say, TikZ images. Let's say it looks like:
\documentclass{article}
\usepackage{tikz}
\begin{document}
...much more stuff...
\begin{tikzpicture}
\draw[red] (0,0) -- (1,1);
\end{tikzpicture}
...much more stuff...
\end{document}
Now from this file, I want to render the whole article into a pdf and also the tikzpicture into a PNG. This has to happen automatically with latex since I want to write a package that uses this.
(So answering "Oh, just copy and paste the image code to a separate file." is not helpful.)
external
library, if you have ImageMagick (or presumably some other converter) installed.