Vector kit command
imageTrace.make
Make
Traces an embedded image into vector paths with a preset or parameters (mode, threshold, colours, paths, corners, noise); the result stays live.
- Kit
- Vector 0.1.0 (.kvector)
- Changes the document
- yes
- Acts on
ids(a list of ids), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | no | object ID |
ids | integer[] | no | object IDs |
params | object | no | {mode: "blackAndWhite"|"grayscale"|"color"|"logo", threshold: 0-255, palette: "limited"|"fullTone"|"automatic"|"documentLibrary" (color mode; limited: the `colors` best colours, fullTone: as many as the tones need, more with colorDetail, automatic: flat art with its own colours, else fullTone, documentLibrary: at most `colors` of the library's colours, as they are), colors: 2-256, colorDetail: 0-100 (fullTone, automatic), library: "document" (the document's swatches) or a swatch library id or name (swatch.library.list; documentLibrary), paths: 0-100, corners: 0-100, noise: px, method: "abutting"|"overlapping", ignoreWhite, snapCurvesToLines, fills: true, strokes: false (Create: lines up to strokeWidth wide become stroked centre lines; without fills, wider areas become stroked outlines), strokeWidth: px (10), logoColors?: ["#rrggbb"…] (mode logo: flat-colour logos only; colours found automatically or named here, white is always its own colour, at most ten; noise = areas under noise/10 px ignored; edges to a fraction of a pixel, sharp corners restored, lines and circles snapped; enclosed transparent areas are painted white unless ignoreWhite makes them holes; fills/strokes are ignored; gradients and photos are refused)}; color mode; limited: the `colors` best colours, fullTone: as many as the tones need, more with colorDetail, automatic: flat art with its own colours, else fullTone, documentLibrary: at most `colors` of the library's colours, as they are; fullTone, automatic; the document's swatches; swatch.library.list; documentLibrary; Create: lines up to strokeWidth wide become stroked centre lines; without fills, wider areas become stroked outlines; 10; mode logo: flat-colour logos only; colours found automatically or named here, white is always its own colour, at most ten; noise = areas under noise/10 px ignored; edges to a fraction of a pixel, sharp corners restored, lines and circles snapped; enclosed transparent areas are painted white unless ignoreWhite makes them holes; fills/strokes are ignored; gradients and photos are refused |
preset | string | no | imageTrace.presets |
view | "tracingResult" | "tracingResultWithOutlines" | "outlines" | "outlinesWithSourceImage" | "sourceImage" | no |
Call through vector_run
text
vector_run {
"path": "<file>.kvector",
"steps": [{ "command": "imageTrace.make" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: id, ids, params, preset, view. vector_run answers the step’s result in completed[i].result.
Result
The kit gives no result schema for this command.
Parameter schema
json
{
"additionalProperties": false,
"properties": {
"id": {
"description": "object ID",
"type": "integer",
"x-khp-types": [
"Node"
]
},
"ids": {
"description": "object IDs",
"items": {
"type": "integer"
},
"type": "array",
"x-khp-types": [
"Node"
]
},
"params": {
"additionalProperties": true,
"description": "{mode: \"blackAndWhite\"|\"grayscale\"|\"color\"|\"logo\", threshold: 0-255, palette: \"limited\"|\"fullTone\"|\"automatic\"|\"documentLibrary\" (color mode; limited: the `colors` best colours, fullTone: as many as the tones need, more with colorDetail, automatic: flat art with its own colours, else fullTone, documentLibrary: at most `colors` of the library's colours, as they are), colors: 2-256, colorDetail: 0-100 (fullTone, automatic), library: \"document\" (the document's swatches) or a swatch library id or name (swatch.library.list; documentLibrary), paths: 0-100, corners: 0-100, noise: px, method: \"abutting\"|\"overlapping\", ignoreWhite, snapCurvesToLines, fills: true, strokes: false (Create: lines up to strokeWidth wide become stroked centre lines; without fills, wider areas become stroked outlines), strokeWidth: px (10), logoColors?: [\"#rrggbb\"…] (mode logo: flat-colour logos only; colours found automatically or named here, white is always its own colour, at most ten; noise = areas under noise/10 px ignored; edges to a fraction of a pixel, sharp corners restored, lines and circles snapped; enclosed transparent areas are painted white unless ignoreWhite makes them holes; fills/strokes are ignored; gradients and photos are refused)}; color mode; limited: the `colors` best colours, fullTone: as many as the tones need, more with colorDetail, automatic: flat art with its own colours, else fullTone, documentLibrary: at most `colors` of the library's colours, as they are; fullTone, automatic; the document's swatches; swatch.library.list; documentLibrary; Create: lines up to strokeWidth wide become stroked centre lines; without fills, wider areas become stroked outlines; 10; mode logo: flat-colour logos only; colours found automatically or named here, white is always its own colour, at most ten; noise = areas under noise/10 px ignored; edges to a fraction of a pixel, sharp corners restored, lines and circles snapped; enclosed transparent areas are painted white unless ignoreWhite makes them holes; fills/strokes are ignored; gradients and photos are refused",
"properties": {
"colorDetail": {
"description": "0-100"
},
"colors": {
"description": "2-256"
},
"corners": {
"description": "0-100"
},
"fills": {
"default": true,
"type": "boolean"
},
"ignoreWhite": {},
"library": {
"description": "\"document\" or a swatch library id or name"
},
"logoColors": {
"type": "array"
},
"method": {
"enum": [
"abutting",
"overlapping"
],
"type": "string"
},
"mode": {
"enum": [
"blackAndWhite",
"grayscale",
"color",
"logo"
],
"type": "string"
},
"noise": {
"description": "pixels",
"type": "number"
},
"palette": {
"enum": [
"limited",
"fullTone",
"automatic",
"documentLibrary"
],
"type": "string"
},
"paths": {
"description": "0-100"
},
"snapCurvesToLines": {},
"strokeWidth": {
"description": "pixels",
"type": "number"
},
"strokes": {
"default": false,
"type": "boolean"
},
"threshold": {
"description": "0-255"
}
},
"type": "object"
},
"preset": {
"description": "imageTrace.presets",
"type": "string"
},
"view": {
"enum": [
"tracingResult",
"tracingResultWithOutlines",
"outlines",
"outlinesWithSourceImage",
"sourceImage"
],
"type": "string"
}
},
"returns": "{id, paths, anchors, colors}",
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (vector_commands through @kition/[email protected], built from KitionAI/kition-vector@7cf908f). As data: commands.jsonl.