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

Parameters of file.exportForWeb.preview
NameTypeRequiredDescription
imagebooleannoalso the optimised file as dataBase64
kbpsnumbernoconnection speed for the download time
presetstringnoread by the command beside its listed parameters
resetbooleannoread by the command beside its listed parameters
sliceintegerno1-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

Result of file.exportForWeb.preview
NameTypeRequiredDescription
bytesnumberno
colorsobject[]no
dataBase64anyno
formatstringno
heightnumberno
kbpsnumberno
mappedToTransparentany[]no
secondsnumberno
slicesnumberno
widthnumberno
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.