---
title: "image.mode.indexedColor: Indexed Color… — Photo kit command — Kition"
description: "Converts to indexed color with at most `colors` (2–256) from a `palette`, with `dither` and `forced` colors; for GIF-style images. Flattens."
canonical: "https://developer.kition.ai/docs/kits/photo/commands/image.mode.indexedColor"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/photo/commands/image.mode.indexedColor](https://developer.kition.ai/docs/kits/photo/commands/image.mode.indexedColor)

# image.mode.indexedColor

**Indexed Color….** Converts to indexed color with at most `colors` (2–256) from a `palette`, with `dither` and `forced` colors; for GIF-style images. Flattens.

- Kit: Photo 0.1.0 (PSD, PSB, or .kphoto); reference: [Photo kit commands](https://developer.kition.ai/docs/kits/photo.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `amount` | `integer` | no | 0 to 100 |
| `coalesce` | `string` | no | Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one. |
| `colors` | `integer` | no | 2 to 256 |
| `dither` | `"diffusion" \| "none" \| "pattern" \| "noise"` | no |  |
| `forced` | `"blackWhite" \| "none" \| "primaries" \| "web"` | no |  |
| `palette` | `"selective" \| "perceptual" \| "adaptive" \| "exact" \| "systemMac" \| "systemWindows" \| "web" \| "uniform"` | no |  |
| `transparency` | `boolean` | no |  |

## Call through photo_run

```text
photo_run {
  "path": "<file>.psd",
  "steps": [{ "command": "image.mode.indexedColor" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `amount`, `coalesce`, `colors`, `dither`, `forced`, `palette`, `transparency`. photo_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": {
    "amount": {
      "default": 75,
      "description": "0 to 100",
      "type": "integer"
    },
    "coalesce": {
      "description": "Merges consecutive edits with the same key into one undo step, as a slider drag or a typing session is one.",
      "type": "string"
    },
    "colors": {
      "default": 256,
      "description": "2 to 256",
      "type": "integer"
    },
    "dither": {
      "default": "diffusion",
      "enum": [
        "diffusion",
        "none",
        "pattern",
        "noise"
      ],
      "type": "string"
    },
    "forced": {
      "default": "blackWhite",
      "enum": [
        "blackWhite",
        "none",
        "primaries",
        "web"
      ],
      "type": "string"
    },
    "palette": {
      "default": "selective",
      "enum": [
        "selective",
        "perceptual",
        "adaptive",
        "exact",
        "systemMac",
        "systemWindows",
        "web",
        "uniform"
      ],
      "type": "string"
    },
    "transparency": {
      "default": true,
      "type": "boolean"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/photo-darwin-arm64@0.1.0 and the kit itself (photo_commands through @kition/cli@0.1.1, built from KitionAI/kition-photo@abe3f30).
