These are a few random projects. They range from very useful to totally frivolous. Consider them all to be under the GPL.
This script describes the NumPil Python Module. It is distributed
under the GPL. Have fun.
Brian Hone 3/24/2002
Overview:
=========
This python module is a translator for PIL and Numeric.
It can be used to load an image into a Numeric array,
or load a numeric array as a PIL image.
Implementation:
===============
Black and White -- All images are treated as 8 bit Greyscale.
Color - All image are treated as 8 bit RGB.
Code:
=====
Here's some example code:
import numpil
a = numpil.numpil()
b = numpil.numpil()
# load an image using PIL (into a.img)
a.loadImage('gs.jpg')
# create a Numeric object (into a.numHandle)
a.greyToNumeric()
# copy that Numeric object into b.numHandle
b.numHandle = a.numHandle
# create a PIL object (into b.img)
b.numToGrey()
b.img.save('foo.bmp')
# do the same thing with a color image
a.loadImage('/Users/bhone/foo.jpg')
a.colToNumeric()
b.numHandle = a.numHandle
b.numToCol()
b.img.save('foo.bmp')
ToDo:
=====
Do more with various bit-depths. This way works, but doesn't
uses extra space for lower resolution.
| numpil (version 0.1, Mar 23, 2002) | index /Library/WebServer/Documents/projects/NumPil/numpil.py |
| Modules | ||||||
| ||||||
| Classes | ||||||||||
| ||||||||||
| Functions | ||
| ||
| Data | ||
| __author__ = 'Brian Hone' __date__ = 'Mar 23, 2002' __email__ = 'bhone@eink.com' __file__ = './numpil.pyc' __name__ = 'numpil' __version__ = '0.1' | ||
| Author | ||
| Brian Hone | ||