Hi:

I'm working on a user-friendly, intuitive interface to PIL and have some
questions. Before preparing a patch, I was hoping that members of this
group would suggest ways to proceed.

Here is what I've done so far: in the module pil.py, posted to
http://sage.math.washington.edu/home/wdj/patches/pil.py
there are wrappers for PIL methods which will implement
autocontrast
blend
convert
crop
various filters (sharpening, for example)
roll  (shift the pixels, with wrapping)
text ,
among others. These are all implemented as functions.
The docstrings require a few image test files,
http://sage.math.washington.edu/home/wdj/patches/pil-test-image1.png
http://sage.math.washington.edu/home/wdj/patches/pil-test-image2.png
(photos of mine which I placed in the public domain)

To test this module out, you can (for example) (a) create
a clone, (b) copy it to sage/interfaces, (c) copy the png files
somewhere on your computer, (d) start Sage and
type from sage.interfaces.pil import *. The paths in the docstrings need to
be modified to the paths you placed the png files in.

Questions:

1. Where should this module go? In sage/interfaces?

2. Should I create up a "wrapper class" for PIL (say, "class
PILimage(SageObject):"?)
    and copy the wrapper functions (mentioned above) to methods of it?

3. Should I provide an interface with Graphics objects? In other words,
    instead of providing a raster image (such as pil-test-image.png)
    to create an instance of the PILimage class, once could also
    provide and instand of the Graphics class. (I don't know how to do
    this right now, but am wondering on what others thing of this idea.)

4. Should I interface also with pyglet classes? (Pyglet is included with
    sympy, hence with sage, and does some very very basic "image
    processing".) Again, I don't know how this would be done...

Thanks in advance for any feedback.

- David Joyner

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to