# Image editor

> A zero-dependency Canvas 2D image editor - crop, rotate, straighten, flip, resize, zoom and pan, finetune, filter presets, frames, shape / text / freehand / image annotations, redaction, undo and redo, and export to a Blob.

Canonical: https://salmonui.dev/docs/editors/image-editor

`ImageEditor` from `@salmonui/editors/image-editor` edits an image on a Canvas
2D surface with no dependencies. Every edit is a controlled value with a
change callback, so the application owns (and can persist) the whole edit;
pointer, pinch, pan and drag transients never touch React state.

```tsx
import { ImageEditor, type ImageEditorActions } from '@salmonui/editors/image-editor';
import '@salmonui/editors/image-editor/styles.css';

const actions = useRef<ImageEditorActions>(null);

<ImageEditor
  src={file}
  annotations={annotations}
  onAnnotationsChange={setAnnotations}
  actionsRef={actions}
  style={{ height: 520 }}
/>;

const blob = await actions.current?.toBlob({ type: 'image/webp', quality: 0.9 });
```

The stylesheet carries the `Button`, `Toolbar`, `Menu` and visually hidden
rules the editor renders, so it is the only stylesheet besides
`@salmonui/core/styles.css` (the theme, once per app).

### Live demo: Image editor

Live demo: https://salmonui.dev/demos/editors/image-editor

A Canvas 2D image editor with crop, rotate, flip, straighten, resize, zoom, finetune, filter presets, frames, shape, text and freehand annotations, redaction, undo and export.

`Demo.tsx`:

```tsx
'use client';

import { useEffect, useRef, useState } from 'react';
import { Button } from '@salmonui/buttons/button';
import { ImageEditor, type ImageEditorActions, type ImageEditorAnnotation } from '@salmonui/editors/image-editor';

/** A generated landscape (no network image): sky, sun, hills and a "license plate" to redact. */
function makeScene(): string {
  const c = document.createElement('canvas');
  c.width = 640;
  c.height = 400;
  const ctx = c.getContext('2d')!;
  const sky = ctx.createLinearGradient(0, 0, 0, 400);
  sky.addColorStop(0, '#7cc6ff');
  sky.addColorStop(1, '#fde2b8');
  ctx.fillStyle = sky;
  ctx.fillRect(0, 0, 640, 400);
  ctx.fillStyle = '#ffd23f';
  ctx.beginPath();
  ctx.arc(500, 90, 45, 0, Math.PI * 2);
  ctx.fill();
  ctx.fillStyle = '#3f8f4f';
  ctx.beginPath();
  ctx.moveTo(0, 300);
  ctx.quadraticCurveTo(160, 180, 320, 290);
  ctx.quadraticCurveTo(480, 200, 640, 280);
  ctx.lineTo(640, 400);
  ctx.lineTo(0, 400);
  ctx.fill();
  ctx.fillStyle = '#ffffff';
  ctx.fillRect(80, 320, 150, 44);
  ctx.fillStyle = '#1b1b1b';
  ctx.font = 'bold 30px monospace';
  ctx.fillText('SAL 404', 92, 352);
  return c.toDataURL('image/png');
}

const START: readonly ImageEditorAnnotation[] = [
  { id: 'note', kind: 'text', x: 40, y: 40, text: 'Golden hour', fontSize: 36, color: '#ffffff', bold: true },
  { id: 'sun', kind: 'ellipse', x: 440, y: 30, width: 120, height: 120, stroke: '#e5484d', strokeWidth: 5 },
  { id: 'plate', kind: 'redact', x: 76, y: 316, width: 158, height: 52, mode: 'pixelate', strength: 10 },
];

export default function ImageEditorDemo() {
  // The image is generated in an effect: render stays identical on the server and the client.
  const [src, setSrc] = useState<string | null>(null);
  const [annotations, setAnnotations] = useState(START);
  const [exported, setExported] = useState<string | null>(null);
  const actions = useRef<ImageEditorActions | null>(null);
  useEffect(() => setSrc(makeScene()), []);
  return (
    <div style={{ display: 'grid', gap: 8 }}>
      <ImageEditor src={src} annotations={annotations} onAnnotationsChange={setAnnotations} actionsRef={actions} style={{ blockSize: 460 }} onSave={(blob) => setExported(`${Math.round(blob.size / 1024)} KB PNG`)} />
      <div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
        <Button
          variant="outline"
          onClick={async () => {
            const blob = await actions.current?.toBlob({ type: 'image/jpeg', quality: 0.85 });
            if (blob) setExported(`${Math.round(blob.size / 1024)} KB JPEG, ${actions.current?.getSize()?.width} × ${actions.current?.getSize()?.height}`);
          }}
        >
          Export JPEG
        </Button>
        <span aria-live="polite">{exported ? `Exported: ${exported}` : `${annotations.length} annotations`}</span>
      </div>
    </div>
  );
}
```

