title: matplotlib animation: write to png files without third party module
body: <p>The animation module in matplotlib usually requires third party modules like FFmpeg, mencoder or imagemagik to be able to save the animation to a file (e.g. here: <a href="https://stackoverflow.com/a/25143651/5082048">https://stackoverflow.com/a/25143651/5082048</a>).</p>
  
  <p>Even the MovieWriter class in matplotlib seems to be build in a way that third party modules will be incorporated (starting and closing processes, cummunicating via pipe): <a href="http://matplotlib.org/api/animation_api.html#matplotlib.animation.MovieWriter" rel="nofollow noreferrer">http://matplotlib.org/api/animation_api.html#matplotlib.animation.MovieWriter</a>.</p>
  
  <p>I am looking for a way, how I can save a <code>matplotlib.animation.FuncAnimation</code> object frame to frame to png -  directly, within python. Afterwards, I want to show the .png files as animation in an iPython notebook using this approach: <a href="https://github.com/PBrockmann/ipython_animation_javascript_tool/" rel="nofollow noreferrer">https://github.com/PBrockmann/ipython_animation_javascript_tool/</a></p>
  
  <p>Therefore my questions are: </p>
  
  <ul>
  <li>How can I save an <code>matplotlib.animation.FuncAnimation</code> object directly to .png files without the need to use third party modules? </li>
  <li>Is there a writer class implemented for this usecase?</li>
  <li>How can I get figure objects frame by frame out of the FuncAnimation object (so that I could save them myself)?</li>
  </ul>
  
  <p>Edit: The <code>matplotlib.animation.FuncAnimation</code> object is given, the task is to save it's frames using pure Python. Unfortunately, I cannot change the underlying animation function as ImportanceOfBeingErnest suggested.</p>