Skip to content

winstxnhdw/ezgif-essentials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ezgif-essentials

Want to generate GIFs of the highest quality? Tired of having too many unecessary parameters? You also happen to be a motion graphic designer? ezgif-essentials is a pseudo-opinionated video/sequence to GIF CLI converter. It uses the same robust conversion pipeline as ezGIF without the frame rate limitations or involuntary compression. It is powered by FFmpeg, Gifsicle and my frustration with all GIF converters.

Converted by ezgif-essentials
Converted by ezgif.com

Comparisons are both generated with their highest respective settings. There isn't even a competition. The answer is obvious.

Requirements

  • Python 3.11

Installation (Debian-based)

Currently, there's no way to use ezgif-essentials on Windows without WSL

Clone this repository.

git clone https://github.com/winstxnhdw/ezgif-essentials.git

Install the ffmpeg-python module.

pip install ffmpeg-python

Install gifsicle.

sudo apt install gifsicle

Test the script.

python main.py -h

Usage (Video)

Note: Transparency is disabled by default to allow for more colour palettes when generating more complex GIFs

python main.py -i test.mp4 -z 3
Optional arguments:
  -h, --help              show this help message and exit
  -z, --optimise          optimise GIF file size with zero quality penalty (1 - 3)
  -l, --lossy             number of artefacts allowed for compression (0 - 200)
  -w, --transparent       enables transparency

Usage (Sequence)

Warning: Please name your images with the appropriate amount of leading zeros. Read more about it here.

python main.py -i 'image/*.png' -a -r 50 -z 3
Required arguments:
  -a, --assemble          prepares the script for an image sequence

Optional arguments:
  -h, --help              show this help message and exit
  -r, --fps               set the fps of the resultant GIF
  -z, --optimise          optimise GIF file size with zero quality penalty (1 - 3)
  -l, --lossy             number of artefacts allowed for compression (0 - 200)
  -w, --transparent       enables transparency

Frequently Asked Questions

  1. The output GIF has a lower FPS than the input video when I use the optimise flag.

This is intended. Gifsicle optimises the GIF by removing unnecessary frames that do not contribute to the visual appearance of the animation.

  1. Why can't I set a specific FPS parameter for video-to-GIF conversions?

The output GIF will always have the same FPS as the input video. However, if your input video is above 50 FPS, the frame rate of the resulting GIF will be capped to 50. This is because frame rates between 50 and 100 are not supported by the standard GIF89a specification.

  1. Why is the lossy argument capped at 200?

According to the author, Kornel Lesiński: "It works best when only little loss is introduced, and due to limitation of the compression algorithm very high loss levels won't give as much gain." Read more here.

About

A pseudo-opinionated video/sequence to GIF CLI converter.

Topics

Resources

Stars

Watchers

Forks

Languages