## Opening an image

`src` takes a URL or data URL, a `Blob` or `File`, an `ImageBitmap`,
`ImageData`, an `<img>` or a `<canvas>`. URL sources load with
`crossOrigin="anonymous"` (`crossOrigin` prop) so the canvas stays
exportable. `onLoad({ width, height })` and `onLoadError(error)` report the
result. The `'open'` toolbar item opens a native file picker (`accept`,
default `image/*`); an image opened there, or through
`actionsRef.current.open(source)`, starts a fresh edit: every value resets
and the history is cleared.

## Export

`actionsRef.current.toBlob({ type, quality })`, `toDataURL(options)` and
`toImageData()` render the edit at output size: crop, rotation, flips,
straighten, resize, finetune, filter, annotations, redaction and frame.
`onBeforeExport(event)` runs first with the type, quality and
size; `event.preventDefault()` cancels and the promise resolves `null`. The
download is the application's:

```ts
const blob = await actions.current?.toBlob({ type: 'image/jpeg', quality: 0.85 });
if (blob) {
  const a = Object.assign(document.createElement('a'), { href: URL.createObjectURL(blob), download: 'photo.jpg' });
  a.click();
  URL.revokeObjectURL(a.href);
}
```

With `onSave`, the toolbar shows a `'save'` item that exports a PNG and
passes the Blob to it.

## The edit: transform, adjustments, filter, frame, annotations

| Value | Triad | Content |
| --- | --- | --- |
| Geometry | `transform` / `defaultTransform` / `onTransformChange` | `crop` (`{ x, y, width, height, shape: 'rect' \| 'circle' }`), `rotation` (90-degree steps), `straighten` (-45 to 45), `flip` (`{ horizontal, vertical }`), `resize` (`{ width, height }`), `zoom` |
| Finetune | `adjustments` / `defaultAdjustments` / `onAdjustmentsChange` | `brightness`, `contrast`, `saturation`, `exposure` (-100 to 100), `hue` (degrees), `opacity` (0 to 100), `blur` (pixels) |
| Filter preset | `filter` / `defaultFilter` / `onFilterChange` | `'default'`, `'chrome'`, `'cold'`, `'warm'`, `'grayscale'`, `'sepia'`, `'invert'` |
| Frame | `frame` / `defaultFrame` / `onFrameChange` | `type` (`'none'`, `'mat'`, `'bevel'`, `'line'`, `'inset'`, `'hook'`), `color`, `gradientColor`, `size`, `inset`, `radius` |
| Annotations | `annotations` / `defaultAnnotations` / `onAnnotationsChange` | the array; order is z-order |
| Tool | `tool` / `defaultTool` / `onToolChange` | the active tool |

Each change callback receives `(value, { source, reason })`, where `reason`
names the operation (`'crop'`, `'rotate'`, `'add'`, `'undo'`, ...).
Coordinates of the crop and of every annotation are in the *oriented image*:
source pixels after the 90-degree rotation and the flips, before the crop.
Rotating or flipping from the toolbar moves the crop and the annotations
with the image.

### Crop

The crop tool shows the whole image with a crop frame, rule-of-thirds lines
and eight handles; drag inside to move, outside to draw a new frame. The
panel offers `cropRatios` (default `['free', 'square', 'circle', '3:2',
'4:3', '16:9']`, plus `{ label, ratio }` entries); `'circle'` crops to the
inscribed ellipse with transparent corners. Apply commits the crop (and
clears `resize`); the draft lives outside React until then.

### Rotate, straighten, flip, resize

Rotate left / right turn in 90-degree steps; straighten is a slider from
-45 to 45 degrees that scales the image so no empty corner shows. The flips
mirror the current view. Resize sets the output size; `Keep aspect ratio`
is on by default.

