Changes in Python Imaging Library 1.1.5
Update 2005-03-28: Python Imaging Library 1.1.5 is out! You can get it directly from effbot.org.
Welcome to effbot.org!
PIL 1.1.5 is available in the effbot.org downloads section.
Changes from release 1.1.4 to 1.1.5
- Added documentation pages to the source distribution (based on PythonDoc markup). See Docs/index.html.
- Added experimental PERSPECTIVE transform method (from Jeff Breidenbach).
- Make sure “thumbnail” never generates zero-wide or zero-high images (reported by Gene Skonicki)
- Fixed a “getcolors” bug that could result in a zero count for some colors, especially with low maxcolors settings (reported by Richard Oudkerk).
- Changed default “convert” palette to avoid “rounding errors” when round-tripping white source pixels (reported by Henryk Gerlach and Jeff Epler).
- Don’t crash in “quantize” method if the number of colors requested is larger than 256. This release raises a ValueError exception; future versions may return a mode “RGB” image instead (reported by Richard Oudkerk).
- Added WBMP read/write support (based on code by Duncan Booth).
- Added DPI read/write support to the PNG codec. The decoder sets the info[“dpi”] attribute for PNG files with appropriate resolution settings. The encoder uses the “dpi” option (based on code by Niki Spahiev).
- Added limited support for “point” mappings from mode “I” to mode “L”. Only 16-bit values are supported (other values are clipped), the lookup table must contain exactly 65536 entries, and the mode argument must be set to “L”.
- Added support for Mac OS X icns files (based on code by Bob Ippolito).
- Added “ModeFilter” support to the ImageFilter module.
- Added support for Spider images (from William Baxter). See the comments in PIL/SpiderImagePlugin.py for more information on this format.
- Added new Sane release (from Ralph Heinkel). See the Sane/README and Sane/CHANGES files for more information.
- Added experimental PngInfo chunk container to the PngImageFile module. This can be used to add arbitrary chunks to a PNG file. Create a PngInfo instance, use “add” or “add_text” to add chunks, and pass the instance as the “pnginfo” option when saving the file.
- Added “getpalette” method. This returns the palette as a list, or None if the image has no palette. To modify the palette, use “getpalette” to fetch the current palette, modify the list, and put it back using “putpalette”.
- Added optional flattening to the ImagePath “tolist” method. tolist() or tolist(0) returns a list of 2-tuples, as before. tolist(1) returns a flattened list instead.
- Fixed BILINEAR/BICUBIC/ANTIALIAS filtering for mode “LA”.
- Added “getcolors()” method. This is similar to the existing histogram
method, but looks at color values instead of individual layers,
and returns an unsorted list of (count, color) tuples.
By default, the method returns None if finds more than 256 colors. If you need to look for more colors, you can pass in a limit (this is used to allocate internal tables, so you probably don’t want to pass in too large values).
- The “save” method now looks for a file format driver before creating the file.
- Don’t use antialiased truetype fonts when drawing in mode P, I, and F images.
- Rewrote the “setup.py” file. The new version scans for available
support libraries, and configures both the libImaging core library
and the bindings in one step.
To use specific versions of the libraries, edit the ROOT variables in the setup.py file.
- Removed threaded “show” viewer; use the old “show” implementation instead. (Windows).
- Added deprecation warnings to Image.offset, ImageDraw.setink, and ImageDraw.setfill.
- Added width option to ImageDraw.line(). The current implementation works best for straight lines; it does not support line joins, so polylines won’t look good.
- ImageDraw.Draw is now a factory function instead of a class. If you need to create custom draw classes, inherit from the ImageDraw class. All other code should use the factory function.
- Fixed loading of certain PCX files (problem reported by Greg Hamilton, who also provided samples).
- Changed _imagingft.c to require FreeType 2.1 or newer. The module can still be built with earlier versions; see comments in _imagingft.c for details.
- Added ‘getim’ method, which returns a PyCObject wrapping an Imaging pointer. The description string is set to IMAGING_MAGIC. See Imaging.h for pointer and string declarations.
- Fixed reading of TIFF JPEG images (problem reported by Ulrik Svensson).
- Made ImageColor work under Python 1.5.2
- Fixed division by zero “equalize” on very small images (from Douglas Bagnall).
- The “paste” method now supports the alternative “paste(im, mask)” syntax (in this case, the box defaults to im’s bounding box).
- The “ImageFile.Parser” class now works also for PNG files with more than one IDAT block.
- Added DPI read/write to the TIFF codec, and fixed writing of rational values. The decoder sets the info[“dpi”] attribute for TIFF files with appropriate resolution settings. The encoder uses the “dpi” option.
- Disable interlacing for small (or narrow) GIF images, to work around what appears to be a hard-to-find bug in PIL’s GIF encoder.
- Fixed writing of mode “P” PDF images. Made mode “1” PDF images smaller.
- Made the XBM reader a bit more robust; the file may now start with a few whitespace characters.
- Added support for enhanced metafiles to the WMF driver. The separate PILWMF kit lets you render both placeable WMF files and EMF files as raster images. See http://effbot.org/downloads#pilwmf.
- Replaced broken WMF driver with a WMF stub plugin (see below).
- Fixed writing of 1, L, and CMYK PDF images (based on input from Nicholas Riley and others).
- Fixed adaptive palette conversion for zero-width or zero-height images (from Chris Cogdon)
- Fixed reading of PNG images from QuickTime 6 (from Paul Pharr)
- Added support for StubImageFile plugins, including stub plugins for BUFR, FITS, GRIB, and HDF5 files. A stub plugin can identify a given file format, but relies on application code to open and save files in that format.
- Added optional “encoding” argument to the ImageFont.truetype
factory. This argument can be used to specify non-Unicode character
maps for fonts that support that. For example, to draw text using
the Microsoft Symbol font, use:
font = ImageFont.truetype("symbol.ttf", 16, encoding="symb") draw.text((0, 0), unichr(0xF000 + 0xAA))(note that the symbol font uses characters in the 0xF000-0xF0FF range)
Common encodings are “unic” (Unicode), “symb” (Microsoft Symbol), “ADOB” (Adobe Standard), “ADBE” (Adobe Expert), and “armn” (Apple Roman). See the FreeType documentation for more information.
- Made “putalpha” a bit more robust; you can now attach an alpha layer to a plain “L” or “RGB” image, and you can also specify constant alphas instead of alpha layers (using integers or colour names).
- Added experimental “LA” mode support.
An “LA” image is an “L” image with an attached transparency layer. Note that support for “LA” is not complete; some operations may fail or produce unexpected results.
- Added “RankFilter”, “MinFilter”, “MedianFilter”, and “MaxFilter” classes to the ImageFilter module.
- Improved support for applications using multiple threads; PIL now releases the global interpreter lock for many CPU-intensive operations (based on work by Kevin Cazabon).
- Ignore Unicode characters in the PCF loader (from Andres Polit)
- Fixed typo in OleFileIO.loadfat, which could affect loading of FlashPix and Image Composer images (Daniel Haertle)
- Fixed building on platforms that have Freetype but don’t have Tcl/Tk (Jack Jansen, Luciano Nocera, Piet van Oostrum and others)
- Added EXIF GPSInfo read support for JPEG files. To extract
GPSInfo information, open the file, extract the exif dictionary,
and check for the key 0x8825 (GPSInfo). If present, it contains
a dictionary mapping GPS keys to GPS values. For a list of keys,
see the EXIF specification.
The “ExifTags” module contains a GPSTAGS dictionary mapping GPS tags to tag names.
- Added DPI read support to the PCX and DCX codecs (info[“dpi”]).
- The “show” methods now uses a built-in image viewer on Windows. This viewer creates an instance of the ImageWindow class (see below) and keeps it running in a separate thread.
- Added experimental “Window” and “ImageWindow” classes to the ImageWin module. These classes allow you to create a WCK-style toplevel window, and use it to display raster data.
- Fixed some Python 1.5.2 issues (to build under 1.5.2, use the Makefile.pre.in/Setup.in approach)
- Added support for the TIFF FillOrder tag. PIL can read mode “1”, “L”, “P” and “RGB” images with non-standard FillOrder (based on input from Jeff Breidenbach).