Skip to content

Repository files navigation

gifsicle-bin

PyPI npm License: GPL v2

Pre-compiled gifsicle binary distributed as a Python wheel and as WASM/JS for browser use.

  • Python developers: Let your app take advantage of gifsicle optimization without forcing users to do an OS-level installation of it.
  • Frontend developers: Add trustworthy Gifsicle optimization without needing a backend (or requiring heavy processing server-side).
  • End users: Get GIF optimization powers easily on multiple OSes without needing package installation permissions.

Built for agent-log-gif.

How is this different from pygifsicle?

pygifsicle requires users to install the gifsicle binary separately (brew install gifsicle, apt install gifsicle, etc.). While pygifsicle helps automate this somewhat, this still requires root permissions on most GNU/Linux distributions, and requires users to have Homebrew or manually install gifsicle themselves on Mac.

Use pygifsicle if you want to leverage the gifsicle on user's systems already, and if you don't care which specific version they have.

gifsicle-bin bundles the compiled gifsicle binary inside the wheel at a deterministic version and makes it available via the pip/uv dependency resolution mechanisms your Python code already uses.

Use gifsicle-bin if you want end users to be able to use gifsicle without needing a precondition of brew install or apt installing it, or if you want to use a deterministic version of gifsicle.

Manual Installation

pip install gifsicle-bin
# or
uv add gifsicle-bin

Usage

Once installed, gifsicle is available as a command:

gifsicle -O2 --lossy=80 input.gif -o output.gif

Or from Python:

import subprocess
subprocess.run(["gifsicle", "-O2", "--lossy=80", "input.gif", "-o", "output.gif"])

To use gifsicle provided by gifsicle-bin as a one off (in a CI build step, etc.):

uvx gifsicle-bin

(eg uvx gifsicle-bin -O2 input.gif -o output.gif)

WASM build

In addition to native wheels, gifsicle-bin builds gifsicle as a WebAssembly module for browser use. See wasm/README.md.

Development instructions for gifsicle-bin

Updating gifsicle version

gifsicle's original source is used via a clean git submodule without patching or modification.

cd vendor/gifsicle && git fetch --tags && git checkout vX.Y && cd ../..

Update the version in wasm/package.json, pyproject.toml and config.h.cmake.in (grep for the old version). If configure.ac changed between versions, check for new HAVE_* defines and add matching entries to CMakeLists.txt + config.h.cmake.in.

To publish, create a new tag and release for vX.Y. CI will build native wheels for all platforms (published to PyPI via OIDC), and WASM artifacts (attached to the GitHub Release and published to npm via OIDC).

License

gifsicle is Copyright (C) 1997-2025 Eddie Kohler and distributed under the GNU General Public License, Version 2.

This package redistributes gifsicle as a compiled binary. The source code is available at https://github.com/kohler/gifsicle.

GPL Information: gifsicle-bin is a convenience package that puts the gifsicle CLI on your PATH. gifsicle-bin still requires calling gifsicle externally (eg via subprocess.run) as a separate program at arms length. See the FSF's Plugins and Proprietary Systems FAQs.

About

Python binary bindings for gifsicle

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages