11 releases (6 breaking)
|0.8.4||Jul 1, 2018|
|0.8.2||Mar 2, 2018|
|0.7.0||Dec 13, 2017|
|0.6.2||Nov 19, 2017|
#6 in Video
288 downloads per month
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. Add the
--with-openmp to make it run faster.
You can use
ffmpeg command to convert any video to PNG frames:
ffmpeg -i video.webm frame%04d.png
and then make the GIF from the frames:
gifski -o anim.gif frame*.png
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.
gifski -h for more options.
- Install Rust
- Clone the repository:
git clone https://github.com/ImageOptim/gifski
- In the cloned directory, run:
cargo build --release
Enable OpenMP by adding
--features=openmp to Cargo build flags (supported on macOS and Linux with GCC). It makes encoding more than twice as fast.
gifski.h for the API. To build the library, run:
cargo build --release
and link with
target/release/libgifski.a. Please observe the LICENSE.
The tool optionally supports decoding video directly, but unfortunately it relies on ffmpeg 3.x, which may be very hard to get working, so it's not enabled by default.
You must have
libclang installed, both with their C headers intalled in default system include paths. Details depend on the platform and version, but you usually need to install packages such as
clang. Please note that installation of these dependencies may be quite difficult. Especially on macOS and Windows it takes expert knowledge to just get them installed without wasting several hours on endless stupid installation and compilation errors, which I can't help with.
Once you have dependencies installed, compile with
cargo build --release --features=video,openmp.
When compiled with video support ffmpeg licenses apply. You may need to have a patent license to use H.264/H.265 video (I recommend using VP9/WebM instead).
gifski -o out.gif video.mp4
- clap 2.32.0
- error-chain 0.12.0
- gif 0.10.0
- gif-dispose 2.1.1
- glob 0.2.11
- imagequant 2.11.9
- imgref 1.3.5
- lodepng 2.1.5
- pbr 1.0.0
- rayon 1.0.0
- resize 0.3.0
- rgb 0.8.9
- wild 1.0.1