for Angular 22 · built on Fabric.js v7

Integration & API

Use the editor as a modal, drive it headlessly, listen to its events, and reference the full input/output surface.

Modal dialog

For avatar / quick-edit flows, inject AspImageEditorDialog and await a Blob (or null on cancel). Opens the basic editor as a modal.

import { inject } from '@angular/core';
import { AspImageEditorDialog } from '@ascentsparksoftware/angular-image-editor';

private readonly editor = inject(AspImageEditorDialog);

async edit(src: string): Promise<void> {
  const blob = await this.editor.open({
    src,
    heading: 'Update profile photo',
    aspectPresets: ['1:1', '4:3', 'free'],
  });
  if (blob) { /* user saved — upload blob */ }
}

Headless engine

The Fabric-backed EditorEngine and the pure helpers are exported for headless or advanced use — scene save/load, layers, guides, artboard, and the AI/magic operations directly.

Also exported: resolveTools, resolveFilters, deriveTheme, applyTheme, EditHistory and DeltaHistory.

import { EditorEngine, deriveTheme } from '@ascentsparksoftware/angular-image-editor';

// derive the full --asp-* token map from three inputs
const tokens = deriveTheme('#f4f6f9', '#1f6feb', 'light');

Events

Outputs you can bind on the component.

OutputPayloadFires
savedBlobExport / Save
canceledvoidBasic-mode Cancel
imageLoadedvoidAn image finished loading
exportedBlobExport download produced a Blob
errorOccurredAspEditorErrorRecoverable load/export/init error

API reference

The AspImageEditor component inputs.

InputTypeDefault
srcstring | Blob | nullnull
modeAspMode'advanced'
width / heightAspSize | nullnull
toolsAspTool[] | nullnull
disabledToolsAspTool[][]
filtersAspFilter[] | 'all' | nullnull
aspectPresetsAspAspectPreset[]['free','1:1','4:3','16:9']
aspectRatiosAspAspectOption[][]
exportFormatsAspExportFormat[]['png','jpeg','webp']
exportQualitynumber90
headingstring'Edit image'
showHistorybooleantrue
keyboardEnabledbooleantrue
fontsFontOption[]DEFAULT_FONTS
baseColorstring'#f4f6f9'
accentColorstring'#1f6feb'
themeMode'light' | 'dark''light'

Accessibility

WCAG AA color contrast (derivation-guaranteed), keyboard-operable controls, :focus-visible rings, prefers-reduced-motion honored, and Trusted-Types-safe icon rendering.

Security

The editor renders consumer-supplied images and SVGs onto a canvas; SVGs are rasterized through a sandboxed <img>, so scripts inside an SVG do not execute. Validate uploads at your boundary; the optional AI model is fetched at runtime but no image data leaves the browser.

Full policy and private reporting: SECURITY.md.