title: Python Tkinter perlin noise animation is very slow
body: <p>I'm trying to animate a 2D perlin noise in the 3rd dimension using Tkinter un Python 2.7.
  It's all working, but the performances are <strong>very</strong> low (about 2 fps).</p>
  
  <p>I think that the problem is in the "animate" function, in which I create a new image every time I update the noise.
  How can I achieve a good frame rate? In this code the image is 640x480px, but I need it to be at least 1080x720px.
  I'm open to every type of suggestions (even changing the GUI library).</p>
  
  <pre><code>from Tkinter import *
  from noise import snoise3, pnoise3
  from PIL import Image, ImageTk
  import threading
  
  class Noise:
      def __init__(self):
          self.root = Tk()
          self.w = 640
          self.h = 480
          self.canvas = Canvas(self.root, width = self.w, height = self.h)
          self.canvas.pack()
          self.img = Image.new("1",(self.w,self.h))
          self.pix = self.img.load()
          self.z = 0
          octv = 8
          freq = 16.0 * octv;
          for y in xrange(self.h):
              for x in xrange(self.w):
                  self.pix[x,y] = int(snoise3(x/freq,y/freq,self.z,octaves = octv)*127.0+128.0)
  
          self.image = ImageTk.PhotoImage(self.img)
          self.canvas.create_image(self.w/2,self.h/2,image=self.image)
          self.canvas.pack()
          self.root.after(0, self.tr)
          self.root.mainloop()
  
      def tr(self):
          self.t1 = threading.Thread(target=self.animate)
          self.t1.daemon = True
          self.t1.start()
  
      def animate(self):
          octv = 8
          freq = 16.0 * octv;
          while True:
              self.z += 0.01
              for y in xrange(self.h):
                  for x in xrange(self.w):
                      self.pix[x,y] = int(snoise3(x/freq,y/freq,self.z,octaves = octv)*127.0+128.0)
  
              self.image = ImageTk.PhotoImage(self.img)
              self.canvas.create_image(self.w/2,self.h/2,image=self.image)
              self.canvas.pack()
  
  Noise()
  </code></pre>
  
  <p>Thank you all ^^</p>