[Image-SIG] pasting transparent pngs

Christian Klein chris@schwer.bewaff.net
Sat, 14 Jul 2001 16:16:56 +0200


Hello,
I've got another problem:
I want to paste a png with transparent background onto another image.
But instead using the upper image as a "border",
the transparent background appears white.

What am I doing wrong?

regards,
Chris

the code:
border = PIL.Image.open(config.get("ECARD","borderpath") + border)
photo = PIL.Image.open(photo_i[0])
ecard = PIL.Image.new("RGBA", (border.size[0],border.size[1]+text.size[1]+20) ,(255,255,255))
card.paste(photo, (int((border.size[0]-photo.size[0])/2), int ((border.size[1]-photo.size[1])/2)))
ecard.paste(border, (0,0))
ecard.save("%s/%s.jpg" % (config.get("ECARD","tmp_path"), digest.hexdigest()), "Jpeg")

-- 
to understand recursion, we first must understand recursion.

oder: ob du vorne einkellerst oder hinten einschlangst,
nachher landet doch eh alles in den baeumen.