Decode the frames of a gif.
npm install decode-gif
const fs = require("fs");
const decodeGif = require("decode-gif");
decodeGif(fs.readFileSync("unicorn.gif"));
/*
{
width: 220,
height: 165,
frames: [
{ timeCode: 0, data: [Uint8ClampedArray] },
{ timeCode: 10, data: [Uint8ClampedArray] },
...
]
}
*/
Type: array-like
The gif data. Can be anything array-like such as a Buffer
, Array
or Uint8Array
.
Type: number
The width of the gif.
Type: number
The height of the gif.
An array of each frame of the gif.
The time code in milliseconds that the frame appears at.
The frame data as a Uint8ClampedArray
.