gnome.utilities.images2gif¶
MODULE images2gif
Provides a function (writeGif) to write animated gif from a series of PIL images or numpy arrays.
Added as a handy utility to the py_gnoe code.
Adapted form code from:
Almar Klein (June 2009)
based on gifmaker (in the scripts folder of the source distribution of PIL)
based on gif file structure as provided by wikipedia
This code is provided as is, and is free to use for all.
Attributes¶
Functions¶
|
Integer to two bytes |
|
Animation header. To replace the getheader()[0] |
|
Application extention. Part that secifies amount of loops. |
|
Graphics Control Extension. A sort of header at the start of |
|
writeGif(filename, images, duration=0.1, loops=0, dither=1) |
Module Contents¶
- gnome.utilities.images2gif.PIL = None¶
- gnome.utilities.images2gif.np = None¶
- gnome.utilities.images2gif.intToBin(i)¶
Integer to two bytes
- gnome.utilities.images2gif.getheaderAnim(im)¶
Animation header. To replace the getheader()[0]
- gnome.utilities.images2gif.getAppExt(loops=0)¶
Application extention. Part that secifies amount of loops. if loops is 0, if goes on infinitely.
- gnome.utilities.images2gif.getGraphicsControlExt(duration=0.1)¶
Graphics Control Extension. A sort of header at the start of each image. Specifies transparancy and duration.
- gnome.utilities.images2gif.writeGif(filename, images, duration=0.1, loops=0, dither=1)¶
writeGif(filename, images, duration=0.1, loops=0, dither=1) Write an animated gif from the specified images. images should be a list of numpy arrays of PIL images. Numpy images of type float should have pixels between 0 and 1. Numpy images of other types are expected to have values between 0 and 255.
- gnome.utilities.images2gif.im¶