title: Tkinter Image transparency
body: <p>So I have 2 images that I would like to display on top of each other.
  The image on top should have transparency so that the one on the bottom is visible.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>from Tkinter import *
  import ttk
  from PIL import Image, ImageTk
  
  root = Tk()
  
  face = Image.open("faces/face.gif")
  eyes = Image.open("faces/eyes1.png")
  face = face.convert("RGBA")
  eyes = eyes.convert("RGBA")
  facedatas = face.getdata()
  eyesdatas = eyes.getdata()
  
  newData = []
  for item in eyesdatas:
      if item[0] == 255 and item[1] == 255 and item[2] == 255:
          newData.append((255, 255, 255, 0))
      else:
          newData.append(item)
  
  eyes.putdata(newData)
  eyes.save("eyes0.png", "PNG")
  
  facepic = ImageTk.PhotoImage(face)
  eyespic = ImageTk.PhotoImage(eyes)
  
  label1 = Label(image=facepic)
  label1.image = facepic
  label1.grid(row = 0, column = 0)
  
  label2 = Label(image=eyespic)
  label2.image = eyespic
  label2.grid(row = 0, column = 0)
  
  root.mainloop()
  </code></pre>
  
  <p>And here is what I get when I run it:</p>
  
  <p><a href="https://i.stack.imgur.com/qn8VB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qn8VB.jpg" alt="Eyes"></a></p>
  
  <p>When I would like to obtain this:</p>
  
  <p><a href="https://i.stack.imgur.com/bAiJk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bAiJk.jpg" alt="face and eyes"></a></p>
  
  <p>With the face in the bottom and the eyes on top.</p>