ImageOptim /gifski

GIF encoder based on libimagequant (pngquant). Squeezes maximum possible quality from the awful GIF format.

★ 5,710⑂ 183👁 27⑃ 147● 225▤ 36
RustNOASSERTIONCreated 2017-11-01gif.ski
下载:1.34.01.34.0 ↓1.34.02025-07-13
+2
日增长
5,710
stars
183
forks
27
watchers
147
prs
225
issues
36
releases

README

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.

!(CC) Blender Foundation | gooseberry.blender.org

It's a CLI tool, but it can also be compiled as a C library for seamless use in other apps.

 Download and install

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.

 Usage

gifski is a command-line tool. If you're not comfortable with a terminal, try the GUI version for [Windows][winmsi] or for [macOS][macapp].

[winmsi]: https://github.com/ImageOptim/gifski/releases/download/1.14.4/gifski_1.14.4_x64_en-US.msi
[macapp]: https://sindresorhus.com/gifski

 From ffmpeg video

 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:

sh
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.

 From PNG frames

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:

sh
ffmpeg -i video.webm frame%04d.png


and then make the GIF from the frames:

sh
gifski -o anim.gif frame.png


Note that  is a special wildcard character, and it won't work when placed inside quoted string ("").

You can also resize frames (with -W  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.

See gifski --help for more options.

 Tips for smaller GIF files

Expect to lose a lot of quality for little gain. GIF just isn't that good at compressing, no matter how much you compromise.

 Use --width and --height to make the animation smaller. This makes the biggest difference.
 Add --quality=80 (or a lower number) to lower overall quality. You can fine-tune the quality with:
     --lossy-quality=60 lower values make animations noisier/grainy, but reduce file sizes.
     --motion-quality=60 lower values cause smearing or banding in frames with motion, but reduce file sizes.

If you need to make a GIF that fits a predefined file size, you have to experiment with different sizes and quality settings. The

Top issues

Latest release

1.34.0 1.34.0 2025-07-13
Palette quality improvements from newer libimagequant
 Warnings for incorrect frame numbers and timestamps in the API
 --in-color-space override for ambiguous YUV4MPEG files

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON