readwrite-gif
Read and write GIFs in Javascript.
Getting Started
Include readwrite-gif in your browser:
It exposes a single namespace GIF
with two classes, GIF.Decoder
and
GIF.Encoder
.
API
GIF.Decoder
Works just like GifReader
in omggif, since
that's what it actually is behind the scenes.
Example:
var decoder = buffer imagedata = ctx;decoder; // Decode 0th framectx;
GIF.Encoder
This part was taken from antimatter15's
jsgif GIFEncoder
implementation.
Example:
var encoder = ;encoder; // loop foreverencoder; // go to next frame every 100 msencoderstart; // write headerencoder; // Render the frame from the canvas context.