How to create GIFs of images in Linux from the console

The fashion in social networks is animated Gifs, there are millions and with different purposes, some entertain us and others inform us, but without a doubt they have become the most efficient way to show something and have an incredible viral effect. For all this, we want to teach create Gif from images from console in an extremely simple and fast way, but with a fairly extensive parameterization, which will result in high quality and personalized animated gifs.create gif from images

To create GIFs of images in Linux we are going to use the imagemagick utility, which is super powerful and has a fairly simple syntax.

What is imagemagick?

ImageMagick is a collection of various utilities that allow us to perform many actions on images; it is open source and is usually used to display, edit, or even convert images.

All these utilities are managed from the command line, being compatible with more than 100 formats and having a very short learning line, as well as a fairly simple syntax.

How to install imagemagick?

Imagemagick is present natively in various linux distros, but in case it is not installed by default in your operating system you can do it easily with some of the following commands:

Install imagemagick on Ubuntu, Debian and derivatives

Ubuntu, debian, deepin and derivative users can install using the following commands:

$ sudo apt-get install php5 php5-common gcc $ sudo apt-get install imagemagick

Install imagemagick on Arch Linux and derivatives

In arch linux and wrapper we can make use of the AUR repositories with the following command:

$yaourt -S imagemagick

Install imagemagick on CentOS / RHEL7, openSUSE, Fedora, and derivatives

With the help of yum we can install imagemagick in these distributions, just run the following commands

# [yum | dnf | zypper] install http://www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-libs-6.9.3-5.x86_64.rpm # [yum | dnf | zypper] install http : //www.imagemagick.org/download/linux/CentOS/x86_64/ImageMagick-6.9.3-5.x86_64.rpm

Install imagemagick from source code

For all distros we can install imagemagick directly from its source code, for this we must execute this series of commands:

$ cd / opt $ wget http://www.imagemagick.org/download/ImageMagick.tar.gz $ tar xvzf ImageMagick.tar.gz $ cd ImageMagick-6.9.3 $ touch configure $ ./configure $ make $ make install $ ldconfig / usr / local / lib $ / usr / local / bin / convert logo: logo.gif

How to create GIF from images using imagemagick

The creation of animated gif with imagemagick is extremely simple, it is enough that we have in the same directory all the images that we want to put together to create the gif and execute the following commands:

$ cd / DirectoryWhereThe Images Are $ mogrify -resize 640x480 * .jpg * .png # This is to resize the images to the same size $ convert -delay 20 -loop 0 * .jpg * .png migif.gif #Delay represents the delay time

And with this series of fairly simple and intuitive commands we can create our animated gifs efficiently.


Add as preferred source in Google