Creating Animated GIFs
Animated GIFs, such as the one given below are easy to create. Among the possibilities are using gifsicle
from Gifsicle and convert
from ImageMagick.
Using gifsicle
From Gifsicle:
- put all the GIF images, appropriately named so that they fall in the correct order of appearance when listed/sorted alphabetically (sometimes tricky), in one folder/directory
cd
(change into) the directory containing the GIF images then issue the following command to create the animated GIFall.gif
:gifsicle --colors 256 -d 100 *.gif > all.gif
Using convert
From ImageMagick:
- put all the PNG (or GIF) images, appropriately named so that they fall in the correct order of appearance when listed/sorted alphabetically (sometimes tricky), in one folder/directory
cd
(change into) the directory containing the PNG (or GIF) images then issue the following command (for PNGs) to create the animated GIFall.gif
:convert -delay 100 *.png all.gif
Instead of using a wildcard (*.png) on the command-line, one may also use a list (a text file, e.g., listOfImages.txt) of images in which the filenames of the images to be combined are listed (in one column, one filename per row) in the proper order of appearance. This is specially useful when it is not easy to syncronize the names of the files with the order of appearance:
convert -delay 100 @listOfImages.txt all.gif
One can get a list of images in a directory by using (at the command-line within the directory):
ls --color=never > listOfImages.txt
and editing this list so that the images are listed in the order of appearance in the animated GIF to be created using convert
. (In some installs of ImageMagick, one uses the magick
, instead of convert
, command-line tool.)
Notes
- For
gifsicle
, the-d 100
option causes a delay of 1 second (=100 * 1/100th of a second) between frames, i.e.,d -250
causes a 2 1/2 s delay,-d 325
causes a 3 1/4 s delay. The-delay 100
option ofconvert
is similar. mogrify
- from ImageMagick, can be used to convert PNGs to GIFs (and vice-versa):mogrify -format gif *.png
animate
- from ImageMagick, allows a preview of the to-be-created animated GIF from the PNG images in a directory:animate -loop 0 -delay 100 *.png
(the
-loop 0
option means an infinite loop; useCtrl-C
or the x-button to exit from the preview GUI).display
- from ImageMagick, gives a GUI that allows one to examine, study, edit, save changes made to an existing image, e.g., change the speed of animated GIFs.- Animator for Android - an example of an Android app (availabe from Google Play Store) that creates animated GIFs. An excerpt from the app’s “READ MORE” page:
Animator is a tool for making animated cartoon videos and exporting them to Gif or Video formats. Make funny videos - no advanced drawing skills required! Just doodle, have fun and amaze your friends. You can create amazing animations without any expertise! Animation is made easy, better than any other animation software.
There are a number of other alternative Android apps from the Google Play Store (search under animator).
Example
The screenshot (partly edited) of a t3C
tic-tac-toe game session given below was created using gifsicle
and the images in the images-gif folder, i.e., issue the command
gifsicle --colors 256 -d 300 *.gif > t3C-all.gif
under (the copy in your computer) of the images-gif
subdirectory given above.
Acknowledgements
My sincerest gratitude to Eddie Köhler for Gifsicle, ImageMagick, and Dmitry Groshev, Mark Tyler, Xiaolin Wu et. al. for mtPaint. Much thanks, too, to the Debian Project for the Debian 8 (Jessie) GNU/Linux OS and GitHub for its generosity in providing space for this project.
License
animatedGIFs by Justine Leon A. Uro is licensed under a Creative Commons Attribution 4.0 International License.
Based on a work at https://github.com/justineuro/animatedGIFs