---
title: "image.edit: Edit an image — PDF kit command — Kition"
description: "Change one of a page's images (number from page.listImages): action move (rect: new box in top-left-origin points), rotate (quarters clockwise, default 1), flip_horizontal, flip_vertical, replace (path: an image file, drawn in the same place) or delete. Undoable. Form artwork supports move/resize/rotate/flip/delete as a group; replace and image_save only support raster images."
canonical: "https://developer.kition.ai/docs/kits/pdf/commands/image.edit"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/pdf/commands/image.edit](https://developer.kition.ai/docs/kits/pdf/commands/image.edit)

# image.edit

**Edit an image.** Change one of a page's images (number from page.listImages): action move (rect: new box in top-left-origin points), rotate (quarters clockwise, default 1), flip_horizontal, flip_vertical, replace (path: an image file, drawn in the same place) or delete. Undoable. Form artwork supports move/resize/rotate/flip/delete as a group; replace and image_save only support raster images.

- Kit: PDF 0.1.0 (.pdf); reference: [PDF kit commands](https://developer.kition.ai/docs/kits/pdf.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | `"move" \| "rotate" \| "flip_horizontal" \| "flip_vertical" \| "replace" \| "delete"` | yes |  |
| `image` | `integer` | yes | (minimum 1) |
| `page` | `integer` | yes | (minimum 1) |
| `quarters` | `integer` | no |  |
| `rect` | `number[]` | no | (maxItems 4, minItems 4) |

## Call through pdf_run

```text
pdf_run {
  "path": "<file>.pdf",
  "steps": [{ "command": "image.edit", "params": { "action": <"move" | "rotate" | "flip_horizontal" | "flip_vertical" | "replace" | "delete">, "image": <integer>, "page": <integer> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `quarters`, `rect`. pdf_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": {
    "action": {
      "enum": [
        "move",
        "rotate",
        "flip_horizontal",
        "flip_vertical",
        "replace",
        "delete"
      ],
      "type": "string"
    },
    "image": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "page": {
      "description": "(minimum 1)",
      "type": "integer"
    },
    "quarters": {
      "type": "integer"
    },
    "rect": {
      "description": "(maxItems 4, minItems 4)",
      "items": {
        "type": "number"
      },
      "type": "array"
    }
  },
  "required": [
    "action",
    "image",
    "page"
  ],
  "type": "object"
}
```

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