Skip to content

Instantly share code, notes, and snippets.

@muhammadghazali
Created December 19, 2013 17:30
Show Gist options
  • Save muhammadghazali/8043068 to your computer and use it in GitHub Desktop.
Save muhammadghazali/8043068 to your computer and use it in GitHub Desktop.
How to create a GIF in Ubuntu

Required tools

Install the following tools:

sudo apt-get install imagemagick mplayer gtk-recordmydesktop

Then use Desktop Recorder to capture a portion of the screen/application to use as the screencast. After the Desktop Recorder has saved the recording into an OGV video, MPlayer will be used to capture JPEG screenshots, saving them into the 'output' directory.

How to create a GIF

On a terminal:

mplayer -ao null <video file name> -vo jpeg:outdir=output

Use ImageMagick to convert the screenshots into an animated gifs.

convert output/* output.gif

you can optimize the screenshots this way:

convert output.gif -fuzz 10% -layers Optimize optimised.gif

Credits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment