Tool-Plugin-Demo — Rahmt das Eingabebild in einen farbigen Rahmen ein
Demonstriert ein Tool-Plugin mit einem einzelnen Eingang. Verwendet das 'frame'-Tool, um einen anpassbaren farbigen rechteckigen Rahmen um ein Bild zu legen. Zeigt die Integration externer Tools in die Engine.
INPUT
OUTPUT
JavaScript
// Tool plugin demo — wraps the input image in a coloured frame
// tool_frame.js
//!INPUT: INPUT
//!OUTPUT: OUTPUT
//!PARAM: WIDTH:number=24,min=1,max=4096
//!PARAM: COLOR:string=#ff8800
// Demonstrates a single-IO Tool Plugin. The 'frame' tool is a tiny
// pure-Go binary that ships with the Playground installer; it adds
// a coloured rectangular frame around the input image.
//
// Try changing WIDTH and COLOR via the parameter sliders on the left,
// or open the Tools tab (⚙ → Tools) to see what the tool declares.
const img = Engine.loadImage(INPUT);
const framed = Engine.tool('frame').apply(img, {
width: WIDTH,
color: COLOR,
});
framed.save(OUTPUT);
img.free();
framed.free();
// © 2026 Michael Lechner · mlc OpticScript · https://mlcgo.eu · Elastic License 2.0