{"id":13395498,"url":"https://github.com/ImageOptim/gifski","last_synced_at":"2025-03-13T21:31:43.365Z","repository":{"id":26548524,"uuid":"109192133","full_name":"ImageOptim/gifski","owner":"ImageOptim","description":"GIF encoder based on libimagequant (pngquant). Squeezes maximum possible quality from the awful GIF format.","archived":false,"fork":false,"pushed_at":"2024-05-22T10:28:53.000Z","size":681,"stargazers_count":4389,"open_issues_count":20,"forks_count":129,"subscribers_count":34,"default_branch":"main","last_synced_at":"2024-05-22T11:38:42.166Z","etag":null,"topics":["gif","gif-animation","gif-creator","gifencoder","pngquant"],"latest_commit_sha":null,"homepage":"https://gif.ski","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImageOptim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-01T22:48:43.000Z","updated_at":"2024-05-22T11:38:50.746Z","dependencies_parsed_at":"2023-02-12T18:00:32.359Z","dependency_job_id":"680ae1f0-2daa-455b-9ac5-e6600fcde51b","html_url":"https://github.com/ImageOptim/gifski","commit_stats":{"total_commits":371,"total_committers":21,"mean_commits":"17.666666666666668","dds":0.09703504043126687,"last_synced_commit":"a88a9012f98508f9d62180286657933e11771aac"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImageOptim%2Fgifski","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImageOptim%2Fgifski/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImageOptim%2Fgifski/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImageOptim%2Fgifski/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImageOptim","download_url":"https://codeload.github.com/ImageOptim/gifski/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221411584,"owners_count":16815696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gif","gif-animation","gif-creator","gifencoder","pngquant"],"created_at":"2024-07-30T17:02:02.593Z","updated_at":"2024-10-25T09:30:23.976Z","avatar_url":"https://github.com/ImageOptim.png","language":"Rust","readme":"# [\u003cimg width=\"100%\" src=\"https://gif.ski/gifski.svg\" alt=\"gif.ski\"\u003e](https://gif.ski)\n\nHighest-quality GIF encoder based on [pngquant](https://pngquant.org).\n\n**[gifski](https://gif.ski)** 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.\n\n![(CC) Blender Foundation | gooseberry.blender.org](https://gif.ski/demo.gif)\n\nIt's a CLI tool, but it can also be compiled [as a C library](https://docs.rs/gifski) for seamless use in other apps.\n\n## Download and install\n\nSee [releases](https://github.com/ImageOptim/gifski/releases) page for executables.\n\nIf you have [Homebrew](https://brew.sh/), you can also get it with `brew install gifski`.\n\nIf you have [Rust from rustup](https://www.rust-lang.org/install.html) (1.63+), you can also build it from source with [`cargo install gifski`](https://lib.rs/crates/gifski).\n\n## Usage\n\ngifski is a command-line tool. If you're not comfortable with a terminal, try the GUI version for [Windows][winmsi] or for [macOS][macapp].\n\n[winmsi]: https://github.com/ImageOptim/gifski/releases/download/1.14.4/gifski_1.14.4_x64_en-US.msi\n[macapp]: https://sindresorhus.com/gifski\n\n### From ffmpeg video\n\n\u003e Tip: Instead of typing file paths, you can drag'n'drop files into the terminal window!\n\nIf 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:\n\n```sh\nffmpeg -i video.mp4 -f yuv4mpegpipe - | gifski -o anim.gif -\n```\n\nReplace \"video.mp4\" in the above code with actual path to your video.\n\nNote 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.\n\n`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.\n\n### From PNG frames\n\nA 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:\n\n```sh\nffmpeg -i video.webm frame%04d.png\n```\n\nand then make the GIF from the frames:\n\n```sh\ngifski -o anim.gif frame*.png\n```\n\nNote that `*` is a special wildcard character, and it won't work when placed inside quoted string (`\"*\"`).\n\nYou can also resize frames (with `-W \u003cwidth in pixels\u003e` 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\nSee `gifski --help` for more options.\n\n### Tips for smaller GIF files\n\nExpect to lose a lot of quality for little gain. GIF just isn't that good at compressing, no matter how much you compromise.\n\n* Use `--width` and `--height` to make the animation smaller. This makes the biggest difference.\n* Add `--quality=80` (or a lower number) to lower overall quality. You can fine-tune the quality with:\n    * `--lossy-quality=60` lower values make animations noisier/grainy, but reduce file sizes.\n    * `--motion-quality=60` lower values cause smearing or banding in frames with motion, but reduce file sizes.\n\nIf you need to make a GIF that fits a predefined file size, you have to experiment with different sizes and quality settings. The command line tool will display estimated total file size during compression, but keep in mind that the estimate is very imprecise.\n\n## Building\n\n1. [Install Rust via rustup](https://www.rust-lang.org/en-US/install.html). This project only supports up-to-date versions of Rust. You may get errors about \"unstable\" features if your compiler version is too old. Run `rustup update`.\n2. Clone the repository: `git clone https://github.com/ImageOptim/gifski`\n3. In the cloned directory, run: `cargo build --release`. This will build in `./target/release`.\n\n### Using from C\n\n[See `gifski.h`](https://github.com/ImageOptim/gifski/blob/main/gifski.h) for [the C API](https://docs.rs/gifski/latest/gifski/c_api/#functions). To build the library, run:\n\n```sh\nrustup update\ncargo build --release\n```\n\nand link with `target/release/libgifski.a`. Please observe the [LICENSE](LICENSE).\n\n### C dynamic library for package maintainers\n\nThe build process uses [`cargo-c`](https://lib.rs/cargo-c) for building the dynamic library correctly and generating the pkg-config file.\n\n```sh\nrustup update\ncargo install cargo-c\n# build\ncargo cbuild --prefix=/usr --release\n# install\ncargo cinstall --prefix=/usr --release --destdir=pkgroot\n```\n\nThe `cbuild` command can be omitted, since `cinstall` will trigger a build if it hasn't been done already.\n\n## License\n\nAGPL 3 or later. I can offer alternative licensing options, including [commercial licenses](https://supso.org/projects/pngquant). Let [me](https://kornel.ski/contact) know if you'd like to use it in a product incompatible with this license.\n\n## With built-in video support\n\nThe tool optionally supports decoding video directly, but unfortunately it relies on ffmpeg 6.x, which may be *very hard* to get working, so it's not enabled by default.\n\nYou must have `ffmpeg` and `libclang` installed, both with their C headers installed in default system include paths. Details depend on the platform and version, but you usually need to install packages such as `libavformat-dev`, `libavfilter-dev`, `libavdevice-dev`, `libclang-dev`, `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. If you're cross-compiling, try uncommenting `[patch.crates-io]` section at the end of `Cargo.toml`, which includes some experimental fixes for ffmpeg.\n\nOnce you have dependencies installed, compile with `cargo build --release --features=video` or `cargo build --release --features=video-static`.\n\nWhen compiled with video support [ffmpeg licenses](https://www.ffmpeg.org/legal.html) apply. You may need to have a patent license to use H.264/H.265 video (I recommend using VP9/WebM instead).\n\n```sh\ngifski -o out.gif video.mp4\n```\n\n## Cross-compilation for iOS\n\nThe easy option is to use the included `gifski.xcodeproj` file to build the library automatically for all Apple platforms. Add it as a [subproject](https://lib.rs/crates/cargo-xcode) to your Xcode project, and link with `gifski-staticlib` Xcode target. See [the GUI app](https://github.com/sindresorhus/Gifski) for an example how to integrate the library.\n\n### Cross-compilation for iOS manually\n\nMake sure you have Rust installed via [rustup](https://rustup.rs/). Run once:\n\n```sh\nrustup target add aarch64-apple-ios\n```\n\nand then to build the library:\n\n```sh\nrustup update\ncargo build --lib --release --target=aarch64-apple-ios\n```\n\nThe build may print \"dropping unsupported crate type `cdylib`\" warning. This is expected when building for iOS.\n\nThis will create a static library in `./target/aarch64-apple-ios/release/libgifski.a`. You can add this library to your Xcode project. See [gifski.app](https://github.com/sindresorhus/Gifski) for an example how to use libgifski from Swift.\n\n","funding_links":[],"categories":["Rust","Utilities","Repository","others","Programming Languages","Other"],"sub_categories":["Image","Rust"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImageOptim%2Fgifski","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FImageOptim%2Fgifski","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FImageOptim%2Fgifski/lists"}