# 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. Aug 21, 2016 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. Aug 21, 2016 at 11:47
• Try: \noindent\animategraphics[width=\linewidth,loop,autoplay]{6}{WT_t}{001}{143}. Aug 21, 2016 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? Aug 21, 2016 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. Aug 21, 2016 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? Aug 21, 2016 at 14:12
• @LatexUser : I ran a test with a set of PNGs of mine without any problem. Aug 21, 2016 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. Aug 21, 2016 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. Aug 22, 2016 at 7:35
• Thank you very much. My code works perfectly. I made a silly error in defining image location. Aug 22, 2016 at 15:55

Although the question is old, I think it's still worth answering concerning the GIF part.

I've discovered the multimedia package (which comes bundled with beamer and is documented in beamer's user guide) supports the GIF format.

And, for Linux users, it works on Ubuntu's default PDF viewer (20.04)!

I can't get it to loop though. The problem seems not limited to the GIF format, I tried to work around it using mp4 but it didn't work, see see loop video clip in beamer

\documentclass{beamer}
[...]
\usepackage{multimedia}
[...]
\movie[<options>]{\includegraphics[width=\columnwidth]{poster-image}}{my-beautiful-gif.gif}