title: python PIL - check if image is transparent
body: <p>I am pasting an image on another image, and after looking at <a href="https://stackoverflow.com/questions/5324647/how-to-merge-a-transparent-png-image-with-another-image-using-pil">this</a> question, I saw that in order to paste a <strong>transparent</strong> image, you need to do </p>
  
  <pre><code>background = Image.open("test1.png")
  foreground = Image.open("test2.png")
  
  background.paste(foreground, (0, 0), foreground)
  </code></pre>
  
  <p>with a <strong>normal</strong> image, you should do </p>
  
  <pre><code>background = Image.open("test1.png")
  foreground = Image.open("test2.png")
  
  background.paste(foreground, (0, 0)) // difference here
  </code></pre>
  
  <p>my question is, how can I check if an image it transparent so I can determine how to use the <code>paste</code> method (with or without the last parameter).</p>