GIF libraries for Ruby
- ruby-vips loads an animated GIF as one tall image with the frames stacked vertically, plus
delayandloopmetadata; operations likethumbnailresize all frames at once. Saving uses cgif with libimagequant (or quantizr) for good palettes, and it’s fast and memory-efficient. - MiniMagick runs ImageMagick:
-coalesce,-layers Optimize,-delayand-loopgive full control over animations. Simple to use, slower, and memory-hungry for long animations.
Both need a native library installed (libvips or ImageMagick). Rails’ Active Storage can use either through the image_processing gem.
- MiniMagick MiniMagick wraps the ImageMagick command line for Ruby. How to read GIF frames and delays, resize an animated GIF, create a looping animation from images.
- ruby-vips ruby-vips reads and writes GIF and animated GIF through libvips. How to load all frames, read delays and loop count, resize an animated GIF.