A curated list of awesome gif tools and scripts : libraries, utilities, and short examples. For more awesomeness, check out awesome .
- Awesome GIF
- FFmpeg
- ImageMagick
- GraphicsMagick - GraphicsMagick is usually faster than ImageMagick
- MoviePy - Python module for video editing
- Gifgen - Simple high quality GIF encoding
- Gifify - Convert any video file to an optimized animated GIF
- Gifify (not the same) - convert screen recording into GIF ★ 623, pushed 138 days ago
- Gifsicle - lossy gif compressor ★ 271, pushed 153 days ago
- Gifs - storage place for gifs - demo ★ 1347, pushed 271 days ago
- Gifshot - create animated GIFs from media by Yahoo - demo ★ 2464, pushed 216 days ago
- Gifsockets - Real Time communication library using Animated Gifs as a transport ★ 1515, pushed 1447 days ago
- X-gif - a web component for flexible GIF playback ★ 1804, pushed 313 days ago
- gifme - generate animated GIFs ★ 323, pushed 919 days ago
- GifW00t - javascript web recorder ★ 620, pushed 592 days ago
- gif-machine - gif creation from Youtube videos ★ 52, pushed 640 days ago
- gifstreaming - Live video streaming server ★ 106, pushed 1007 days ago
- Screengif - Create animated gif screencasts ★ 623, pushed 126 days ago
- vnc-over-gif - Serves screen updates as animated gif over http ★ 512, pushed 1007 days ago
- gifdeck - Convert your SlideShares into animated GIFs ★ 90, pushed 451 days ago
- Gifbot - GIF search for Slack ★ 39, pushed 1004 days ago
- Gif-camera - create animated GIFs using webcam ★ 18, pushed 1157 days ago
- Gifline - Chrome extension to put GIFs in your emails ★ 48, pushed 475 days ago
- Gifdrop - Create a repository for your collection of gif images ★ 33, pushed 222 days ago
- Gh-gif - NodeGH plugin for commenting on pull requests/issues using GIF reactions ★ 20, pushed 373 days ago
- Tty2gif - record scripts and their outputs into both binary and gif formats ★ 115, pushed 493 days ago
- Giftoppr - Sync your favourite gifs with Dropbox ★ 37, pushed 1141 days ago
- Gifit - Chrome extension to make a GIF from a YouTube video ★ 74, pushed 224 days ago
- Ccapture.js - Capture animations created with HTML5 canvas ★ 446, pushed 139 days ago
- Flash Animated Gif Library - AS3 library for playing Animated GIFs in Flash ★ 49, pushed 370 days ago
- Node-gif - C++ library to make Gif ★ 132, pushed 411 days ago
- Gif-h - C++ one-header library for the creation of animated GIFs ★ 75, pushed 879 days ago
- OfxGifEncoder - C++ openframeworks addon to export animated gifs ★ 82, pushed 378 days ago
- dot-screencap - A simple libary to record your screen and save it as animated gif
- WpfAnimatedGif - A simple library to display animated GIF images in WPF ★ 16, pushed 208 days ago
- XamlAnimatedGif - A simple library to display animated GIF images in XAML apps (WPF, WinRT, Windows Phone) ★ 9, pushed 139 days ago
- Gif - Haxe gif encoder ★ 21, pushed 311 days ago
- Android-gif-drawable - Views and Drawable for displaying animated GIFs on Android ★ 2647, pushed 129 days ago
- gifanimateddrawable - Use an animated GIF as an Android Drawable ★ 201, pushed 844 days ago
- GifView - android library to deal with Gif ★ 77, pushed 1170 days ago
- Gif Movie View - Android View widget for displaying GIF animations ★ 380, pushed 134 days ago
- GifImageView - Android ImageView that handles animated GIF images ★ 566, pushed 166 days ago
- Gif-animation - Processing library to play and export GIF ★ 73, pushed 228 days ago
- Android-gif-encoder - animated GIF encoder for Android ★ 121, pushed 1607 days ago
- GIFDroid - Android video to GIF converter ★ 57, pushed 396 days ago
- Android-GifStitch - create and share animated gifs ★ 36, pushed 1652 days ago
- Gif.js - Javascript - create GIF from the DOM ★ 1873, pushed 311 days ago
- Omggif - Javascript - GIF 89a encoder and decoder ★ 327, pushed 190 days ago
- Animated_GIF - Javascript library for creating animated GIFs ★ 117, pushed 372 days ago
- Gifffer JavaScript library that prevents the autoplaying of the animated Gifs ★ 446, pushed 229 days ago
- Gifplayer - jquery plugin to play and stop animated gifs ★ 191, pushed 144 days ago
- Jsgif - JavaScript GIF parser and player ★ 312, pushed 1800 days ago
- node-gify - Javascript convert videos to gifs using ffmpeg and gifsicle ★ 181, pushed 793 days ago
- Gifencoder - Server side animated gif generation for node.js ★ 95, pushed 418 days ago
- Gif-video - Javascript Convert a GIF image into an HTML5-ready video ★ 51, pushed 840 days ago
- Gif-player - On-demand GIF loader/player in Javascript ★ 55, pushed 809 days ago
- GifgifLab-face - Facial-emotion detectors ★ 4, pushed 579 days ago
- node-youtube - Youtube to snapshots and GIFs.
- GifCreator - PHP class that creates animated GIF from multiple images ★ 168, pushed 1095 days ago
- Spacer.gif - PHP script offering spacer.gif 1x1 ★ 14, pushed 194 days ago
- GifFrameExtractor - PHP class that separates all the frames of an animated GIF ★ 68, pushed 460 days ago
- AnimatedGIFImageSerialization - decodes an UIImage from Animated GIFs image data ★ 919, pushed 152 days ago
- UIimage from GIF - UIImage category that loads animated GIFs ★ 682, pushed 258 days ago
- GIFRefreshControl - "Twitter music" and "Yahoo! Weather" like pull-to-refresh control ★ 294, pushed 686 days ago
- UIImageView-PlayGIF - UIImageView category/subclass for playing GIF ★ 339, pushed 419 days ago
- FLAnimatedImage - Gif engine for iOS by FlipBoard ★ 4102, pushed 130 days ago
- Animated-GIF-iPhone - Support for Animated GIF on iOS ★ 133, pushed 556 days ago
- UzysAnimatedGifPullToRefresh - PullToRefresh using animated GIF to any scrollView ★ 1289, pushed 131 days ago
- iOS AnimatedGif - Animated GIF library for iPhone ★ 103, pushed 763 days ago
- SvGifView - iOS load and display Gif ★ 73, pushed 853 days ago
- GifHUD - iOS progress hud for displaying only animated gif images ★ 131, pushed 605 days ago
- Video-Background GIF - iOS Video Background GIF ★ 123, pushed 335 days ago
- AnimatedGifExample - iOS animated and transparent gifs ★ 41, pushed 2300 days ago
- OLImageView - iOS OLImage and OLImageView support for animated GIFs ★ 772, pushed 319 days ago
- Gifu - animated GIF support for iOS in Swift ★ 1251, pushed 126 days ago
- SwiftGif - UIImage extension with gif support ★ 331, pushed 144 days ago
- Glyph - tool for generating seamlessly looping GIFs and cinemagraphs from videos
- Qgifer
- GIFs - Mac App for finding GIFs ★ 534, pushed 319 days ago
- VineGifR - Mac app to turn Vine videos into gifs ★ 87, pushed 1310 days ago
- GifPro - Gif encoder for Mac ★ 34, pushed 1750 days ago
- Gfycat - Maximum gif/video length: 15 seconds. Maximum file upload is 300Mb
- Imgur - Maximum file upload is 50MB
- Vid2gif - Video to Gif by imgur
- EzGif - Online GIF maker and image editor
- Giflr - A web app for making or remixing animated GIF's
- Gif.gf - Provide a matching GIF for your face
- Starwars-dot-gif - Python script to generate gifs from star wars ★ 457, pushed 154 days ago
FFmpeg
bash
ffmpeg -f image2 -i image%d.jpg animated.gif
Imagemagick
bash
convert -delay 20 -loop 0 frames*.png animated.gif
Bash script (
frames2gif.sh
) for GraphicsMagick, ImageMagick, FFmpeg
```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
bash
ffmpeg -i video.mpg image%d.jpg
bash
convert -coalesce animated.gif image%05d.png
with ffmpeg / based on this article
- Generate a palette :
```bash
start time=30 duration=3 ffmpeg -y -ss $start time -t $duration -i input.avi \ -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png ``` - Output the GIF using the palette :
```bash
start time=30 duration=3 ffmpeg -ss $start time -t $duration -i input.avi -i palette.png -filter_complex \ "fps=10,scale=320:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif ``` article
convert -layers Optimize output.gif output_optimized.gif
```bash ./gifsicle -O3 --lossy=80 -o lossy-compressed.gif input.gif
``` Lossy Gif
```python from moviepy.editor import *
clip = (VideoFileClip("input.avi") .subclip((4,00.00),(5,00.00)) .resize(0.3)) clip.write_gif("output.gif")
``` article
Freezing a region
```python 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) ``` article
bash
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
by
Roger Barnes
```python 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")
``` article
- Download it via youtube-dl and then convert it.
youtube-dl https://www.youtube.com/watch?v=V2XpsaLqXc8
see this stackoverflow's answer
using PhantomJS
Example with this canvas .
```javascript 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); } }); ``` or use ccapture.js .
Webkit request : add a function to WebKit to stop all in-progress GIF animations