[PYTHON IMAGE-SIG] The PIL library -- specification for release 0.1

Fredrik Lundh fredrik_lundh@ivab.se
Wed, 20 Mar 1996 14:42:22 +0100

Hi everyone,

   Thought it's about time I distributed some more information on the
Python Imaging Library I've been hacking on recently.  I've attached a
specification that attempts to describe what's in the first public

   All comments are welcome.

   If everything goes according to the plans, I'll spend the weekend
putting together a release.

Stay tuned/F


Python Imaging Library (PIL), release 0.1

*** Module Image

class Image:
    "A raster image"
    mode -- number of bands, pixel type ["L", "P", "RGB", "RGBA", "CMYK"]
    palette -- colour table, for "P" type images
    size -- image size in pixels
    info -- associated data (dictionary)
    def convert(mode)
    def copy()
    def crop(box)
    def dither(palette)
    def filter(kernel) -- user-defined 3x3, 5x5 convolutions, integer kernels
    def histogram()
    def load()
    def paste(image, box, [alpha])
    def resize(size)
    def rotate(angle)
    def save(filename, [format])
    def show() -- currently for unix only
    def split()
    def transpose(operation)
    def transform(size, AFFINE, matrix)

def new(mode, size):
    return <Image instance>

def open(filename):
    return <Image instance>

def blend(image, image, ratio):
    return <Image instance>

def join(mode, band, band...):
    return <Image instance>

*** Module ImageFile

class ImageFile(Image):
    "A raster image read from file or stream"
    def load(file)

class XxxImageFile(ImageFile):
    "Read/write XXX file" (see below)

*** Module ImagePalette

class ImagePalette():
    "A colour lookup table for palette images"

def negative():
    return <ImagePalette instance>

def random():
    return <ImagePalette instance>

def wedge():
    return <ImagePalette instance>

*** Module ImageFilter

class ImageFilter():
    "Represents an environment filter operation"

class ImageFilterKernel(ImageFilter):
    "Simple 3x3 and 5x5 integer convolutions"

*** File format support (in release 0.1)

format		supported operations
------		--------------------
BMP		open/read/write
EPS		open (1)
FLI (FLC)	open (1)
GBR		open/read
GIF		open/read
IIF		open/read (2) <preliminary>
JPEG (JFIF)	open/read/write (3)
MSP		open (1)
PBM (PGM/PPM)	open/read/write
PCX		open/read
PSD		open (1)
TIFF		open/read (2)

(1) file is identified (mode, size), but not decoded.
(2) restricted, not full baseline support.
(3) requires IJG JPEG support library (libjpeg)

IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org