intervention/gif
A native PHP encoder and decoder for the GIF image format with no image processing extension dependencies. Easily decode, build, and encode animated GIFs, with optional GD-based frame splitting. Requires PHP 8.3+.
Architecture fit
Decoder::decode(), Builder::canvas()/addFrame()/setLoops()/encode(), Splitter). No service provider, config, or facade ships with it, so the integration surface is entirely ours to own — roughly one day of work to register bindings and a Gif facade in the app container.src/Blocks ↔ src/Decoders ↔ src/Encoders) mirrors the GIF89a spec directly. That is good for maintainability and for exposing metadata (delays, loop counts, transparency, disposal methods) as first-class value objects, which is what compliance and branding requirements actually need.Splitter, which requires GD to return per-frame GDImage objects. Everything else (decode-to-model, encode-from-parts) works without GD or ImageMagick — the main architectural differentiator versus Imagick-based approaches, and the reason it survives in serverless/restricted-runtime environments.Integration feasibility
composer require intervention/gif and nothing else. No binaries, no PHP extensions for the encode/decode path, no daemon, no storage assumptions — which means it drops cleanly into queue workers, API controllers, and CLI commands.Technical risk
olivervogel), 61 stars, and a public dependent count of zero. The zero is almost certainly an artifact of how Packagist surfaces dependents — intervention/image bundles this as its animated-GIF engine — but I would not present it to stakeholders as an ecosystem signal without verifying. Treat this as "small, focused, single-maintainer library" rather than "widely adopted."Key questions
Stack fit
ShouldQueue jobs for batch encoding), filesystem disks for frame I/O, and the validation pipeline for upload gating.Migration path
GifProcessor interface, keep the legacy implementation live, and cut over per-endpoint behind a feature flag. The two implementations can coexist indefinitely; nothing in the package forces a big-bang rewrite.Compatibility
~5.0.x) given the thin release notes and single maintainer; review major bumps manually rather than auto-merging.Splitter usage with a runtime extension_loaded('gd') check and a clear error, so a container image built without GD fails loudly at the boundary rather than mid-request.Sequencing
GifProcessor interface + implementation + container binding + Gif facade + config for size/frame/loop limits.Maintenance
Support
Scaling
Splitter (GD path) is materially heavier than pure decode/encode; keep frame-extraction workloads on a separate, more constrained queue.Failure modes
Ramp-up
How can I help you explore Laravel packages today?