### Zoom and pan

Zoom in / out, `Ctrl` (or `Cmd`) + wheel, trackpad and touch pinch zoom
around the pointer; the pan tool, a drag on an empty area while zoomed, the
middle mouse button and two fingers pan. These run in a
`requestAnimationFrame` loop and commit `transform.zoom` once per gesture
(`minZoom` 1 and `maxZoom` 10 by default; 1 fits the image).

### Finetune and filters

The finetune sliders preview while you drag and commit on release. Both
finetune and presets render through Canvas 2D `ctx.filter`; where a browser
lacks it (Safari before 18) a pixel fallback applies the same CSS filter
math to the image data.

### Frames

Frames draw over the output edges: `mat` and `bevel` fill a band, `line`
strokes a rectangle at `inset`, `inset` combines a band with an inner line,
and `hook` draws corner brackets. `gradientColor` turns the color into a
linear gradient.

## Annotations

| Kind | Fields |
| --- | --- |
| `'rectangle'`, `'ellipse'` | `x`, `y`, `width`, `height`, `stroke`, `fill`, `strokeWidth`, `radius` (rectangle) |
| `'line'`, `'arrow'`, `'path'`, `'freehand'` | `points` (`[x0, y0, x1, y1, ...]`), `stroke`, `strokeWidth`, `fill` and `closed` (path) |
| `'text'` | `x`, `y`, `text`, `fontFamily`, `fontSize`, `color`, `bold`, `italic` |
| `'image'` | `x`, `y`, `width`, `height`, `src` |
| `'redact'` | `x`, `y`, `width`, `height`, `mode` (`'blur'` or `'pixelate'`), `strength` |

Every kind also takes `id`, `rotation` and `opacity`.

- Shapes: drag to draw (Shift keeps a square), a click places a
  default size. The path tool adds a point per click; a double click or
  Enter ends it, Escape drops it.
- Text: click to place a text box; type in the input over the
  canvas and press Enter (Shift+Enter for a new line, Escape keeps the old
  text). Double click or Enter on a selected text edits it; an empty text
  removes the annotation.
- Freehand: the stroke records every coalesced pointer sample
  outside React and commits once on release.
- Image: the `'image'` item picks a file and places it centered
  (at most half the shorter side); `src` may also be any URL.
- Redaction: a blur or pixelate region burned into the pixels
  below it, on screen and in every export.

### Selection and z-order

Click an annotation to select it: drag to move, drag a handle to resize
(Shift locks the ratio), drag the round knob to rotate (Shift snaps to 15
degrees). The quick-access toolbar next to the selection offers Edit text,
Duplicate, Bring forward, Send backward, Bring to front, Send to back and
Delete (`quickAccessToolbar` lists the items; `false` hides it). In the
crop tool it shows Apply crop and Cancel crop. Z-order is array order, so
the reorder items reorder `annotations` through `onAnnotationsChange`.
`annotationDefaults` sets the stroke, fill, width and font of new shapes;
the panel of a shape tool or selection changes them.

## History

Every committed edit (not zoom or pan) is an undo step: toolbar `'undo'`,
`'redo'`, `'reset'`, `Mod+Z`, `Mod+Shift+Z` and `Mod+Y`, or
`actionsRef.current.undo()` / `redo()` / `reset()`. Reset returns to the
values the editor started with (and is itself undoable). `undoLimit`
(default 50) caps the steps; repeated keyboard nudges of one annotation
merge into one step. `onHistoryChange({ canUndo, canRedo, undoCount,
redoCount })` reports the state.

## Toolbar

`toolbar` lists items: built-in ids, `'|'` separators and custom items
`{ id, label, icon?, disabled?, onClick(actions) }`; `false` hides the bar,
`renderToolbar(defaultToolbar, actions)` wraps or replaces it.
`onToolbarItemClick({ id, source, preventDefault })` runs first and can
cancel the built-in action. The bar is the Salmon `Toolbar`: one tab stop,
arrow keys, and an overflow menu when the container is narrow.

## Events

