Pike v8.1 release 6

Method Image.BMP.encode()


Method encode

string encode(object image)
string encode(object image, mapping options)
string encode(object image, object colortable)
string encode(object image, int bpp)

Description

Make a BMP. It default to a 24 bpp BMP file, but if a colortable is given, it will be 8bpp with a palette entry.

option is a mapping that may contain:

"colortable": Image.Colortable   - palette
"bpp":        1|4|8|24           - force this many bits per pixel
"rle":        0|1                - run-length encode (default is 0)
 

Parameter image

Source image.

Parameter colortable

Colortable object, shortcut for "colortable" in options.

Returns

the encoded image as a string

Bugs

Doesn't support old BMP mode, only "windows" mode.

See also

decode