Method Image.GIF.encode_trans()
- Method encode_trans
encode(stringobjectimg)
encode(stringobjectimg,intcolors)
encode(stringobjectimg,objectcolortable)
encode_trans(stringobjectimg,objectalpha)
encode_trans(stringobjectimg,inttr_r,inttr_g,inttr_b)
encode_trans(stringobjectimg,intcolors,objectalpha)
encode_trans(stringobjectimg,intcolors,inttr_r,inttr_g,inttr_b)
encode_trans(stringobjectimg,intcolors,objectalpha,inttr_r,inttr_g,inttr_b)
encode_trans(stringobjectimg,objectcolortable,objectalpha)
encode_trans(stringobjectimg,objectcolortable,inttr_r,inttr_g,inttr_b)
encode_trans(stringobjectimg,objectcolortable,objectalpha,inta_r,inta_g,inta_b)
encode_trans(stringobjectimg,objectcolortable,inttransp_index)- Description
-
Create a complete GIF file.
The latter (encode_trans) functions add transparency capabilities.
Example:
img=<ref>Image.Image</ref>([...]); [...] // make your very-nice image write(<ref>Image.GIF.encode</ref>(img)); // write it as GIF on stdout
- Parameter
img -
The image which to encode.
- Parameter
colors - Parameter
colortable -
These arguments decides what colors the image should be encoded with. If a number is given, a colortable with be created with (at most) that amount of colors. Default is '256' (GIF maximum amount of colors).
- Parameter
alpha -
Alpha channel image (defining what is transparent); black color indicates transparency. GIF has only transparent or nontransparent (no real alpha channel). You can always dither a transparency channel: Image.Colortable(my_alpha, ({({0,0,0}),({255,255,255})}))
->full()
->floyd_steinberg()
->map(my_alpha) - Parameter
tr_r - Parameter
tr_g - Parameter
tr_b -
Use this (or the color closest to this) color as transparent pixels.
- Parameter
a_r - Parameter
a_g - Parameter
a_b -
Encode transparent pixels (given by alpha channel image) to have this color. This option is for making GIFs for the decoders that doesn't support transparency.
- Parameter
transp_index -
Use this color no in the colortable as transparent color.
- Note
-
For advanced users:
Image.GIF.encode_trans(img,colortable,alpha);
is equivalent of usingImage.GIF.header_block(img->xsize(),img->ysize(),colortable)+ Image.GIF.render_block(img,colortable,0,0,0,alpha)+ Image.GIF.end_block();
and is actually implemented that way.