问题
Possible Duplicate:
How to merge a transparant png image with another image using PIL
I have a couple of PNG files:
http://dl.dropbox.com/u/6599273/testing/image1.png
http://dl.dropbox.com/u/6599273/testing/image2.png
As you can see, those images have transparent parts. When you put one on top each other they will form a nice looking image. Here, the composed image:
http://dl.dropbox.com/u/6599273/testing/image_composed.png
I composed the image using paint.net in a really straightforward way (drag&drop). But I need to do it programatically, using Python. And generalized to thousand of images like those (all same dimensions: 256x256 px)
How could I do it? I'm experimenting with PIL. Is it possible?
Many thanks in advance, and best regards
回答1:
This question was already answered at How to merge a transparant png image with another image using PIL. Use the paste
method of PIL images
来源:https://stackoverflow.com/questions/8881002/python-combine-two-png-files-as-layers