Ubuntu

How to Make an Animated GIF in Ubuntu

GIF also knows as Graphics Interchange Format; it has become very popular among social media users in absolutely no time since its introduction. Reason behind the popularity is its low size compared to images and videos. GIF posts attracted more users on popular social media platforms like Facebook, Google Plus, WhatsApp, and Twitter than any other image or video posts.

Many of you might have thought, how one can make a GIF on Linux and its distribution like Ubuntu? So, today I’m going to show you just that. We’re going to have a look at several ways to make animated GIF in Ubuntu. So, without making further delay, let’s get started.

1. Peek

Peek is a simple and lightweight screen recorder for Linux and its distros like Ubuntu. It is also optimized for generating animated GIFs. You can just select any area on your screen to create a screencast. Apart from GIF, you can also directly record to WebM or MP4 video file format.

It is a simple animated GIF recorder so it offers limited set of features. But it offers useful features like customizable frame-rate and delay timer.

To install Peek on Ubuntu, run following command in terminal window.

$ sudo add-apt-repository ppa:peek-developers/stable

$ sudo apt-get update

$ sudo apt-get install peek

2. Byzanz

Byzanz is a part of GNOME project and it is a simple command-line tool to record animated GIFs in Ubuntu. It is a lightweight GIF recording tool that works effortlessly on Ubuntu and other Linux distributions.

The only drawback is that, you have to enter each option manually as it is a command-line tool. It means no drag and select screen area for recording.

Install Byzanz in Ubuntu using this command in Terminal.

$ sudo install apt-get install byzanz

3. GIMP
GIMP is a cross-platform image editor available for GNU/Linux, Windows and Mac OS X. It is a free and open-source, raster graphics manipulation and image editing tool. With the help of selection of images from your computer, you can make an animated GIF using GIMP.

GIMP uses layers to make the animated GIFs. You can export or save new GIF to your computer. GIMP is much more than just animated GIF maker, as you can also edit images.

Install GIMP in Ubuntu using following command.

  1. Using PPA
  2. $ sudo add-apt-repository ppa:otto-kesselgulasch/gimp

    $ sudo apt-get update

    $ sudo apt-get install gimp
  3. Using Snap
$ sudo snap install gimp

4. ImageMagick

ImageMagick is another free and open-source cross platform tool for platforms like Linux and its distributions like Ubuntu. You can create, convert, modify and edit raster images using this tool.

You can create an animated GIF using this app but there is a catch; you need to have ready with image frames as you can not do that in this app, you have to use other apps to achieve that.

Once you have done that, you need to export the created frames and then use convert command in following way to create an animated GIF.

$ convert -delay 100 -loop 5 -dispose previous   firstimage.png lastimage.png finalanimated.gif

-delay: pause button from one image frame to another.
-loop: makes created GIF repetitive.
-dispose: transition pathway from one image frame to next.

To Install ImageMagick, run following command in Ubuntu terminal.

$ sudo apt-get install -y imagemagick

5. FFmpeg

FFmpeg is free and open-source command-line tool for Linux and its distros like Ubuntu. It is cross-platform solution to record, convert and stream audio and video.

FFmpeg can record and convert GIF files from video and audio streams. Even though it is command line tool, you can still configure it according to your needs for desired GIF output. This makes it one of the most feature rich tool for animated GIF making.
To install FFmpeg, run the following command.

$ sudo apt-get install ffmpeg

So, you can use any of these tools to make an animated GIFs in Ubuntu and other Linux distributions. There are limited number of tools available for GIF making for Linux but these mentioned here standout in terms of overall performance and reliability.

About the author

Swapnil Tirthakar

A Software Engineer who loves football and passionate about traveling. I often spend my free time playing with gadgets and exploring new possibilities in tech world. I am Linux enthusiast and have about 6 years of experience in web development. I have good command on Python, Java, SQL and system security.