PIL 1.1.4 paste PNG's with transparency problem

C

Caleb Hattingh

Here's hoping effbot is around :)

I have a really simple situation where I have 2 png images, and open them
so:

'>>> iconBallImage =
Image.open('sampleTextures/iconBall.png').resize(DimensionSize)
'>>> iconShieldImage =
Image.open('sampleTextures/iconShield.png').resize(DimensionSize)

The 2nd image has an alpha channel with transparency. The first one also
has an alpha channel, but is fully opaque. Then I paste the second image
into the first image:

'>>> iconBallImage.paste(iconShieldImage, (10,10))

Then I save:

'>>> iconBallImage.save('sampleTextures/output.png')

When I view "output.png" in the Gimp, I see that the transparent bits in
the second image appear as a grey-crosshatching pattern. There is an
alpha channel in the new image, but I expected to see that bits of the
original first image would peer through the transparent bits of the
original second image.

I fully expect I am doing something wrong here, I just don't know what.

Thanks
Caleb
 
C

Caleb Hattingh

Wow, that was pretty clueless of me...right there on the *next* page of
the manual (I thought "im.paste(image, box)" and "im.paste(image, color)"
were the general forms for "paste", apparently didn't look further)

thx
Caleb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top