Method Image.GIF.header_block()


Method header_block

string header_block(int xsize, int ysize, int numcolors)
string header_block(int xsize, int ysize, object colortable)
string header_block(int xsize, int ysize, object colortable, int background_color_index, int gif87a, int aspectx, int aspecty)
string header_block(int xsize, int ysize, object colortable, int background_color_index, int gif87a, int aspectx, int aspecty, int r, int g, int b)

Description

This function gives back a GIF header block.

Giving a colortable to this function includes a global palette in the header block.

Parameter xsize
Parameter ysize

Size of drawing area. Usually same size as in the first (or only) render block(s).

Parameter background_color_index

This color in the palette is the background color. Background is visible if the following render block(s) doesn't fill the drawing area or are transparent. Most decoders doesn't use this value, though.

Parameter gif87a

If set, write 'GIF87a' instead of 'GIF89a' (default 0 == 89a).

Parameter aspectx
Parameter aspecty

Aspect ratio of pixels, ranging from 4:1 to 1:4 in increments of 1/16th. Ignored by most decoders. If any of aspectx or aspecty is zero, aspectratio information is skipped.

Parameter r
Parameter g
Parameter b

Add this color as the transparent color. This is the color used as transparency color in case of alpha-channel given as image object. This increases (!) the number of colors by one.

Returns

the created header block as a string

Note

This is in the advanced sector of the GIF support; please read some about how GIFs are packed.

This GIF encoder doesn't support different size of colors in global palette and color resolution.

See also

header_block, end_block