ImageOptim/gifski

Public

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

  • Stars5.7k+3 tuần này
  • Forks181
  • Watchers26
  • Issues36
  • Ngày tạo02/11/2017
  • Cập nhật gần nhất17/06/2026
  • Ngôn ngữRust
  • Giấy phép—
README.md14.1 KBRaw

gif.ski

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 or for macOS.

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:

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:

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

and then make the GIF from the frames:

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

Nội dung README thuộc về ImageOptim và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/ImageOptim/gifski