Calling img.filter(ImageFilter.SMOOTH) destroys partially-transparent alpha?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Calling img.filter(ImageFilter.SMOOTH) destroys partially-transparent alpha?

jumpfroggy
Sorry if this has been covered, I couldn't seem to find anything on it.

I have a transparent PNG file.  I want to render nicely-smoothed,
transparent antialiased text on top of it.  This will be pasted onto
other images, so I can't have the typical background-blended antialias
edges PIL normally does.

I used Ned Batchelder's method
(http://nedbatchelder.com/blog/200801/truly_transparent_text_with_pil.html)
for rendering antialiased text, and that works.

But when I try to run "img.filter(ImageFilter.SMOOTH)", the filter
replaces all semi-transparent values with the background color blended
ones instead.

How can I run a smoothing filter on an image with per-pixel alpha
without destroying it?  Thanks!

-James
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig