picfit is a Go server that resizes, thumbnails, and transforms images on demand. It proxies your storage backends and is meant to sit behind an HTTP cache such as Varnish.
Overview
picfit offloads image processing—resize, thumbnail, crop, rotate, filters, and chained operations—to a dedicated network service. Clients call it with URLs or storage paths plus width, height, format, and operation parameters; it generates derivatives and can display, redirect, or return metadata about the result.
Configuration is JSON-driven and selects key/value stores (in-memory cache, Redis, Redis cluster, or round-robin Redis) to avoid regenerating the same transform twice. Storage backends include the local filesystem, HTTP-loaded sources, Amazon S3, DigitalOcean Spaces, and Google Cloud Storage, with separate source and destination stores when needed. Filename sharding options help large filesystem deployments.
Processing engines include libvips for common raster formats, a pure Go backend, and gifsicle for animated GIF resize. You run the binary with a config file; port defaults are configurable. Optional upload and delete endpoints exist but are disabled by default and require explicit hardening when enabled.
The service compiles to a single binary per architecture and supports Docker-based builds. It sets cache-friendly headers on display responses so a front HTTP cache can serve repeated requests efficiently.
Key features
- On-the-fly resize and thumbnail
- Multiple storage backends
- Redis or in-memory key cache
- Display, redirect, and get methods
- Chained image operations
- libvips, Go, and gifsicle engines
- Optional upload and delete APIs
- Docker build integration
Use cases
- Avatar and catalog image pipelines
- CDN-friendly derivative generation
- S3-to-S3 image cache layers
- Resize-by-URL without app CPU load