pythonware.com ::: library ::: Python Imaging Library Handbook (2003 Edition)

Back   Next

On this page:
Example
Classes

The ImagePalette Module

To use the ImagePalette class and related functions, import the ImagePalette module.

Example

Attach a Palette to an Image
import ImagePalette

im.putpalette(ImagePalette.ImagePalette("RGB"))

Classes

ImagePalette

ImagePalette.ImagePalette(mode="RGB") => palette instance

This constructor creates a new palette, mapping from "P" to the given mode. The palette is initialised to a linear grayscale ramp.

Back   Next