On 7/2/05, Christian M. Jensen <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Does anyone know of a GUI toolkit that supports alpha blending using PNGs?
>
> Thanks!
> Christian
Here is a snippet from a program that uses PIL to create a rectangle
with alpha-transparent drop shadow around it. (tmp is an image)
import Image
import ImageFilter
import ImageChops
import sys
# draw a filled rectangle on a white background that leaves 8 - 10 px of white
# around the outside edge of the rectangle
...
# add the drop shadow
new = tmp.filter(ImageFilter.BLUR)
new = new.convert("RGBA")
c = new.convert("L")
c = ImageChops.invert(c)
bands = c.split()
new.putalpha(bands[0])
new.show()
--
Matthew Nuzum
www.bearfruit.org
_______________________________________________
Image-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/image-sig