Agent Skills
› nodetool-ai/nodetool
› sandbox-gif
sandbox-gif
GitHub在沙箱环境中将RGBA帧编码为GIF动图。提供GIFEncoder、量化和调色板应用功能,支持自定义帧延迟,适用于需要生成或处理动态图片的场景。
Trigger Scenarios
需要将多张图片合成为GIF动图
需要在代码节点中生成动画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


