europython

spent parts of last week and the weekend in Florence (*) which was awesome as usual (both the city and the conference).

since I'm lazy, I didn't see all the talks I should have seen, and I also didn't attend the full sprints, but dropped by to say hi, and also ran my own micro-sprint (until the laptop battery ran out) which I used to add support for a new file format to PIL:

>>> from PIL import Image
>>> im = Image.open("Images/lena.webp")
>>> im
<PIL.WebPImagePlugin.WebPImageFile image mode=RGB size=128x128 at 0x7F00EB3D0350>

the code supports reading and writing RGB images only (which is the only pixel layout currently supported by the WebP format). the only option is "quality" which ranges from 1-100 (0 being "default", which currently corresponds to 75). some examples:

>>> im.save("out.webp")
>>> os.path.getsize("out.webp")
3350
>>> im.save("out.webp", quality=50)
>>> os.path.getsize("out.webp")
2824
>>> im.save("out.webp", quality=20)
>>> os.path.getsize("out.webp")
1758

 the current snapshot can be found in the development repository, as usual.

Img_3070

*) well, I ended up spending Monday there as well, which was less awesome -- the Swiss flight was cancelled due to mechanical problems, and then they had me stand in line for 3.5 hours to get a new booking. 24 hours later. yay! and when I finally made it to Zurich, SBB was late too -- it took 13 minutes longer than usual to make it home. outrage.

progress

still a ton of work to do, but it's a start:

$ tar xvfz PIL-1.2a0.tar.gz
...
$ cd PIL-1.2a0/
$ python3 setup.py install --prefix .
...

$ cd lib/python3.1/site-packages/
$ python3

Python 3.1.2 (r312:79147, Apr 15 2010, 15:35:48) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> im = Image.open("../../../Images/lena.png")
>>> im
<PIL.PngImagePlugin.PngImageFile image mode=RGB size=128x128 at 0xE6B1D0>
>>>

the current 1.2a0 snapshot can be found in the development repository.

ANN: PIL 1.1.7 (November 15, 2009)

I just tagged and posted tarballs and binaries for 1.1.7 final, which is basically release candidate 1 with very some minor tweaks.  If you're upgrading from 1.1.6, you'll get tons of bug fixes, and numerous new features, including colour management support (based on Kevin Cazabon's pyCMS package), improvements to the PNG codecs (support for reading interlaced files from Conrado Porto Lopes Gouvêa,  improved compression from Alexey Borzenkov), improved support for Python 2.5 and later on 64-bit platforms, and lots of other tweaks and fixes.  For more details, see the CHANGES file.  Many thanks to everyone who's contributed!

You can get the code from effbot.org by going directly to:

   http://effbot.org/downloads/#pil

which includes a distutils source archive, Windows binaries for 2.4 and newer, and a subversion vendor drop for use with svn:externals.  In addition, there's an old-school tarball available at:

  http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz

and Mercurial users can find a "stable fork" of the development tree at http://hg.effbot.org/pil-117 (which also has downloads available).

Enjoy! /F