[Image-SIG] New patch to PIL (was: Re: Bad antialias? (in Python Imaging Library 1.1.5))

Laszlo Zsolt Nagy gandalf at designaproduct.biz
Mon Sep 19 15:30:34 CEST 2005


   Hello,

I created a patch for PIL, exporting a new factory function:

Image.overlay(image1,image2) -> image

[image1 and image2 must be in RGBA mode]

The resulting image looks like image2 placed over image1. It handles 
transparency correctly. E.g. if image1 has opacity 50% and image2 has 
opacity 50% then the resulting image will have opacity 75%  ( 100% * 
(0.5 + 0.5*0.5 ) and pixel values will be weighted using the opacity 
values. I found no way in Python to do this. I believe that Draw.text 
should use this method for RGBA images and antialiased fonts (instead of 
what it is using now). I explained why and included a faulty text() output.

I read in the PIL documentation that this list is the right place to get 
answers about PIL. Since nobody could give me an answer to my problem, I 
created this patch. But I got no answers since 6 hours. I do not know 
what it means. Either it is a time zone issue or it is because this list 
is abandoned. I'm going to wait some more and re-post in the main python 
list.

  Les

p.s.: I think I have another improvement, I really want to touch base 
with the authors of PIL.




More information about the Image-SIG mailing list