Agent Skills
› nodetool-ai/nodetool
› sandbox-gif
sandbox-gif
GitHub在沙箱环境中将 RGBA 帧序列编码为动画 GIF。通过 gifenc 模块处理量化和调色板,生成字节数组供后续写入。
Trigger Scenarios
需要将多帧图像数据合成为动态 GIF
在代码节点中执行图片格式转换任务
Install
npx skills add nodetool-ai/nodetool --skill sandbox-gif -g -y
SKILL.md
Frontmatter
{
"name": "sandbox-gif",
"description": "Encode an animated GIF from RGBA frames inside a Code node or CodeAct action, with gifenc running in the guest"
}
GIF encoding in the sandbox
Specifier: @nodetool-ai/sandbox-gif. One module, gifenc. Import it at the top of the body.
Frames to a GIF
import { GIFEncoder, quantize, applyPalette } from "@nodetool-ai/sandbox-gif";
const gif = GIFEncoder();
for (const frame of inputs.frames) {
const palette = quantize(frame.rgba, 256);
const index = applyPalette(frame.rgba, palette);
gif.writeFrame(index, inputs.width, inputs.height, {
palette,
delay: frame.delay ?? 100
});
}
gif.finish();
return { bytes: gif.bytes() };
Each frame.rgba is a Uint8Array of length width * height * 4.
delay is milliseconds.
Gotchas
- You supply RGBA. Decode a still with
image.bytes/ canvas, then pack frames yourself. gif.bytes()is aUint8Array. Write it withworkspace.writeBytes.
Version History
- a6a7e57 Current 2026-08-20 09:52


