title: Matplotlib animation quality loss
body: <p>I'm currently trying to use matplotlib to animate a grid using imshow. However, I am finding a fairly significant quality loss in the animation. </p>
  
  <p>Below is a simple animation that illustrates my issue fairly well. If you look at any particular frame of <em>imagelist</em>, you will see that there is no aliasing or gradient between colours. But if I then look at one frame of my animation, that is no longer the case. There is now a 4-5 pixel  gradient between my blocks of colour. Does anyone know how I can get around this compression? The file size of the animation doesn't matter too much, as long as I can get a good quality animation.</p>
  
  <pre><code>#Create list of images
  image=np.array([[[0,0,0],(0.7,0,0),(0,0,0),(0,0,0.8)]])
  imagelist=[]
  for i in range(0,100):
      image[0][1][0]=i/100
      imagelist.append(np.copy(image))
  
  #Create figure    
  fig = plt.figure()
  plt.axis('off')
  im = plt.imshow(imagelist[0], vmin=0, vmax=255,interpolation='none');
  
  #Animation
  def updatefig(j):
      im.set_array(imagelist[j])
      return [im]
  ani = animation.FuncAnimation(fig, updatefig, frames=range(len(imagelist)), interval=20, blit=False)
  
  #Save animation
  FFMpegWriter = animation.writers['ffmpeg']
  mywriter = FFMpegWriter(fps=30, bitrate=5000)
  ani.save("test.mp4", writer=mywriter,codec="libx264")
  </code></pre>