A Complete Guide to Create GIF in Linux

This tutorial is the complete collection of everything you need to know for creating a GIF image in Linux.

The GIF aka Graphics Interchange Format was introduces on 1987 and became popular in web because of its low size, animation feature and of course portability. GIF can be created from a set of images Or, from a video clipping. This tutorials will focus on various methods of creating GIF from images/videos in Linux.

Create gif from a set of images

Using ImageMagick – Convert

Imagemagick image manipulation suite provides the ‘convert’ program which can be used effectively to create animation/GIF images. You can run convert from command line using various of its option.

To do a basic GIF animation, convert needs list of image files and it can be presented with wildcard as well if your images are names such as MyImage1.jpg, MyImage2.jpg…etc.

Run below command from terminal to create a gif file named “animation.gif” from a set of files named 1.png, 2.png, 3.png…16.png. The ‘delay’ option is the delay time between two images. The ‘loop’ option is the Number of times the GIF animation is to cycle though the image sequence before stopping. Default loop is 0 i.e. infinite sequence.

Below command can create a GIF image ‘animation.gif’ from a set of example 16 images.

convert -delay 100 -loop 0 image*.jpg animation.gif

Source Images
Source Image Set for GIF

Below gif is created after running above command:

gif created using convert

gif created using convert

 

Convert provides a wide range of options for the output GIF including resolution, transparency, quality etc. Read more options in below link:
ImageMagick – Convert – Animation Basics

Using ffmpeg

ffmpeg also can be used to create GIF files. ffmpeg does it in two steps. First it creates an intermediate video file based on set of images. Next the video is converted to a GIF files.

Below two commands would create a GIF file from the same above set of image files.

ffmpeg -start_number 1 -i '%d.png' -c:v libx264 out.mp4
ffmpeg -i out.mp4 -pix_fmt rgb24 -loop 0 out.gif
  • -start_number = indicates from which file number present in input image file name it would start creating the gif.
  • -i = the input files, %d denotes any number present in image files.
  • Libbx264 = The output video codec

Below image is created using above commands in ffmpeg:

gif created using ffmpeg

gif created using ffmpeg

 

Create gif from a video

Using QGifer

QGifer is an UI based app which lets you to create gif directly importing a video. The app is very user-friendly and very easy to use. Some of the awesome features of QGifer are – add text/images, apply filters, size reduction etc.

SEE ALSO:   Quickly Resize, Convert Images From Terminal Using Mogrify in Ubuntu

The main QGifer project is not under development. There is a fork of this project is currently under development in GitHub with enhancements and bug fixes.

Install QGifer in Ubuntu, Debian, elementary, mint
Download the 64-bit deb binary – qgifer_0.2.1-1_amd64 [330 kB]
Double click the deb file to install via Ubuntu Software Center

Note: QGifer doesn’t support videos more than 1800 frames and only supports MPEG and YUV4 codecs. If your video size doesn’t fit the said criteria you can cut your videos OR convert it to MPEG or YUV4 codec.

Usage of QGifer
All the menu items of QGifer are self-explanatory.
QGifer Running in Ubuntu
Tutorial Video – Create gif using QGifer.

 

 

Create GIF from screen cast or screen recordings

Using byzanz

byzanz is an awesome app which directly records screen to a gif file. It also keeps file size minimum by keeping the gif quality. It doesn’t have any GUI and it can only be run from the terminal – “byzanz-record”.

How to record screen as gif using byzanz

Run below command to record a portion of the screen.

byzanz-record -d 20 -c -x 0 -y 0 -w 700 -h 550 -v out.gif

Below gif image recorded using above command:

Recorded by byzanz

Recorded by byzanz

 

Explanation of the arguments used in above command:
-d : duration : 20 seconds to be recorded
-c : cursor also to be recorded
-x : left co-ordinate of the recording rectangle
-y : right co-ordinate of the recording rectangle
-w : width of the recoding rectangle
-h : height of the recording rectangle
-v : verbose output
out.gif : output file name

Note: You can run xwininfo from terminal to get the co-ordinates of your target recording window.

How to install byzanz
byzanz is available in universe repository. To install byzanz in Ubuntu, debian, Mint, elementary via terminal run below command:

sudo apt-get install byzanz

Using silentcast

silentcast is a GUI based app which is used to create GIF from an user selected window. This utility has lots of features such as graphical selection mode of windows, user defined frame rate, window selection, recording the full screen etc. The app can be installed via ppa as below in Ubuntu, elementary, mint, Debian:

sudo add-apt-repository ppa:sethj/silentcast  
sudo apt-get update  
sudo apt-get install silentcast  

silentcast running on Ubuntu

silentcast running on Ubuntu

https://www.debugpoint.com/2015/12/a-complete-guide-to-create-gif-in-linux/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Sure, I'd be happy to help you with that! Writing a scientific paper can be a complex and daunting task, but by following some basic guidelines, you can make the process much simpler. Here's a step-by-step guide to writing a scientific paper: 1. Choose your topic: Your topic should be something that you're passionate about and that relates to your field of study. Make sure it's a specific enough topic that you'll be able to cover it adequately in your paper. 2. Conduct research: Gather information about your topic by reading relevant literature, attending conferences, and conducting experiments if necessary. Take detailed notes and organize them in a way that will make it easy to reference later. 3. Develop a thesis statement: Your thesis statement should be a concise and clear statement of the main argument or hypothesis of your paper. 4. Outline your paper: Create an outline that includes an introduction, body paragraphs, and conclusion. Each section should be clearly defined and include relevant information. 5. Write your paper: Use your outline as a guide and write your paper according to established scientific writing standards. Be sure to include references for any sources you use to support your arguments. 6. Revise and edit your paper: Once you've completed a rough draft, go back through it and make any necessary changes to improve clarity, coherence, and accuracy. 7. Submit your paper for review: Seek feedback from colleagues, mentors, or professional reviewers to help you improve your paper and ensure that it meets the appropriate standards. Remember to use clear and concise language, avoid jargon whenever possible, and provide enough detail to support your arguments. With these guidelines in mind, you should be well on your way to writing a successful scientific paper!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值