簡単に使えるJavaScript GIFデコーダです。
デモで、このライブラリを使ったサンプルを確認できます。a01-kanta.gifはhttps://github.com/code4fukui/lessergo-puyo// 鯖江市役所西山動物園オープンデータから引用しています。
GIFファイルをArrayBufferに変換し、parseGIF関数に渡すことで、GIFの情報を取得できます。decompressFrames関数を使うと、各フレームの情報を取得できます。
import { parseGIF, decompressFrames } from 'https://code4fukui.github.io/gifuct-js/src/index.js';
const buff = await (await fetch(gifURL)).arrayBuffer();
const gif = parseGIF(buff);
const frames = decompressFrames(gif, true)
console.log(frames);
MIT License