Python PIL: how to make area transparent in PNG?

I've been using PIL to crop Images, now I also want to make certain rectangular areas transparent, say

from PIL import Image
im = Image.open("sample.png")
transparent_area = (50,80,100,200)
...

I'd really appreciate some code as I haven't been able to find it, thanks a lot in advance!

Cheers,

Hoff

12
задан Hoff 7 December 2010 в 18:03
поделиться