Before / after pairs: `onBeforeCrop` / `onCrop`, `onBeforeRotate` /
`onRotate` (90-degree steps and straighten), `onBeforeFlip` / `onFlip`,
`onBeforeResize` / `onResize`, `onBeforeZoom` / `onZoom`, `onBeforePan` /
`onPan`, `onBeforeAnnotationChange` / `onAnnotationChange` (with `action`:
`'add'`, `'update'`, `'delete'`, `'clone'`, `'reorder'`), `onBeforeFilter` /
`onFilter`, `onBeforeAdjust` / `onAdjust`, `onBeforeFrame` / `onFrame`,
`onBeforeSelect` / `onSelect`. Each receives `{ operation, previous, value,
source }`; `event.preventDefault()` in a before-callback cancels the
operation. `onEditComplete({ operation, source, state })` follows every
committed edit, undo, redo and reset.

## Keyboard and accessibility

The canvas is `role="img"` with `aria-label` (`localeText.canvas`) and a
visually hidden description of its keys; committed operations are announced
in a polite live region (`localeText.announce(operation, detail)`).

| Key (canvas focused) | Action |
| --- | --- |
| `Enter` on a drawing tool item | Inserts the tool's annotation at the center and selects it |
| `]` / `[` | Select the next / previous annotation |
| Arrows (Shift: 10 px) | Move the selection, or the crop frame in the crop tool |
| `Alt` + arrows | Resize the selection or the crop frame |
| `R` / `Shift+R` | Rotate the selection by 15 degrees |
| `Mod+D`, `Delete` | Duplicate, delete |
| `Mod+]` / `Mod+[` (with Shift: to front / back) | Z-order |
| `Enter` | Edit the selected text; apply the crop |
| `Escape` | Cancel a gesture or path, deselect, leave the crop tool |
| `+` / `-` / `0` | Zoom in / out / fit; arrows pan when zoomed and nothing is selected |

## Mobile

Below the container width the toolbar moves items into its overflow menu.
Touch pinch zooms, two fingers pan, and on coarse pointers the handles and
toolbar buttons grow to touch size.

## Image smoothing

`imageSmoothing` (default `true`) sets `ctx.imageSmoothingEnabled` on the
view and on every export: set it to `false` for pixel art so upscaling keeps
hard edges.

### Live demo: Image editor, controlled

Live demo: https://salmonui.dev/demos/editors/image-editor-controlled

A controlled ImageEditor - resize and zoom from outside, frames, freehand drawing, image stickers from a custom toolbar item, a trimmed quick-access toolbar, image smoothing, a phone-width toolbar overflow, right to left with localized labels, and the before/after events.

`Demo.tsx`:

