I have looked at tutorials, other stackoverflow questions and the PIL documentation itself, but I'm still still not sure how to do it.
I'd like to start fading an image vertically at approximately 55% down the y-axis, and have the image completely transparent at approximately 75%. It's important that I preserve the full height of the image, even though the last 25% or so should be completely transparent.
Is this possible to do with PIL?
解决方案
Sure it's doable.
Let's assume that you're starting off with an image with no transparency (because otherwise, your question is ambiguous).
Step 1: Add an alpha plane. That's just putalpha, unless you're dealing with a non-planar image, in which case you'll need to convert it to RGB or L first.
Step 2: Iterate through the pixels you want to change by using the pixel array