[Image-SIG] frame averaging

Jeff Epler jepler at unpythonic.net
Wed Jul 27 20:08:44 CEST 2005


There is 'ImageChops.add'.  If you have only two images, or you have a
number of images that is a power of two, you can use it.  Something like
    result = ImageChops.add(image_1, image_2, 2, 0)
For more than two images, average image 2*j and image 2*j+1 so that you
get half as many result images.  Repeat until there is only a single
result image.

This will of course round the images to 8 bits at each step.  You can do
better by using numarray.  If you start with images of depth 8, and you
have less than 2^24 of them, then you can simply sum them into a single
32-bit buffer, then divide by the number of images if you want to get an
8-bit result, or simply use the full range of values in your next step.
    http://effbot.org/zone/pil-numpy.htm

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/image-sig/attachments/20050727/a85c7f10/attachment.pgp


More information about the Image-SIG mailing list