title: Python: Combining images using paste with overlapping pixels and areas with alpha channel=0
body: <p>I am trying to combine three images together.  The image I want on the bottom is a 700x900 image with all black pixels.  On top of that I want to paste an image that is 400x400 with an offset of 100,200.  On top of that I want to paste an image border that is 700x900.  The image border has alpha=0 in the inside of it and alpha=0 around it because it doesn't have straight edges.  When I run the code I have pasted below I encounter 2 problems: </p>
  
  <p>1) Everywhere on the border image where the alpha channel = 0, the alpha channel has been set to 255 and the color white shows instead of the black background and the image I am putting the border around. </p>
  
  <p>2) The border image's quality has been significantly reduced and looks a lot different than it should. </p>
  
  <p>Also: part of the border image will cover part of the Image I am putting the border around.  So I can't just switch the order that I am pasting.</p>
  
  <p>Thanks in advance for any help.</p>
  
  <pre><code>#!/usr/bin/python -tt
  
  from PIL import ImageTk, Image
  
  old_im2 = Image.open('backgroundImage1.jpg') # size = 400x400
  old_im = Image.open('topImage.png') # size = 700x900
  new_size = (700,900)
  new_im = Image.new("RGBA", new_size) # makes the black image
  new_im.paste(old_im2, (100, 200))
  new_im.paste(old_im,(0,0))
  
  new_im.show()
  new_im.save('final.jpg')
  </code></pre>