# nhn/tui.image-editor architecture

> Architecture diagram of the GitHub repository nhn/tui.image-editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nhn/tui.image-editor
- Repository: https://github.com/nhn/tui.image-editor

## Overview

TOAST UI ImageEditor is a browser-based HTML5 Canvas editor, with plain JavaScript, Vue, and React packages. A user supplies an image and invokes editing operations through the editor; the documented capabilities include crop, transform, drawing, shapes, icons, text, masks, filters, history, and download. The sampled core constructor shows it wiring UI, action, and command-invocation layers, while the Vue wrapper constructs and exposes the editor instance. Several feature modules are represented from the tree and README; their internal call paths were not sampled, so those links are omitted.

Main entry points: [`apps/image-editor/src/js/imageEditor.js`](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/imageEditor.js) (ImageEditor), [`apps/vue-image-editor/src/ImageEditor.vue`](https://github.com/nhn/tui.image-editor/blob/master/apps/vue-image-editor/src/ImageEditor.vue) (Vue wrapper), [`apps/image-editor/src/js/action.js`](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/action.js) (Action layer), [`apps/image-editor/src/js/invoker.js`](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/invoker.js) (Command invoker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Editor core"]
  node_editor["ImageEditor<br/>[imageEditor.js]"]
  node_actions["Action layer<br/>[action.js]"]
  node_invoker["Command invoker<br/>[invoker.js]"]
  node_commands["Editing commands"]
end

subgraph group_visual["Canvas features"]
  node_graphics["Canvas graphics<br/>[graphics.js]"]
  node_components["Canvas components"]
  node_drawing["Drawing modes"]
  node_extensions["Filters and masks"]
  node_vectorizer["Image vectorizer<br/>[imagetracer.js]"]
end

subgraph group_controls["Editor interface"]
  node_ui["Editor UI<br/>[ui.js]"]
  node_panels["Feature panels"]
  node_themes["UI themes"]
end

subgraph group_wrappers["Framework wrappers"]
  node_vue["Vue wrapper<br/>[ImageEditor.vue]"]
  node_react["React wrapper<br/>[index.js]"]
end

node_user(("Editor user"))

node_user -->|"invokes editing"| node_editor
node_editor -->|"constructs UI"| node_ui
node_editor -->|"creates invoker"| node_invoker
node_editor -->|"imports actions"| node_actions
node_vue -->|"constructs instance"| node_editor
node_vue -->|"forwards events"| node_editor

click node_editor "https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/imageEditor.js"
click node_actions "https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/action.js"
click node_invoker "https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/invoker.js"
click node_commands "https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/command"
click node_graphics "https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/graphics.js"
click node_components "https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/component"
click node_drawing "https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/drawingMode"
click node_extensions "https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/extension"
click node_vectorizer "https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/helper/imagetracer.js"
click node_ui "https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/ui.js"
click node_panels "https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/ui"
click node_themes "https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/ui/theme"
click node_vue "https://github.com/nhn/tui.image-editor/blob/master/apps/vue-image-editor/src/ImageEditor.vue"
click node_react "https://github.com/nhn/tui.image-editor/blob/master/apps/react-image-editor/src/index.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor,node_actions,node_invoker,node_commands,node_user toneBlue
class node_graphics,node_components,node_drawing,node_extensions,node_vectorizer toneAmber
class node_ui,node_panels,node_themes toneMint
class node_vue,node_react toneRose
```

## Components

### Editor core

- [ImageEditor](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/imageEditor.js): `apps/image-editor/src/js/imageEditor.js`
- [Action layer](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/action.js): `apps/image-editor/src/js/action.js`
- [Command invoker](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/invoker.js): `apps/image-editor/src/js/invoker.js`
- [Editing commands](https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/command): `apps/image-editor/src/js/command`

### Canvas features

- [Canvas graphics](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/graphics.js): `apps/image-editor/src/js/graphics.js`
- [Canvas components](https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/component): `apps/image-editor/src/js/component`
- [Drawing modes](https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/drawingMode): `apps/image-editor/src/js/drawingMode`
- [Filters and masks](https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/extension): `apps/image-editor/src/js/extension`
- [Image vectorizer](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/helper/imagetracer.js): `apps/image-editor/src/js/helper/imagetracer.js`

### Editor interface

- [Editor UI](https://github.com/nhn/tui.image-editor/blob/master/apps/image-editor/src/js/ui.js): `apps/image-editor/src/js/ui.js`
- [Feature panels](https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/ui): `apps/image-editor/src/js/ui`
- [UI themes](https://github.com/nhn/tui.image-editor/tree/master/apps/image-editor/src/js/ui/theme): `apps/image-editor/src/js/ui/theme`

### Framework wrappers

- [Vue wrapper](https://github.com/nhn/tui.image-editor/blob/master/apps/vue-image-editor/src/ImageEditor.vue): `apps/vue-image-editor/src/ImageEditor.vue`
- [React wrapper](https://github.com/nhn/tui.image-editor/blob/master/apps/react-image-editor/src/index.js): `apps/react-image-editor/src/index.js`

### Other components

- **Editor user**

## Connections

- Editor user → ImageEditor: invokes editing
- ImageEditor → Editor UI: constructs UI (evidence: `apps/image-editor/src/js/imageEditor.js`)
- ImageEditor → Command invoker: creates invoker (evidence: `apps/image-editor/src/js/imageEditor.js`)
- ImageEditor → Action layer: imports actions (evidence: `apps/image-editor/src/js/imageEditor.js`)
- Vue wrapper → ImageEditor: constructs instance (evidence: `apps/vue-image-editor/src/ImageEditor.vue`)
- Vue wrapper → ImageEditor: forwards events (evidence: `apps/vue-image-editor/src/ImageEditor.vue`)
