Previous section To contents Next section

12.15 Image.ILBM

DESCRIPTION
This submodule keep the ILBM encode/decode capabilities of the Image module.

SEE ALSO
Image, Image.Image and Image.Colortable

METHOD
Image.ILBM.decode

SYNTAX
object decode(string data)
object decode(array _decoded)
object decode(array __decoded)

DESCRIPTION
Decodes ILBM data and creates an image object.

RETURNS
the decoded image as an image object

NOTE
This function may throw errors upon illegal ILBM data. This function uses __decode and _decode internally.

SEE ALSO
encode

METHOD
Image.ILBM.encode

SYNTAX
string encode(object image)
string encode(object image,  mapping options)

DESCRIPTION
Encodes an ILBM image.

The options argument may be a mapping containing zero or more encoding options:

normal options:
"alpha":image object
Use this image as mask
(Note: ILBM mask is boolean.
The values are calculated by (r+2g+b)/4>=128.)

"palette":colortable object Use this as palette for pseudocolor encoding

METHOD
Image.ILBM._decode

SYNTAX
array _decode(string|array data)

DESCRIPTION
Decode an ILBM image file.

Result is a mapping,

([
"image": object image,

... more ... ])

image is the stored image.

METHOD
Image.ILBM.__decode

SYNTAX
array __decode();

DESCRIPTION
Decodes an ILBM image structure down to chunks and

({int xsize,int ysize,      // 0: size of image drawing area
string bitmapheader,      // 2: BMHD chunk
void|string colortable,   // 3: opt. colortable chunk (CMAP)
void|string colortable,   // 4: opt. colormode chunk (CAMG)
string body,              // 5: BODY chunk
mapping more_chunks})     // 6: mapping with other chunks

RETURNS
the above array

NOTE
May throw errors if the ILBM header is incomplete or illegal.

Previous section To contents Next section