gifree-app

module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT

README

gifree

A simple and local GIF editor that runs entirely in your browser. No uploads, no accounts, no servers — your files never leave your device.

gifree demo


Features

  • Trim — cut to any frame range
  • Crop — drag to select a region
  • Text — overlay text with font, size, and color options
  • Speed — slow down or speed up (0.25× – 4×)
  • Effects — grayscale or deep fry
  • Resize — scale to preset widths or custom dimensions
  • Undo — step back through edits

How it works

gifree compiles the GIF processing library to WebAssembly using Go's built-in WASM target. When you open the site, the browser downloads a ~4MB .wasm binary once. After that, every edit runs locally on your machine.

Your browser
  └── gif.worker.ts (Web Worker)
        └── gifree.wasm (Go, compiled to WebAssembly)

Running locally

Requirements: Go 1.21+, Node 18+

git clone https://github.com/ikan31/gifree.cc
cd gifree.cc
make dev

Opens at http://localhost:5173.

make dev compiles the Go WASM binary and starts the Vite dev server. If you only change frontend code you can just run cd web && npm run dev on subsequent runs — only re-run make dev if you edit anything in gif/ or cmd/wasm/.

Project structure

gif/              Go GIF processing library (trim, crop, text, speed, effects, resize)
cmd/wasm/         Go WASM entry point — exposes processing functions to JavaScript
web/
  src/
    gif.worker.ts   Web Worker: loads WASM, owns blob store
    wasmApi.ts      Main-thread Promise API
    App.tsx         Root component
    components/     Dropzone, Preview, Toolbar, ExportBar, CropOverlay, TextOverlay
  public/           gifree.wasm + wasm_exec.js (generated at build time, gitignored)

Contributing

PRs are welcome. A few things to know:

  • The GIF processing logic lives entirely in gif/ — pure Go, no browser dependencies, easy to test
  • The WASM entry point in cmd/wasm/main.go is thin glue — it just unpacks JS arguments and calls gif/
  • Frontend is React + TypeScript + Tailwind v4

To add a new operation:

  1. Implement it in gif/ as a function Foo(g *GIFFile, ...) (*GIFFile, error)
  2. Register it in cmd/wasm/main.go as a JS global (gifFoo)
  3. Add it to the worker dispatch in gif.worker.ts
  4. Expose it via wasmApi.ts
  5. Add a tab in Toolbar.tsx

License

MIT

Directories

Path Synopsis
cmd
wasm command
Package main is the WebAssembly entry point for gifree.
Package main is the WebAssembly entry point for gifree.
Package gif provides GIF decoding, encoding, and frame-level editing operations.
Package gif provides GIF decoding, encoding, and frame-level editing operations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL