Creating Animated GIFs in Python

Martin McBride
The Startup
Published in
6 min readOct 3, 2020

--

Easy animation with generativepy

Photo by Gensa Hub on Unsplash

generativepy makes it very easy to create animated GIFs. This can be done with a simple script, and usually results in a fairly well optimised GIf file.

The gif module makes use of the gifsicle application. This can be downloaded for free, and must be installed on your system in order for the gif module to work.

GIF images

GIF (Graphics Interchange Format) is a bitmap image format that was developed in the 1980s for transferring images over networks. It uses LZW compression (similar to the method used by ZIP files), which was more efficient than most other formats at the time.

Due to its efficiency, it was very popular in the early days of the web, when most people (especially home users) had quite slow connections, so efficient image compression was very important. However, these days it has largely been replaced by PNG and JPEG formats, which offer better compression and better image quality.

One feature of GIF is that it allows several images to be stored in the same file, which could them be displayed sequentially to provide an animated effect. No other image format offers this animation feature, and certainly not in a format that is so widely supported.

How GIF animation works

--

--