```tsx
'use client';

import { useEffect, useRef, useState } from 'react';
import { Button } from '@salmonui/buttons/button';
import { Checkbox } from '@salmonui/inputs/checkbox';
import { NumberField } from '@salmonui/inputs/number-field';
import { Select } from '@salmonui/dropdowns/select';
import { Slider } from '@salmonui/inputs/slider';
import {
  ImageEditor,
  type ImageEditorActions,
  type ImageEditorAnnotation,
  type ImageEditorFrame,
  type ImageEditorFrameType,
  type ImageEditorToolbarItem,
  type ImageEditorTransform,
} from '@salmonui/editors/image-editor';
import { EventLog, useEventLog } from '../../components/demo-kit';

/** A small generated photo (no network image) with pixel-art detail, so image smoothing is visible when zoomed. */
function makePhoto(): string {
  const c = document.createElement('canvas');
  c.width = 320;
  c.height = 200;
  const ctx = c.getContext('2d')!;
  ctx.fillStyle = '#9fd3f5';
  ctx.fillRect(0, 0, 320, 200);
  for (let y = 0; y < 8; y++) for (let x = 0; x < 16; x++) {
    ctx.fillStyle = (x + y) % 2 ? '#3f8f4f' : '#5fb06c';
    ctx.fillRect(x * 20, 120 + y * 10, 20, 10);
  }
  ctx.fillStyle = '#f2b134';
  ctx.fillRect(240, 24, 40, 40);
  return c.toDataURL('image/png');
}

/** A sticker for the image annotation. */
function makeSticker(): string {
  const c = document.createElement('canvas');
  c.width = 64;
  c.height = 64;
  const ctx = c.getContext('2d')!;
  ctx.fillStyle = '#e5484d';
  ctx.beginPath();
  ctx.arc(32, 32, 30, 0, Math.PI * 2);
  ctx.fill();
  ctx.fillStyle = '#ffffff';
  ctx.font = 'bold 22px sans-serif';
  ctx.textAlign = 'center';
  ctx.fillText('NEW', 32, 40);
  return c.toDataURL('image/png');
}

const FRAMES: readonly ImageEditorFrameType[] = ['none', 'mat', 'bevel', 'line', 'inset', 'hook'];

const AR_TEXT = { toolbar: 'أدوات الصورة', undo: 'تراجع', redo: 'إعادة', zoomIn: 'تكبير', zoomOut: 'تصغير', resize: 'تغيير الحجم', frame: 'إطار', freehand: 'رسم حر', select: 'تحديد', pan: 'تحريك' };

export default function ImageEditorControlledDemo() {
  const [log, push] = useEventLog();
  const [src, setSrc] = useState<string | null>(null);
  const [sticker, setSticker] = useState<string | null>(null);
  const [transform, setTransform] = useState<ImageEditorTransform>({ zoom: 1 });
  const [frame, setFrame] = useState<ImageEditorFrame>({ type: 'mat', color: '#ffffff', size: 16 });
  const [annotations, setAnnotations] = useState<readonly ImageEditorAnnotation[]>([]);
  const [smoothing, setSmoothing] = useState(true);
  const [narrow, setNarrow] = useState(false);
  const [rtl, setRtl] = useState(false);
  const [width, setWidth] = useState(320);
  const actions = useRef<ImageEditorActions | null>(null);
  // Canvas images are generated in an effect: the server and the first client render match.
  useEffect(() => {
    setSrc(makePhoto());
    setSticker(makeSticker());
  }, []);

  const toolbar: readonly ImageEditorToolbarItem[] = [
    'select',
    'pan',
    'zoomIn',
    'zoomOut',
    '|',
    'crop',
    'rotateLeft',
    'rotateRight',
    'resize',
    'frame',
    '|',
    'rectangle',
    'text',
    'freehand',
    'image',
    '|',
    'undo',
    'redo',
    {
      id: 'sticker',
      label: 'Add sticker',
      icon: <span aria-hidden="true">★</span>,
      disabled: !sticker,
      onClick: () => {
        if (!sticker) return;
        const id = `sticker-${annotations.length + 1}`;
        setAnnotations((list) => [...list, { id, kind: 'image', x: 24 + list.length * 16, y: 24, width: 64, height: 64, src: sticker, opacity: 0.95 }]);
        actions.current?.select(id);
      },
    },
  ];

  const height = transform.resize?.height ?? 200;
  return (
    <div style={{ display: 'grid', gridTemplateColumns: 'minmax(0, 1fr)', gap: 10 }}>
      <div role="group" aria-label="Edit state" style={{ display: 'flex', flexWrap: 'wrap', gap: 12, alignItems: 'center' }}>
        <label style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
          Width
          <NumberField aria-label="Width" min={80} max={1280} step={20} value={width} onValueChange={(value) => setWidth(value ?? 320)} style={{ inlineSize: 120 }} />
        </label>
        <Button variant="outline" onClick={() => setTransform((t) => ({ ...t, resize: { width, height: Math.round((width * 200) / 320) } }))}>
          Resize (keep 16:10)
        </Button>
        <label style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
          Zoom
          <Slider min={0.5} max={4} step={0.25} value={transform.zoom ?? 1} onValueChange={(value) => setTransform((t) => ({ ...t, zoom: value }))} style={{ inlineSize: 160 }} />
        </label>
        <label style={{ display: 'flex', gap: 6, alignItems: 'center' }}>
          Frame
          <Select aria-label="Frame" data={FRAMES} value={frame.type} onValueChange={(value) => value != null && setFrame((f) => ({ ...f, type: value as ImageEditorFrameType }))} />
        </label>
        <Checkbox checked={smoothing} onCheckedChange={(checked) => setSmoothing(checked)}>
          imageSmoothing
        </Checkbox>
        <Checkbox checked={narrow} onCheckedChange={(checked) => setNarrow(checked)}>
          Phone width (360 px)
        </Checkbox>
        <Checkbox checked={rtl} onCheckedChange={(checked) => setRtl(checked)}>
          Right to left
        </Checkbox>
      </div>
      <div dir={rtl ? 'rtl' : 'ltr'} lang={rtl ? 'ar' : 'en'} style={{ inlineSize: narrow ? 360 : '100%', maxInlineSize: '100%' }}>
        <ImageEditor
          aria-label="Photo editor"
          src={src}
          actionsRef={actions}
          transform={transform}
          onTransformChange={(next, event) => {
            setTransform(next);
            if (next.resize) setWidth(next.resize.width);
            push(`onTransformChange (${event.reason}, ${event.source})`);
          }}
          frame={frame}
          onFrameChange={(next) => setFrame(next)}
          annotations={annotations}
          onAnnotationsChange={(next, event) => {
            setAnnotations(next);
            push(`onAnnotationsChange (${event.reason}, ${event.source})`);
          }}
          annotationDefaults={{ stroke: '#e5484d', strokeWidth: 4 }}
          imageSmoothing={smoothing}
          minZoom={0.5}
          maxZoom={4}
          toolbar={toolbar}
          quickAccessToolbar={['clone', 'delete', 'bringToFront', 'sendToBack', 'applyCrop', 'cancelCrop']}
          onToolbarItemClick={(event) => push(`onToolbarItemClick: ${event.id} (${event.source})`)}
          onBeforeResize={(event) => {
            if (event.value && event.value.width > 1280) {
              event.preventDefault();
              push('onBeforeResize: wider than 1280 px, cancelled');
            }
          }}
          onResize={(event) => push(`onResize: ${event.value ? `${event.value.width} × ${event.value.height}` : 'original size'}`)}
          onZoom={(event) => push(`onZoom: ${Math.round(event.previous * 100)}% -> ${Math.round(event.value * 100)}% (${event.source})`)}
          onPan={(event) => push(`onPan: ${Math.round(event.value.x)}, ${Math.round(event.value.y)} (${event.source})`)}
          onFrame={(event) => push(`onFrame: ${event.previous.type} -> ${event.value.type}`)}
          onSelect={(event) => push(`onSelect: ${event.value ?? 'none'} (${event.source})`)}
          onEditComplete={(event) => push(`onEditComplete: ${event.operation}`)}
          onHistoryChange={(history) => push(`onHistoryChange: ${history.undoCount} undo / ${history.redoCount} redo`)}
          localeText={rtl ? AR_TEXT : undefined}
          style={{ blockSize: 420 }}
          styles={{ stage: { background: 'repeating-conic-gradient(#0000000d 0 25%, transparent 0 50%) 0 0 / 16px 16px' } }}
        />
      </div>
      <p style={{ margin: 0 }} aria-live="polite">
        Output {transform.resize ? `${transform.resize.width} × ${height}` : '320 × 200 (original)'}, zoom {Math.round((transform.zoom ?? 1) * 100)}%, frame {frame.type}, {annotations.length} annotations.
      </p>
      <EventLog entries={log} />
    </div>
  );
}
```

