---
title: "file.exportForWeb.preview: Save for Web Preview — Vector kit command — Kition"
description: "Answers what Save for Web would write: file size, colours and download time, optionally with the image data."
canonical: "https://developer.kition.ai/docs/kits/vector/commands/file.exportForWeb.preview"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/vector/commands/file.exportForWeb.preview](https://developer.kition.ai/docs/kits/vector/commands/file.exportForWeb.preview)

# 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); reference: [Vector kit commands](https://developer.kition.ai/docs/kits/vector.md)
- 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 |  |

```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/vector-darwin-arm64@0.1.0 and the kit itself (vector_commands through @kition/cli@0.1.1, built from KitionAI/kition-vector@7cf908f).
