Vector kit command
file.exportForWeb.preview
Save for Web Preview
Answers what Save for Web would write: file size, colours and download time, optionally with the image data.
- Kit
- Vector 0.1.0 (.kvector)
- Changes the document
- no
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
image | boolean | no | also the optimised file as dataBase64 |
kbps | number | no | connection speed for the download time |
preset | string | no | read by the command beside its listed parameters |
reset | boolean | no | read by the command beside its listed parameters |
slice | integer | no | 1-based, from slice.list; default the whole image |
Call through vector_run
text
vector_run {
"path": "<file>.kvector",
"steps": [{ "command": "file.exportForWeb.preview" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: image, kbps, preset, reset, slice. vector_run answers the step’s result in completed[i].result.
Result
| Name | Type | Required | Description |
|---|---|---|---|
bytes | number | no | |
colors | object[] | no | |
dataBase64 | any | no | |
format | string | no | |
height | number | no | |
kbps | number | no | |
mappedToTransparent | any[] | no | |
seconds | number | no | |
slices | number | no | |
width | number | no |
Result JSON Schema
json
{
"additionalProperties": true,
"properties": {
"bytes": {
"type": "number"
},
"colors": {
"items": {
"additionalProperties": true,
"properties": {
"color": {
"type": "string"
},
"locked": {
"type": "boolean"
},
"source": {
"type": "string"
},
"transparent": {
"type": "boolean"
},
"webSafe": {
"type": "boolean"
},
"webShifted": {
"type": "boolean"
}
},
"type": "object"
},
"type": "array"
},
"dataBase64": {},
"format": {
"type": "string"
},
"height": {
"type": "number"
},
"kbps": {
"type": "number"
},
"mappedToTransparent": {
"type": "array"
},
"seconds": {
"type": "number"
},
"slices": {
"type": "number"
},
"width": {
"type": "number"
}
},
"type": "object"
}Parameter schema
json
{
"additionalProperties": false,
"properties": {
"image": {
"default": false,
"description": "also the optimised file as dataBase64",
"type": "boolean"
},
"kbps": {
"default": 56.6,
"description": "connection speed for the download time",
"type": "number"
},
"preset": {
"description": "read by the command beside its listed parameters",
"type": "string"
},
"reset": {
"description": "read by the command beside its listed parameters",
"type": "boolean"
},
"slice": {
"description": "1-based, from slice.list; default the whole image",
"type": "integer"
}
},
"returns": "{format, width, height, bytes (exactly the file's size), seconds (to download at kbps), kbps, colors?: [{color: \"#rrggbb\", source: \"#rrggbb\" (the colour the reduction made, as colorTable lists it), transparent, locked, webShifted, webSafe}] (gif/png8: the colour table in file order), mappedToTransparent?: [\"#rrggbb\"…], slices: images an export writes, dataBase64?}",
"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.