Harald: I know this is an old question but my feeling was in wasn't really answered properly, possibly because I inadvertantly took it off track with a response which had an aside on SAGE searching.
Since PIL has come up a few times on SAGE lists in vague ways, I thought I'd try to be more detailed. Here is a way using SAGE which might help. First, it requires some preparation. I'll assume you have installed sage in SAGEROOT (an absolute pathname). (I'm going to go into more detail that I know you need Harald since I hope to help others who might know less about SAGE too). You must install PIL from http://www.pythonware.com/products/pil/. Here's how: (a) download the tarball from a link on the URL mentioned above, say http://effbot.org/downloads/Imaging-1.1.6.tar.gz; (b) extract it to SAGEROOT/local/lib/python/site-packages (c) cd SAGEROOT/local/lib/python2.5/site-packages/Imaging-1.1.6 (d) run ../../../../bin/python setup.py install (e) install ImageMagick (unless you have xv installed, which you probably don't); in ubuntu, it's sudo apt-get install imagemagick (or sudo apt-cache search imagemagick, and install a bunch of related packages too); (f) in sage, type sage: from PIL import Image sage: im = Image.open("PATH/mypic.jpg") sage: im.show(command="display") Of course, im.[TAB] gives you more commands to play with and the online tutorial http://www.pythonware.com/library/pil/handbook/introduction.htm helps too. Hope this is more helpful, even if it a little late. - David Joyner On Thu, Apr 17, 2008 at 8:07 AM, Harald Schilly <[EMAIL PROTECTED]> wrote: > > Hi > > A friend of mine want's to manipulate pictures (bitmap, in color). > Basically, he want's to load and then represent them as a binary > vector in Sage and then encode them using linear codes -> > manipulations (errors) -> then back to an image and see how good the > code worked. > The one thing I don't know is what's the best and easiest way to get a > binary representation of an image to be able to work with - a > bijection from picture to binary vector in GF(2) and back. Maybe in > different versions (each color channel separate or other methods). > > Harald > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
