The first method consists of using Byzanz which allows to record screencasts as GIFs. To install it under Ubuntu 12.10/12.04/11.10 or Linux Mint 13/12, open the terminal and run these commands:
sudo add-apt-repository -y ppa:fossfreedom/byzanz
sudo apt-get update
sudo apt-get install -y byzanz
You can now use this comman to record GIF screencasts (replace details with your own):
byzanz-record --duration=15 --x=400 --y=400 --width=800 --height=600 output.gif
For more help about the use of Byzanz, run this command:
Note: The GIF file will be saved in the current terminal location.
The second method is a little bit complicated because we will use a screen capturing tool to record a screencast, convert this video to images (JPG), then converting these images to an animated GIF. Let's firstly install needed packages with this command:
sudo apt-get install imagemagick gtk-recordmydesktop mplayer
Start now the recordMyDesktop application and record a screencast, then save it in any folder of your choice (.ogv format).
Let's now save this video in JPG screenshots with this command:
mplayer -ao null video.ogv -vo jpeg:outdir=mypics
video.ogv -> Replace it with your own video file name.
mypics -> This is the name of the folder that will contain the extracted JPEG files. Rename it to whatever you want.
Using the terminal, cd to the folder containing JPEG screenshots and run this command:
convert * file.gif
If you have extracted the JPEG files in a folder containing various file formats, then run this command instead:
convert *.jpg file.gif
Rename file.gif with any name of your choice. The conversion may take time depending on the total size of JPEG files.
To optimize this GIF file, you can use this command:
convert file.gif -fuzz 15% -layers Optimize file-optimized.gif