By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,441 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,441 IT Pros & Developers. It's quick & easy.

PIL - Transparency Nightmares

P: n/a
I'm trying to make a simple script which attaches watermarks to every
image in one directory and saves the output image to another. However,
while I understand (in theory at least) what I need to be doing, I
can't figure out where to go from here.

First of all, I have a watermark image and a list of small images
around 120px squared. The watermark uses alpha transparency, so the
background is transparent and the anti-aliased text is partially
transparent. For each image, I crop the watermark to the same size as
the image. Now all I need to do is paste the watermark over the old
image with respect to its transparency.

I've tried Image.blend(), Image.composite(), and im.paste(), but none
of them seem to do exactly what I want. What am I missing here?

Jul 10 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
I RTFM harder, and found that paste with an image mask (using the
watermark as the mask) does the trick.

Jul 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.