genart.dev
Plugins

Trace

Image tracing, edge detection, and conversion to vector layers.

Image tracing layer that extracts edges, contours, and features from reference images for conversion into vector layers.

Installation

npm install @genart-dev/plugin-trace

Layer Types

Type IDDisplay NameDescription
trace:referenceTrace ReferenceImage reference with edge detection and tracing algorithms

Properties

trace:reference

PropertyTypeDefaultDescription
srcstring""Source image (URL or data URI)
algorithmselect"canny"Tracing algorithm: canny, sobel, laplacian, threshold, contour, posterize, stipple
thresholdnumber128Edge detection threshold (0-255)
blurnumber1Pre-processing blur radius
invertbooleanfalseInvert the traced output
opacitynumber0.5Reference overlay opacity (0-1)
colorcolor"#000000"Trace output color
lineWidthnumber1Trace line width
detailnumber0.5Detail level (0-1, higher = more detail)

MCP Tools

ToolDescription
trace_edgesRun edge detection on the reference image
trace_contoursExtract contour outlines from the image
trace_thresholdApply threshold-based black/white conversion
trace_posterizeReduce image to limited color levels
trace_stippleConvert image to stipple dot pattern
trace_configureUpdate trace algorithm and parameters
trace_to_layersConvert trace output to editable vector layers

Example

{
  "tool": "design_add_layer",
  "arguments": {
    "type": "trace:reference",
    "properties": {
      "src": "https://example.com/reference.jpg",
      "algorithm": "canny",
      "threshold": 100,
      "blur": 2,
      "detail": 0.7,
      "opacity": 0.4,
      "color": "#1a1a2e"
    }
  }
}