Highest-quality GIF encoder based on pngquant.
gifski converts video frames to GIF animations using pngquant's fancy features for efficient cross-frame palettes and temporal dithering. It produces animated GIFs that use thousands of colors per frame.
It's a CLI tool, but it can also be compiled as a C library for seamless use in other apps.
See releases page for executables.
If you have Homebrew, you can also get it with brew install gifski.
If you have Rust from rustup (1.63+), you can also build it from source with cargo install gifski.
gifski is a command-line tool. If you're not comfortable with a terminal, try the GUI version for Windows or for macOS.
Tip: Instead of typing file paths, you can drag'n'drop files into the terminal window!
If you have ffmpeg installed, you can use it to stream a video directly to the gifski command by adding -f yuv4mpegpipe to ffmpeg's arguments:
ffmpeg -i video.mp4 -f yuv4mpegpipe - | gifski -o anim.gif -Replace "video.mp4" in the above code with actual path to your video.
Note that there's - at the end of the command. This tells gifski to read from standard input. Reading a .y4m file from disk would work too, but these files are huge.
gifski may automatically downsize the video if it has resolution too high for a GIF. Use --width=1280 if you can tolerate getting huge file sizes.
A directory full of PNG frames can be used as an input too. You can export them from any animation software. If you have ffmpeg installed, you can also export frames with it:
ffmpeg -i video.webm frame%04d.pngand then make the GIF from the frames:
gifski -o anim.gif frame*.pngNote that * is a special wildcard character, and it won't work when placed inside quoted string ("*").
You can also resize frames (with -W <width in pixels> option). If the input was ever encoded using a lossy video codec it's recommended to at least halve size of the frames to hide compression artefacts and counter chroma subsampling that was done by the video codec.