gif.jsJavaScript 的 GIF 動畫生成
gif.js 是一個可直接在瀏覽器上運行的 JavaScript GIF 編碼器。支持的瀏覽器包括:
Google Chrome
Firefox 17
Safari 6
Internet Explorer 10
Mobile Safari iOS 6
使用方法:
var gif = new GIF({
workers: 2,
quality: 10
});
// add an image element
gif.addFrame(imageElement);
// or a canvas element
gif.addFrame(canvasElement, {delay: 200});
// or copy the pixels from a canvas context
gif.addFrame(ctx, {copy: true});
gif.on('finished', function(blob) {
window.open(URL.createObjectURL(blob));
});
gif.render();評論
圖片
表情
