Awesome Gif Overview
A curated list of awesome GIF resources.
🏠 Home · 🔥 Feed · 📮 Subscribe · ❤️ Sponsor · 😺 davisonio/awesome-gif · ⭐ 547 · 🏷️ Media
Awesome GIF
A curated list of awesome GIF resources.
A list of tools, scripts, libraries, examples & other resources related to the Graphics Interchange Format (GIF).
Contents
General Tools
- FFmpeg
- ImageMagick
- GraphicsMagick - GraphicsMagick is usually faster than ImageMagick.
- MoviePy - Python module for video editing.
Utilities
- Gifgen (⭐504) - Simple high quality GIF encoding.
- Gifify (⭐1.1k) - Convert screen recording into GIF.
- Gifs (⭐1.6k) - Storage place for GIFs.
- Gifshot (⭐3.9k) - Create animated GIFs from media by Yahoo. (demo)
- Gifsockets (⭐1.8k) - Real Time communication library using Animated GIFs as a transport.
- X-gif (⭐2k) - A web component for flexible GIF playback.
- GifW00t (⭐823) - JavaScript web recorder.
- gif-machine (⭐55) - GIF creation from YouTube videos.
- gifstreaming (⭐155) - Live video streaming server.
- Screengif (⭐1.3k) - Create animated GIF screencasts.
- vnc-over-gif (⭐514) - Serves screen updates as animated GIF over http.
- gifdeck (⭐94) - Convert your SlideShares into animated GIFs.
- Gifbot (⭐35) - GIF search for Slack.
- Gif-camera (⭐20) - Create animated GIFs using webcam.
- Gifline (⭐64) - Chrome extension to put GIFs in your emails.
- Gifdrop (⭐38) - Create a repository for your collection of GIF images.
- Gh-gif (⭐21) - NodeGH plugin for commenting on pull requests/issues using GIF reactions.
- Tty2gif (⭐156) - Record scripts and their outputs into both binary and GIF formats.
- Giftoppr (⭐36) - Sync your favourite GIFs with Dropbox.
- Gifit (⭐121) - Chrome extension to make a GIF from a YouTube video.
- Ccapture.js (⭐3.2k) - Capture animations created with HTML5 canvas.
- Kap - Beautiful open-source app to capture your screen and export to GIF.
- Gifit (the other one) (⭐11) - Get a search resulting giphy GIF in markdown in stdout, ala
$ gifit kittens
. - gifski (⭐3k) - High-quality GIF encoder based on libimagequant.
- Gifcurry (⭐1.2k) - Open-source, Haskell-built editor for GIF makers.
Libraries
ActionScript
- Flash Animated GIF Library (⭐57) - AS3 library for playing Animated GIFs in Flash.
C++
- Node-gif (⭐212) - C++ library to make GIF.
- Gif-h (⭐430) - C++ one-header library for the creation of animated GIFs.
- msf_gif (⭐177) - C/C++ single-header library for creating animated GIFs.
C#
- dot-screencap (⭐31) - A simple libary to record your screen and save it as animated GIF.
- WpfAnimatedGif (⭐561) - A simple library to display animated GIF images in WPF.
- XamlAnimatedGif (⭐365) - A simple library to display animated GIF images in XAML apps (WPF, WinRT, Windows Phone).
- AnimatedGif (⭐121) - A high performance .NET library for reading and creating animated GIFs.
Haxe
- Gif (⭐39) - Haxe GIF encoder.
Java
- Android-gif-drawable (⭐9.3k) - Views and Drawable for displaying animated GIFs on Android.
- gifanimateddrawable (⭐218) - Use an animated GIF as an Android Drawable.
- GifView (⭐82) - Android library to deal with GIF.
- Gif Movie View (⭐460) - Android View widget for displaying GIF animations.
- GifImageView (⭐1.1k) - Android ImageView that handles animated GIF images.
- Gif-animation (⭐172) - Processing library to play and export GIF.
- Android-gif-encoder (⭐325) - Animated GIF encoder for Android.
- GIFDroid (⭐102) - Android video to GIF converter.
- Android-GifStitch (⭐42) - Create and share animated GIFs.
JavaScript
- Gif.js (⭐4.5k) - Create GIF from the DOM.
- Omggif (⭐663) - GIF 89a encoder and decoder.
- Animated_GIF (⭐221) - JavaScript library for creating animated GIFs.
- Gifffer (⭐757) - JavaScript library that prevents the autoplaying of the animated GIFs.
- Gifplayer (⭐457) - JQuery plugin to play and stop animated GIFs.
- Jsgif (⭐534) - JavaScript GIF parser and player.
- node-gify (⭐294) - JavaScript convert videos to GIFs using ffmpeg and gifsicle.
- Gifencoder (⭐451) - Server side animated GIF generation for Node.js.
- Gif-video (⭐69) - JavaScript Convert a GIF image into an HTML5-ready video.
- Gif-player (⭐61) - On-demand GIF loader/player in JavaScript.
- GifgifLab-face (⭐7) - Facial-emotion detectors.
- node-youtube (⭐175) - YouTube to snapshots and GIFs.
PHP
- GifCreator (⭐321) - PHP class that creates animated GIF from multiple images.
- Spacer.gif - PHP script offering spacer.gif 1x1.
- GifFrameExtractor (⭐173) - PHP class that separates all the frames of an animated GIF.
Objective-C
- UIimage from GIF (⭐876) - UIImage category that loads animated GIFs.
- GIFRefreshControl (⭐294) - "Twitter music" and "Yahoo! Weather" like pull-to-refresh control.
- UIImageView-PlayGIF (⭐423) - UIImageView category/subclass for playing GIF.
- FLAnimatedImage (⭐7.8k) - GIF engine for iOS by FlipBoard.
- Animated-GIF-iPhone (⭐130) - Support for Animated GIF on iOS.
- UzysAnimatedGifPullToRefresh (⭐1.4k) - PullToRefresh using animated GIF to any scrollView.
- SvGifView (⭐83) - iOS load and display GIF.
- GifHUD (⭐158) - iOS progress hud for displaying only animated GIF images.
- Video-Background GIF (⭐144) - iOS Video Background GIF.
- AnimatedGifExample (⭐39) - iOS animated and transparent GIFs.
Swift
- SwiftyGif (⭐1.7k) - High performance & easy to use Gif engine.
- Gifu (⭐2.9k) - Animated GIF support for iOS in Swift.
GUI
- Glyph - Tool for generating seamlessly looping GIFs and cinemagraphs from videos.
- Qgifer
- GifPro (⭐43) - GIF encoder for Mac.
Hosting
- Gfycat - Maximum GIF/video length: 15 seconds. Maximum file upload is 300Mb.
- Imgur - Maximum file upload is 50MB.
Online Tools
- Vid2gif - Video to GIF by imgur.
- EzGif - Online GIF maker and image editor.
- Giflr - A web app for making or remixing animated GIFs.
Community
Scripts
Frames to GIF
FFmpeg
ffmpeg -f image2 -i image%d.jpg animated.gif
Imagemagick
convert -delay 20 -loop 0 frames*.png animated.gif
Bash script (frames2gif.sh
) for GraphicsMagick, ImageMagick, FFmpeg
#!/bin/bash
if [ $# -ne 5 ]; then
echo "please provide the moviename and directory where to store the frames"
echo "./frames2gif.sh [directory] [movie.mp4] [filename.gif] [gm|im|ffmpeg] [png|jpg]"
exit 1
fi
if [ "png" == "$5" ]; then
suffix="png"
else
suffix="jpg"
fi
CONVERT=$(which convert)
GM=$(which gm)
FFMPEG=$(which ffmpeg)
FFPROBE=$(which ffprobe)
FPS=$($FFPROBE -show_streams -select_streams v -i "$2" 2>/dev/null | grep "r_frame_rate" | cut -d'=' -f2 | cut -d'/' -f1)
echo "FPS: ${FPS}"
if [ "im" == "$4" ]; then # use imagemagick
FPS=$(echo "1 / ${FPS} * 100" |bc -l)
$CONVERT "$1/*.${suffix}" -delay ${FPS} -loop 0 "$3"
elif [ "gm" == "$4" ]; then # use graphicsmagick
FPS=$(echo "1 / ${FPS} * 100" |bc -l)
$GM convert "$1/*.${suffix}" -delay ${FPS} -loop 0 "$3"
else # use crappy gif-algorithm from ffmpeg
$FFMPEG -f image2 -framerate ${FPS} -i "$1/%08d.${suffix}" "$3"
fi
From DeepDreamVideo (⭐2.1k), source (⭐2.1k)
GIF to frames
ffmpeg -i video.mpg image%d.jpg
convert -coalesce animated.gif image%05d.png
High quality GIF
with ffmpeg / based on this article
- Generate a palette :
#!/bin/sh
start_time=30
duration=3
ffmpeg -y -ss $start_time -t $duration -i input.avi \
-vf fps=10,scale=320👎flags=lanczos,palettegen palette.png
- Output the GIF using the palette :
#!/bin/sh
start_time=30
duration=3
ffmpeg -ss $start_time -t $duration -i input.avi -i palette.png -filter_complex \
"fps=10,scale=320👎flags=lanczos[x];[x][1:v]paletteuse" output.gif
Optimize GIF
convert -layers Optimize output.gif output_optimized.gif
Lossy GIF Compressor
./gifsicle -O3 --lossy=80 -o lossy-compressed.gif input.gif
Making GIF from video
from moviepy.editor import *
clip = (VideoFileClip("input.avi")
.subclip((4,00.00),(5,00.00))
.resize(0.3))
clip.write_gif("output.gif")
Cinemagraphs
Freezing a region
from moviepy.editor import *
clip = (VideoFileClip("input.avi")
.subclip((4,00.00),(5,00.00))
.resize(0.3)
.fx(vfx.freeze_region, outside_region=(170, 230, 380, 320)))
clip.write_gif("output.gif", fps=15)
ffmpeg \
-ss ${starttime} -t ${duration} -i ${vidfile} `# body of loop` \
-ss TODO ${starttime} MINUS ${duration} -t ${fadetime} -i ${vidfile} `# lead-in for crossfade` \
-loop 1 -i ${stillfile} `# masked still image` \
-filter_complex "
[0:v]setpts=PTS-STARTPTS[vid]; `# speed adjustment - not needed here, so noop`
color=white,scale=3840x2160,fade=in:st=0:d=${fadetime}[alpha]; `# crossfade alpha, double length ahead of speed change`
[1:v][alpha]alphamerge[am]; `# apply alpha to lead-in`
[am]setpts=PTS+(${duration}-${fadetime})/TB[layer2]; `# speed adjustment and offset for lead-in`
[vid][layer2]overlay[oo]; `# overlay for crossfade`
[oo][2:v]overlay=shortest=1[out1]; `# overlay still image`
[out1]crop=w=${cropfactor}*iw:h=${cropfactor}*ih:y=${yoffset}*ih,scale=${outputwidth}:-1, `# crop and scale`
eq=gamma=${gamma}:contrast=${contrast}:saturation=${saturation},unsharp `# final adjustments`
" -an output.mp4
Perfect Loop
import moviepy.editor as mp
from moviepy.video.tools.cuts import FramesMatches
clip = mp.VideoFileClip("input.avi").resize(0.3)
scenes = FramesMatches.from_clip(clip, 10, 3)
selected_scenes = scenes.select_scenes(2, 1, 4, 0.5)
selected_scenes.write_gifs(clip.resize(width=450), "./outputs_directory")
YouTube video to GIF
- Download it via youtube-dl and then convert it.
youtube-dl https://www.youtube.com/watch?v=V2XpsaLqXc8
Grabbing each frame of an HTML5 Canvas
Using PhantomJS.
Example with this canvas.
var webPage = require('webpage');
var fs = require('fs');
var page = webPage.create();
var NB_FRAME = 100;
var current = 0;
page.open('http://www.effectgames.com/demos/canvascycle/?sound=0',
function(status) {
if (status === "success") {
var current = 0;
var grabber = setInterval(function () {
var frame = page.evaluate(function() {
return document.getElementById('mycanvas').toDataURL("image/png").split(",")[1];
});
fs.write("./frame-" + current + ".png",atob(frame), 'wb');
if (++current === NB_FRAME) {
window.clearInterval(grabber);
phantom.exit(0);
}
}, 1000);
}
});
Miscellaneous
- Why is the GIF I created so slow? - Using ImageMagick to solve problems concerning GIF speed.
Use
The best ways to use this list are:
- By browing the contents.
- By using command + F to search the contents
Credits
By Craig Davison and contributors.
Based on a recovered list (⭐243k) by Ismail Baaj.