## Common props, RTL and SSR

`localeText` replaces every string (`IMAGE_EDITOR_DEFAULT_LOCALE_TEXT`),
`className` / `style` reach the root and `classNames` / `styles` the parts
(`toolbar`, `panel`, `stage`, `canvas`, `quickToolbar`); size the editor
with CSS `width` and `height` (default height 480 px). Direction comes from
the inherited `dir`: the toolbar and panels mirror. Colors follow the theme
seeds. On the server the editor renders a stable shell (toolbar, canvas,
status) and reads no browser global; the image loads after hydration.
There is no built-in persistence: components never write to
`localStorage` on their own, because hidden persistence breaks server
rendering consistency. Persist what `onTransformChange`,
`onAdjustmentsChange`, `onFilterChange`, `onFrameChange` and
`onAnnotationsChange` report and pass it back as the controlled props.

## Bundle

The initial chunk (editor shell, render engine, toolbar items) stays under
12 KB gzip without React and the composed Button / Toolbar / Menu; the
interaction layer, edit operations, panels, annotation drawing, frames and
the pixel fallback load as separate chunks.

## API reference

[`@salmonui/editors/image-editor`](https://salmonui.dev/docs/reference/editors/image-editor) lists
every prop, callback, annotation type and `ImageEditorActions` method.
