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

Joao S. O. Bueno Calligaris gwidion at mpc.com.br
Mon Sep 19 16:37:21 CEST 2005


HI,

I am no PIL developer - I do n't even recall if I ever even built it 
at all - but I have some code I wrote a while ago that could do a 
"generic" combination of two given images, maybe somewhat fast, given 
a kind of  "bytecode"  representing an algebraic expression to use 
with the pixels (just like your expression in the "output" of the 
first e-mail).

If your improvements is going into pil, maybe it will be worth for 
everyone consider adding some of that code as well. (So that, for 
example, any of the GIMP's mare than 20 image combination modes would 
be available in PIL doing as little as adding a constant bytecode for 
each mode).

Regards,
	JS
	-><-


On Monday 19 September 2005 10:30, Laszlo Zsolt Nagy wrote:
>    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.
>
>
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig


More information about the Image-SIG mailing list