ruby-libgd

GD::Gif.new

gif = GD::Gif.new("output.gif", loop: true)

Creates a new animated GIF writer.


Overview

GD::Gif.new initializes a GIF encoder used to generate animated GIFs.

At this stage, the output file is created, but no image data is written until frames are added.


Parameters

path (String)

The file path where the GIF will be written.

GD::Gif.new("animation.gif")

loop (Boolean, optional)

Controls how the animation loops.

GD::Gif.new("once.gif", loop: false)

Behavior


Notes