PIL Canonical Image Format

PIL currently supports the following image data formats:

RGB - 24 bit colour, 8 bits for Red, 8 bits for Green, 8 bits for Blue.
HSV - Hue, Saturation and Value (Intensity);
GRAY - 8 bit intensity gray scale image data.


The following information is encapsulated into a structure Image.

 int width;
 int height;
 int bitsPerSample;
 int numberOfPlanes;
 int type;
 unsigned char *data;
Obviously, width and height are the image dimensions.
bitsPerSample is the number of bits that each pixel requires.
numberOfPlanes refers the number of colour space planes.  RGB has 3, HSV has 3, GRAY has 1.
type refers to the data format, either PIL_RGB, PIL_HSV, or PIL_GRAY
data is pointer to the byte data.


back next