Python Imaging Library: Difference between revisions
From charlesreid1
| Line 37: | Line 37: | ||
Average two images, like this: | Average two images, like this: | ||
The average of | The average of these two images: | ||
[[Image:Hipstamatic_0380.JPG|300px]] | [[Image:Hipstamatic_0380.JPG|300px]] and [[Image:Hipstamatic_0390.JPG|300px]] | ||
is: | |||
[[Image:HipstamaticAverage_0380_0390.png|450px]] | [[Image:HipstamaticAverage_0380_0390.png|450px]] | ||
Revision as of 10:11, 18 January 2014
Installing
Pip
The python imaging library can be installed with pip:
$ pip install PIL
Importing
Sometimes you can import the PIL like this:
import PIL as ThePIL
with other installations though, you have to import it like this:
import Image
here is a link with some notes on how to use the PIL when you import it as import Image:
http://effbot.org/imagingbook/introduction.htm
Averaging
Color Averaging
See http://charlesmartinreid.com/wordpress/2012/08/python-image-averaging-and-color-averaging/
Image Averaging
Average two images, like this:
The average of these two images:
is:
Image Averaging for Time Lapses
Why I want to take the average of two images:
I'm taking a timelapse photo, and want to stretch out my frames per second without the video seeming too choppy. So I wanted to add an image between each photo pair that averages the two images, doubling the number of frames and smoothing image transitions in the final timelapse.
Here, image averaging is used for more subtle image differences:
The average of
and
is
