# Gif image in LaTex Beamer

I am trying to create an animation from given *.png files using the following code.

    \documentclass{beamer}
\usepackage{animate}
\begin{document}
\animategraphics[loop,autoplay]{6}{WT_t}{001}{143}

\end{document}


The code runs perfectly and does not give any error but I do not see the image in generated pdf file. Can anyone please help me out?

1. I have a gif file too, is it possible to embed this image directly into my beamer presentation?
• Which PDF viewer are your using? I don't think animations work in all viewers, the safest is Adobe Reader. – Torbjørn T. Aug 21 '16 at 11:15
• I am using Adobe reader (most updated version). I suspect that since size of image is large and it is not in center and within the page width. I do not know how to deal with this. – LatexUser Aug 21 '16 at 11:47
• Try: \noindent\animategraphics[width=\linewidth,loop,autoplay]{6}{WT_t}{001}{143}. – AlexG Aug 21 '16 at 12:39
• Hello AlexG, the code works fine but when I put this code inside " \begin{frame} and\end{frame} '. It does not run. Can you please have a look? – LatexUser Aug 21 '16 at 14:09
• \begin{frame} {Results} \noindent\animategraphics[width=0.2\linewidth,loop,autoplay]‌​{6}{WT_t}{001}{143} \end{frame} I get an error saying "Package animate error:None of the files". I have already defined \usepackage{animate} and I am using \ProvidesClass{Bredelebeamer}. Please have a look. – LatexUser Aug 21 '16 at 16:00

\animategraphics understands the same resizing, scaling and cropping options as package graphicx's \includegraphics.

Thus, once you manage to rescale and include a single image file of the sequence to your liking using \includegraphics, you can readily re-use those settings with \animategraphics, e.g.

\animategraphics[width=\linewidth,loop,autoplay]{6}‌​{WT_t}{001}{143}


(2) And no, there is no direct Gif support in PDF. The usual procedure to convert an existing animated Gif into a numbered PNG sequence is:

convert -coalesce something.gif something.png


Option -coalesce of ImageMagicks' convert command undoes a possible optimization of the Gif file to be converted.

• Thank you very much. The code works using "\noindent\animategraphics[width=\linewidth,loop,autoplay]{6}‌​{WT_t}{001}{143}". But when I insert it inside the " \begin{frame} and\end{frame} '. It does not run. Can you please have a look? – LatexUser Aug 21 '16 at 14:12
• @LatexUser : I ran a test with a set of PNGs of mine without any problem. – AlexG Aug 21 '16 at 14:20
• \begin{frame} {Results} \noindent\animategraphics[width=0.2\linewidth,loop,autoplay]‌​{6}{WT_t}{001}{143} \end{frame} I get an error saying "Package animate error:None of the files". I have already defined \usepackage{animate} and I am using \ProvidesClass{Bredelebeamer}. Please have a look. – LatexUser Aug 21 '16 at 15:56
• @LatexUser TeX seems to be unable to find the image files WT_t001.png ... WT_t143.png . Verify writing and case (lowercase/uppercase) of the filename parts, including the extension. This may be one reason for the failure. – AlexG Aug 22 '16 at 7:35
• Thank you very much. My code works perfectly. I made a silly error in defining image location. – LatexUser Aug 22 '16 at 15:55