Slackware 14.2 64-bit
Python 2.7.13

I am trying to automate some photo processing by pasting a
sig or watermark. The sig image is a .png with transparency
but when it pastes it does so with a black background. Is there
a way to paste with transparency?



from PIL import Image
from PIL import ImageEnhance

fname = "sample.jpg"

im = Image.open(fname)
print(im.format, im.size, im.mode)

out = im.resize((1068, 712))

enh = ImageEnhance.Sharpness(out)
enh = enh.enhance(2.5)

sig = Image.open("/home/tvbare/pics/recent_pics/sigs/opi_sig_landscape.png")
print(sig.format, sig.size, sig.mode)
box = (768, 616, 1018, 662)
enh.paste(sig, box)

enh.show()

--
    Terry "Hoots"

         To stay young, never lose your sense of wonder.


                             *****
             My main photo gallery can be seen at:
           <URL:http://www.flickr.com/photos/tvbare/>

              I also keep a secondary gallery at:
<URL:http://www.facebook.com/pages/Osage-Plains-Images/300412117042>

                             *****

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to