Python Imaging Library: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 1: | Line 1: | ||
=Installing= | |||
==Pip== | |||
The python imaging library can be installed with pip: | |||
<source lang="bash"> | |||
$ pip install PIL | |||
</source> | |||
==Importing== | |||
Sometimes you can import the PIL like this: | |||
<source lang="python"> | |||
import PIL as ThePIL | |||
</source> | |||
with other installations though, you have to import it like this: | |||
<source lang="python"> | |||
import Image | |||
</source> | |||
=Averaging= | =Averaging= | ||
Revision as of 09:56, 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
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 this image:
and this image:
yields this image:
File:HipstamaticAverage 0380 0390.JPG
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
