Implementing Syncfusion TypeScript Image Editor
A comprehensive skill for implementing the Syncfusion Image Editor control in TypeScript applications. This skill covers initialization, image loading/saving, annotation tools, image manipulation (zoom, crop, rotate, transform), filtering, fine-tuning, accessibility, and customization patterns.
Overview
The Syncfusion Image Editor is a powerful, feature-rich component for professional image editing in web applications. Key capabilities include:
- Image Operations - Open, save, export in JPEG, PNG, SVG, WebP, BMP formats
- Zoom & Pan - Multiple zoom methods (toolbar, mouse wheel, pinch, keyboard)
- Transformations - Crop, rotate, flip, straighten, resize with preview
- Annotations - Text, freehand drawing, shapes (rectangles, circles, arrows, lines), redaction, frames
- Filters & Effects - 20+ filter effects plus fine-tuning controls
- Layer Management - Z-order operations, multiple annotations
- History - Full undo/redo support with action tracking
- Accessibility - WCAG 2.2 compliant, keyboard navigation, screen reader support
- Customization - Toolbar, themes, event handlers, quick access
- TypeScript Support - Full type definitions and webpack configuration
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- TypeScript project setup with webpack
- NPM package installation (@syncfusion/ej2-image-editor)
- Dependency management
- CSS theme imports and configuration
- Basic component initialization
- HTML markup setup
Core Operations
📄 Read: references/core-operations.md
- Opening and loading images programmatically
- Supported file formats (JPEG, PNG, SVG, WebP, BMP)
- Saving and exporting images
- File input validation and restrictions
- File type constraints and size limits
- Download vs. save operations
Image Manipulation
📄 Read: references/image-manipulation.md
- Zooming methods (toolbar, mouse wheel, pinch, keyboard, fit-to-width/height)
- Panning and image movement
- Image resizing and scaling operations
- Image rotation and flip operations
- Straightening with sliders
- Image dimension queries
- Canvas and viewport management
Annotation Tools
📄 Read: references/annotation-tools.md
- Text annotations with font customization (family, size, style, color)
- Freehand drawing tools and brush settings
- Shape annotations (rectangles, ellipses, arrows, lines, paths)
- Redaction capabilities and masking
- Frame insertion and styling
- Annotation styling (fill color, stroke color, stroke width)
- Annotation positioning and transformation
Selection and Cropping
📄 Read: references/selection-cropping.md
- Selection types (custom, circle, square, ratio-based)
- Cropping workflow and execution
- Aspect ratio constraints and custom ratios
- Selection manipulation and repositioning
- Crop finalization and preview
- Region management
Filters and Effects
📄 Read: references/filters-effects.md
- Applying filter effects programmatically
- Fine-tuning adjustments (20+ effect types)
- Brightness, contrast, saturation controls
- Blur, sharpen, hue, saturation effects
- Image processing capabilities
- Effect preview and application
Undo and Redo
📄 Read: references/undo-redo.md
- Undo/redo keyboard shortcuts (Ctrl+Z, Ctrl+Y)
- Undo/redo method calls
- Operation history tracking
- History state management
- Action reversal patterns
Layer Management
📄 Read: references/layer-management.md
- Z-order operations and layer stacking
- Bringing layers forward/backward
- Layer arrangement and management
- Working with multiple annotations
- Overlap management
Accessibility
📄 Read: references/accessibility.md
- Complete keyboard shortcut reference (Ctrl+Z, Ctrl+Y, Ctrl+S, Delete, Escape, etc.)
- WCAG 2.2, Section 508, ADA compliance
- Screen reader support and ARIA attributes
- Right-to-Left (RTL) support
- Keyboard navigation patterns
- Color contrast and accessibility best practices
- Mobile device support
Customization
📄 Read: references/customization.md
- Toolbar configuration and customization
- Quick access toolbar setup
- Theme styling and CSS customization
- Theme Studio integration
- CSS variables and custom themes
- Event binding and callbacks
- Configuration options reference
Localization
📄 Read: references/localization.md
- Multi-language support setup
- Language-specific configurations
- Locale settings and resource strings
- RTL (Right-to-Left) support configuration
- Region-specific customizations
How-To Guide
📄 Read: references/how-to-guide.md
- Rendering image editor in dialog/modal windows
- Clearing image before reopening dialogs
- Resetting images to original state
- Fitting images to editor width or height
- Dialog state management
- Common integration patterns
Advanced Patterns
📄 Read: references/advanced-patterns.md
- Event handling patterns and event system
- Custom workflow examples
- Complex integration scenarios
- Performance optimization tips
- TypeScript type definitions and interfaces
- Memory management
API Reference
📄 Read: references/api.md
- Complete list of all public properties with types and defaults
- Full method signatures with parameter descriptions and return types
- All events with their event-arg interfaces
- Key model interfaces (ZoomSettingsModel, FinetuneSettingsModel, SelectionSettingsModel, UploadSettingsModel)
- Key event-arg interfaces (ShapeSettings, RedactSettings, ShapeChangeEventArgs, EditCompleteEventArgs, etc.)
- Quick usage examples for initialization, crop, drawText, finetuneImage
Quick Start
Installation
npm install @syncfusion/ej2-image-editor
Security: After installing, run npm audit or verify the package via Socket.dev to confirm the supply-chain integrity of @syncfusion/ej2-image-editor before deploying to production.
Basic Initialization
import { ImageEditor } from '@syncfusion/ej2-image-editor';
// Create a new instance
const imageEditor = new ImageEditor({
width: '550px',
height: '330px',
toolbar: ['Open', 'Save', 'ZoomIn', 'ZoomOut', 'Crop', 'Rotate', 'Flip']
});
// Append to a container
imageEditor.appendTo('#imageeditor');
// Open an image — replace with a validated, trusted URL; never use URLs from third-party responses directly
imageEditor.open('url');
HTML Setup
<div id="imageeditor"></div>
CSS Themes
@import "@syncfusion/ej2-image-editor/styles/material.css";
Common Patterns
Pattern 1: Basic Image Editor with Full Toolbar
import { ImageEditor } from '@syncfusion/ej2-image-editor';
const imageEditor = new ImageEditor({
width: '600px',
height: '400px',
toolbar: ['Open', 'Save', 'ZoomIn', 'ZoomOut', 'Crop',
'Rotate', 'Flip', 'Undo', 'Redo', 'Reset'],
created: () => {
// Replace 'url' with a validated, trusted image URL or local asset path
imageEditor.open('url');
}
});
imageEditor.appendTo('#imageeditor');
Pattern 2: Adding Text Annotation
const dimension = imageEditor.getImageDimension();
imageEditor.drawText(
dimension.x + 50,
dimension.y + 50,
'Annotation Text',
'Arial', // font family
30, // font size
false, // bold
false, // italic
'blue', // text color
false, // selected
null, // rotation
'#FFFFCC', // fill color
'black' // stroke color
);
Pattern 3: Applying Filters
import { ImageEditor, ImageFilterOption } from '@syncfusion/ej2-image-editor';
// Apply brightness adjustment
imageEditor.finetuneImage('brightness', 30);
// Apply blur filter
imageEditor.applyImageFilter(ImageFilterOption.Blur);
// Apply multiple fine-tune effects
imageEditor.finetuneImage('contrast', 20);
imageEditor.finetuneImage('saturation', 15);
Pattern 4: Cropping an Image
const dimension = imageEditor.getImageDimension();
// Step 1: Programmatically select a crop region
imageEditor.select('Custom', dimension.x, dimension.y, 500, 300);
// Step 2: Apply the crop
imageEditor.crop();
Pattern 5: Dialog Integration
import { Dialog } from '@syncfusion/ej2-popups';
const dialog = new Dialog({
width: '600px',
height: '450px',
isModal: true,
visible: false
});
dialog.appendTo('#dialog');
const imageEditor = new ImageEditor({
width: '100%',
height: '100%'
});
imageEditor.appendTo('#imageeditor');
document.getElementById('openBtn').onclick = () => {
dialog.show();
// Replace 'url' with a validated, trusted image URL
imageEditor.open('url');
};
Key APIs
Essential Methods
| Method |
Purpose |
open(fileOrUrl) |
Load an image from URL, File, or ImageData — always validate or sanitize URL inputs against a trusted allowlist in production; never pass URLs derived from third-party content to prevent SSRF and indirect injection |
export(type?, fileName?, imageQuality?) |
Export/download image in specified format |
crop() |
Execute crop based on current selection |
select(type, startX?, startY?, width?, height?) |
Set crop selection area |
rotate(degree) |
Rotate image (positive = clockwise, negative = anti-clockwise) |
flip(direction) |
Flip image horizontally or vertically |
zoom(zoomFactor, zoomPoint?) |
Zoom in/out to a factor and optional point |
pan(value, x?, y?) |
Enable/disable panning or pan to x/y |
resize(width, height, isAspectRatio?) |
Resize image dimensions |
straightenImage(degree) |
Straighten image by small rotation angle |
drawText(x?, y?, text?, ...) |
Add text annotation |
drawRectangle(x?, y?, width?, height?, ...) |
Draw rectangle annotation |
drawEllipse(x?, y?, radiusX?, radiusY?, ...) |
Draw ellipse annotation |
drawArrow(startX?, startY?, endX?, endY?, ...) |
Draw arrow annotation |
drawLine(startX?, startY?, endX?, endY?, ...) |
Draw line annotation |
drawPath(pointColl, ...) |
Draw path/freehand annotation |
drawImage(data, x?, y?, width?, height?, ...) |
Draw image annotation |
drawFrame(frameType, ...) |
Draw decorative frame around image |
drawRedact(type?, x?, y?, width?, height?, value?) |
Draw blur/pixelate redaction |
freehandDraw(value) |
Enable/disable freehand drawing mode |
applyImageFilter(filterOption) |
Apply a predefined image filter |
finetuneImage(finetuneOption, value) |
Apply fine-tuning adjustment |
getShapeSettings() |
Get all drawn shapes |
getShapeSetting(id) |
Get single shape by id |
selectShape(id) |
Select a shape by id |
updateShape(setting, isSelected?) |
Update an existing shape |
deleteShape(id) |
Delete a shape by id |
cloneShape(shapeId) |
Duplicate a shape by id |
bringToFront(shapeId) |
Move shape to front |
sendToBack(shapeId) |
Move shape to back |
bringForward(shapeId) |
Move shape forward one position |
sendBackward(shapeId) |
Move shape backward one position |
getRedacts() |
Get all redaction shapes |
selectRedact(id) |
Select a redaction by id |
updateRedact(setting, isSelected?) |
Update a redaction |
deleteRedact(id) |
Delete a redaction by id |
undo() |
Undo last action |
redo() |
Redo last undone action |
canUndo() |
Returns true if undo is available |
canRedo() |
Returns true if redo is available |
reset() |
Reset image to original state |
clearImage() |
Clear the loaded image |
clearSelection(resetCrop?) |
Clear current selection |
getImageDimension() |
Get current image x, y, width, height |
getImageData() |
Get canvas image as ImageData |
apply() |
Apply pending annotation drawings |
discard() |
Discard unapplied annotation changes |
enableShapeDrawing(shapeType, isEnabled?) |
Enable/disable shape drawing |
enableTextEditing() |
Enter text-edit mode on a text annotation |
Key Properties
| Property |
Type |
Default |
Purpose |
width |
string |
'100%' |
Editor container width |
height |
string |
'100%' |
Editor container height |
toolbar |
(string | ItemModel)[] |
null |
Toolbar items; null = default toolbar, [] = no toolbar |
toolbarTemplate |
string | Function |
null |
Fully custom toolbar template (overrides toolbar) |
quickAccessToolbarTemplate |
string | Function |
null |
Template for quick access toolbar |
showQuickAccessToolbar |
boolean |
true |
Show/hide quick access toolbar |
theme |
string | Theme |
Theme.Bootstrap5 |
UI appearance theme |
allowUndoRedo |
boolean |
true |
Enable undo/redo operations |
disabled |
boolean |
false |
Disable the component |
cssClass |
string |
'' |
Custom CSS classes for styling |
imageSmoothingEnabled |
boolean |
false |
Enable high-quality image smoothing |
locale |
string |
'' |
Locale override for localization |
zoomSettings |
ZoomSettingsModel |
null |
Zoom configuration (min, max, factor, trigger, point) |
finetuneSettings |
FinetuneSettingsModel |
— |
Fine-tune controls configuration (brightness, contrast, etc.) |
selectionSettings |
SelectionSettingsModel |
null |
Selection/crop appearance (fill, stroke, showCircle) |
uploadSettings |
UploadSettingsModel |
— |
File upload constraints (extensions, min/max size) |
fontFamily |
FontFamilyModel[] |
— |
Custom font families in text annotation dropdown |
Events
| Event |
Args Interface |
When Triggered |
created |
Event |
After component is rendered |
destroyed |
Event |
After component is destroyed |
fileOpened |
OpenEventArgs |
After an image is opened |
beforeSave |
BeforeSaveEventArgs |
Before image is saved/exported |
saved |
SaveEventArgs |
After image is saved/exported |
editComplete |
EditCompleteEventArgs |
After any edit action completes |
cropping |
CropEventArgs |
While crop is in progress |
rotating |
RotateEventArgs |
While rotation is in progress |
flipping |
FlipEventArgs |
While flip is in progress |
resizing |
ResizeEventArgs |
While resize is in progress |
zooming |
ZoomEventArgs |
While zoom is in progress |
panning |
PanEventArgs |
While pan is in progress |
selectionChanging |
SelectionChangeEventArgs |
While crop selection changes |
shapeChanging |
ShapeChangeEventArgs |
While a shape is being changed |
shapeChange |
ShapeChangeEventArgs |
After a shape change completes |
imageFiltering |
ImageFilterEventArgs |
When a filter is applied |
finetuneValueChanging |
FinetuneEventArgs |
While a fine-tune value changes |
frameChange |
FrameChangeEventArgs |
While a frame is applied |
toolbarCreated |
ToolbarEventArgs |
After toolbar is created |
toolbarUpdating |
ToolbarEventArgs |
While toolbar is refreshed |
toolbarItemClicked |
ClickEventArgs |
On toolbar item click |
quickAccessToolbarOpen |
QuickAccessToolbarEventArgs |
When quick access toolbar opens |
quickAccessToolbarItemClick |
ClickEventArgs |
On quick access toolbar item click |
click |
ImageEditorClickEventArgs |
On click inside editor canvas |
Common Use Cases
Professional Image Editing Suite - Full-featured editor with all tools
Annotation Workflow - Markup and redaction for documents
Quick Crop Tool - Simplified UI focused on cropping
Social Media Tool - Preset aspect ratios for platforms
Screenshot Markup - Quick annotation on screenshots
Document Processing - Straighten, crop, and export scans
Dialog Integration - Modal image editing workflows
Related Skills
implementing-rich-text-editor - For text document editing
implementing-buttons - For control customization
implementing-dialogs - For modal workflow integration
1---2name: syncfusion-javascript-image-editor3description: Implement the Syncfusion TypeScript Image Editor control for image editing, annotation, and manipulation. Use this when the user needs to add image editing capabilities, work with filters, transformations, cropping, or drawing features in TypeScript applications. Covers setup, image operations, annotations, filters, accessibility, and customization patterns.4---56# Implementing Syncfusion TypeScript Image Editor78A comprehensive skill for implementing the Syncfusion Image Editor control in TypeScript applications. This skill covers initialization, image loading/saving, annotation tools, image manipulation (zoom, crop, rotate, transform), filtering, fine-tuning, accessibility, and customization patterns.910## Overview1112The Syncfusion Image Editor is a powerful, feature-rich component for professional image editing in web applications. Key capabilities include:1314- **Image Operations** - Open, save, export in JPEG, PNG, SVG, WebP, BMP formats15- **Zoom & Pan** - Multiple zoom methods (toolbar, mouse wheel, pinch, keyboard)16- **Transformations** - Crop, rotate, flip, straighten, resize with preview17- **Annotations** - Text, freehand drawing, shapes (rectangles, circles, arrows, lines), redaction, frames18- **Filters & Effects** - 20+ filter effects plus fine-tuning controls19- **Layer Management** - Z-order operations, multiple annotations20- **History** - Full undo/redo support with action tracking21- **Accessibility** - WCAG 2.2 compliant, keyboard navigation, screen reader support22- **Customization** - Toolbar, themes, event handlers, quick access23- **TypeScript Support** - Full type definitions and webpack configuration2425## Documentation and Navigation Guide2627### Getting Started28📄 **Read:** [references/getting-started.md](references/getting-started.md)29- TypeScript project setup with webpack30- NPM package installation (@syncfusion/ej2-image-editor)31- Dependency management32- CSS theme imports and configuration33- Basic component initialization34- HTML markup setup3536### Core Operations37📄 **Read:** [references/core-operations.md](references/core-operations.md)38- Opening and loading images programmatically39- Supported file formats (JPEG, PNG, SVG, WebP, BMP)40- Saving and exporting images41- File input validation and restrictions42- File type constraints and size limits43- Download vs. save operations4445### Image Manipulation46📄 **Read:** [references/image-manipulation.md](references/image-manipulation.md)47- Zooming methods (toolbar, mouse wheel, pinch, keyboard, fit-to-width/height)48- Panning and image movement49- Image resizing and scaling operations50- Image rotation and flip operations51- Straightening with sliders52- Image dimension queries53- Canvas and viewport management5455### Annotation Tools56📄 **Read:** [references/annotation-tools.md](references/annotation-tools.md)57- Text annotations with font customization (family, size, style, color)58- Freehand drawing tools and brush settings59- Shape annotations (rectangles, ellipses, arrows, lines, paths)60- Redaction capabilities and masking61- Frame insertion and styling62- Annotation styling (fill color, stroke color, stroke width)63- Annotation positioning and transformation6465### Selection and Cropping66📄 **Read:** [references/selection-cropping.md](references/selection-cropping.md)67- Selection types (custom, circle, square, ratio-based)68- Cropping workflow and execution69- Aspect ratio constraints and custom ratios70- Selection manipulation and repositioning71- Crop finalization and preview72- Region management7374### Filters and Effects75📄 **Read:** [references/filters-effects.md](references/filters-effects.md)76- Applying filter effects programmatically77- Fine-tuning adjustments (20+ effect types)78- Brightness, contrast, saturation controls79- Blur, sharpen, hue, saturation effects80- Image processing capabilities81- Effect preview and application8283### Undo and Redo84📄 **Read:** [references/undo-redo.md](references/undo-redo.md)85- Undo/redo keyboard shortcuts (Ctrl+Z, Ctrl+Y)86- Undo/redo method calls87- Operation history tracking88- History state management89- Action reversal patterns9091### Layer Management92📄 **Read:** [references/layer-management.md](references/layer-management.md)93- Z-order operations and layer stacking94- Bringing layers forward/backward95- Layer arrangement and management96- Working with multiple annotations97- Overlap management9899### Accessibility100📄 **Read:** [references/accessibility.md](references/accessibility.md)101- Complete keyboard shortcut reference (Ctrl+Z, Ctrl+Y, Ctrl+S, Delete, Escape, etc.)102- WCAG 2.2, Section 508, ADA compliance103- Screen reader support and ARIA attributes104- Right-to-Left (RTL) support105- Keyboard navigation patterns106- Color contrast and accessibility best practices107- Mobile device support108109### Customization110📄 **Read:** [references/customization.md](references/customization.md)111- Toolbar configuration and customization112- Quick access toolbar setup113- Theme styling and CSS customization114- Theme Studio integration115- CSS variables and custom themes116- Event binding and callbacks117- Configuration options reference118119### Localization120📄 **Read:** [references/localization.md](references/localization.md)121- Multi-language support setup122- Language-specific configurations123- Locale settings and resource strings124- RTL (Right-to-Left) support configuration125- Region-specific customizations126127### How-To Guide128📄 **Read:** [references/how-to-guide.md](references/how-to-guide.md)129- Rendering image editor in dialog/modal windows130- Clearing image before reopening dialogs131- Resetting images to original state132- Fitting images to editor width or height133- Dialog state management134- Common integration patterns135136### Advanced Patterns137📄 **Read:** [references/advanced-patterns.md](references/advanced-patterns.md)138- Event handling patterns and event system139- Custom workflow examples140- Complex integration scenarios141- Performance optimization tips142- TypeScript type definitions and interfaces143- Memory management144145### API Reference146📄 **Read:** [references/api.md](references/api.md)147- Complete list of all public properties with types and defaults148- Full method signatures with parameter descriptions and return types149- All events with their event-arg interfaces150- Key model interfaces (ZoomSettingsModel, FinetuneSettingsModel, SelectionSettingsModel, UploadSettingsModel)151- Key event-arg interfaces (ShapeSettings, RedactSettings, ShapeChangeEventArgs, EditCompleteEventArgs, etc.)152- Quick usage examples for initialization, crop, drawText, finetuneImage153154## Quick Start155156### Installation157158```bash159npm install @syncfusion/ej2-image-editor160```161162> **Security:** After installing, run `npm audit` or verify the package via [Socket.dev](https://socket.dev) to confirm the supply-chain integrity of `@syncfusion/ej2-image-editor` before deploying to production.163164### Basic Initialization165166```typescript167import { ImageEditor } from '@syncfusion/ej2-image-editor';168169// Create a new instance170const imageEditor = new ImageEditor({171 width: '550px',172 height: '330px',173 toolbar: ['Open', 'Save', 'ZoomIn', 'ZoomOut', 'Crop', 'Rotate', 'Flip']174});175176// Append to a container177imageEditor.appendTo('#imageeditor');178179// Open an image — replace with a validated, trusted URL; never use URLs from third-party responses directly180imageEditor.open('url');181```182183### HTML Setup184185```html186<div id="imageeditor"></div>187```188189### CSS Themes190191```css192@import "@syncfusion/ej2-image-editor/styles/material.css";193```194195## Common Patterns196197### Pattern 1: Basic Image Editor with Full Toolbar198199```typescript200import { ImageEditor } from '@syncfusion/ej2-image-editor';201202const imageEditor = new ImageEditor({203 width: '600px',204 height: '400px',205 toolbar: ['Open', 'Save', 'ZoomIn', 'ZoomOut', 'Crop', 206 'Rotate', 'Flip', 'Undo', 'Redo', 'Reset'],207 created: () => {208 // Replace 'url' with a validated, trusted image URL or local asset path209 imageEditor.open('url');210 }211});212213imageEditor.appendTo('#imageeditor');214```215216### Pattern 2: Adding Text Annotation217218```typescript219const dimension = imageEditor.getImageDimension();220imageEditor.drawText(221 dimension.x + 50, 222 dimension.y + 50, 223 'Annotation Text',224 'Arial', // font family225 30, // font size226 false, // bold227 false, // italic228 'blue', // text color229 false, // selected230 null, // rotation231 '#FFFFCC', // fill color232 'black' // stroke color233);234```235236### Pattern 3: Applying Filters237238```typescript239import { ImageEditor, ImageFilterOption } from '@syncfusion/ej2-image-editor';240241// Apply brightness adjustment242imageEditor.finetuneImage('brightness', 30);243244// Apply blur filter245imageEditor.applyImageFilter(ImageFilterOption.Blur);246247// Apply multiple fine-tune effects248imageEditor.finetuneImage('contrast', 20);249imageEditor.finetuneImage('saturation', 15);250```251252### Pattern 4: Cropping an Image253254```typescript255const dimension = imageEditor.getImageDimension();256257// Step 1: Programmatically select a crop region258imageEditor.select('Custom', dimension.x, dimension.y, 500, 300);259260// Step 2: Apply the crop261imageEditor.crop();262```263264### Pattern 5: Dialog Integration265266```typescript267import { Dialog } from '@syncfusion/ej2-popups';268269const dialog = new Dialog({270 width: '600px',271 height: '450px',272 isModal: true,273 visible: false274});275dialog.appendTo('#dialog');276277const imageEditor = new ImageEditor({278 width: '100%',279 height: '100%'280});281imageEditor.appendTo('#imageeditor');282283document.getElementById('openBtn').onclick = () => {284 dialog.show();285 // Replace 'url' with a validated, trusted image URL286 imageEditor.open('url');287};288```289290## Key APIs291292### Essential Methods293294| Method | Purpose |295|--------|---------|296| `open(fileOrUrl)` | Load an image from URL, File, or ImageData — **always validate or sanitize URL inputs against a trusted allowlist in production; never pass URLs derived from third-party content to prevent SSRF and indirect injection** |297| `export(type?, fileName?, imageQuality?)` | Export/download image in specified format |298| `crop()` | Execute crop based on current selection |299| `select(type, startX?, startY?, width?, height?)` | Set crop selection area |300| `rotate(degree)` | Rotate image (positive = clockwise, negative = anti-clockwise) |301| `flip(direction)` | Flip image horizontally or vertically |302| `zoom(zoomFactor, zoomPoint?)` | Zoom in/out to a factor and optional point |303| `pan(value, x?, y?)` | Enable/disable panning or pan to x/y |304| `resize(width, height, isAspectRatio?)` | Resize image dimensions |305| `straightenImage(degree)` | Straighten image by small rotation angle |306| `drawText(x?, y?, text?, ...)` | Add text annotation |307| `drawRectangle(x?, y?, width?, height?, ...)` | Draw rectangle annotation |308| `drawEllipse(x?, y?, radiusX?, radiusY?, ...)` | Draw ellipse annotation |309| `drawArrow(startX?, startY?, endX?, endY?, ...)` | Draw arrow annotation |310| `drawLine(startX?, startY?, endX?, endY?, ...)` | Draw line annotation |311| `drawPath(pointColl, ...)` | Draw path/freehand annotation |312| `drawImage(data, x?, y?, width?, height?, ...)` | Draw image annotation |313| `drawFrame(frameType, ...)` | Draw decorative frame around image |314| `drawRedact(type?, x?, y?, width?, height?, value?)` | Draw blur/pixelate redaction |315| `freehandDraw(value)` | Enable/disable freehand drawing mode |316| `applyImageFilter(filterOption)` | Apply a predefined image filter |317| `finetuneImage(finetuneOption, value)` | Apply fine-tuning adjustment |318| `getShapeSettings()` | Get all drawn shapes |319| `getShapeSetting(id)` | Get single shape by id |320| `selectShape(id)` | Select a shape by id |321| `updateShape(setting, isSelected?)` | Update an existing shape |322| `deleteShape(id)` | Delete a shape by id |323| `cloneShape(shapeId)` | Duplicate a shape by id |324| `bringToFront(shapeId)` | Move shape to front |325| `sendToBack(shapeId)` | Move shape to back |326| `bringForward(shapeId)` | Move shape forward one position |327| `sendBackward(shapeId)` | Move shape backward one position |328| `getRedacts()` | Get all redaction shapes |329| `selectRedact(id)` | Select a redaction by id |330| `updateRedact(setting, isSelected?)` | Update a redaction |331| `deleteRedact(id)` | Delete a redaction by id |332| `undo()` | Undo last action |333| `redo()` | Redo last undone action |334| `canUndo()` | Returns true if undo is available |335| `canRedo()` | Returns true if redo is available |336| `reset()` | Reset image to original state |337| `clearImage()` | Clear the loaded image |338| `clearSelection(resetCrop?)` | Clear current selection |339| `getImageDimension()` | Get current image x, y, width, height |340| `getImageData()` | Get canvas image as ImageData |341| `apply()` | Apply pending annotation drawings |342| `discard()` | Discard unapplied annotation changes |343| `enableShapeDrawing(shapeType, isEnabled?)` | Enable/disable shape drawing |344| `enableTextEditing()` | Enter text-edit mode on a text annotation |345346### Key Properties347348| Property | Type | Default | Purpose |349|----------|------|---------|---------|350| `width` | `string` | `'100%'` | Editor container width |351| `height` | `string` | `'100%'` | Editor container height |352| `toolbar` | `(string \| ItemModel)[]` | `null` | Toolbar items; `null` = default toolbar, `[]` = no toolbar |353| `toolbarTemplate` | `string \| Function` | `null` | Fully custom toolbar template (overrides `toolbar`) |354| `quickAccessToolbarTemplate` | `string \| Function` | `null` | Template for quick access toolbar |355| `showQuickAccessToolbar` | `boolean` | `true` | Show/hide quick access toolbar |356| `theme` | `string \| Theme` | `Theme.Bootstrap5` | UI appearance theme |357| `allowUndoRedo` | `boolean` | `true` | Enable undo/redo operations |358| `disabled` | `boolean` | `false` | Disable the component |359| `cssClass` | `string` | `''` | Custom CSS classes for styling |360| `imageSmoothingEnabled` | `boolean` | `false` | Enable high-quality image smoothing |361| `locale` | `string` | `''` | Locale override for localization |362| `zoomSettings` | `ZoomSettingsModel` | `null` | Zoom configuration (min, max, factor, trigger, point) |363| `finetuneSettings` | `FinetuneSettingsModel` | — | Fine-tune controls configuration (brightness, contrast, etc.) |364| `selectionSettings` | `SelectionSettingsModel` | `null` | Selection/crop appearance (fill, stroke, showCircle) |365| `uploadSettings` | `UploadSettingsModel` | — | File upload constraints (extensions, min/max size) |366| `fontFamily` | `FontFamilyModel[]` | — | Custom font families in text annotation dropdown |367368### Events369370| Event | Args Interface | When Triggered |371|-------|---------------|----------------|372| `created` | `Event` | After component is rendered |373| `destroyed` | `Event` | After component is destroyed |374| `fileOpened` | `OpenEventArgs` | After an image is opened |375| `beforeSave` | `BeforeSaveEventArgs` | Before image is saved/exported |376| `saved` | `SaveEventArgs` | After image is saved/exported |377| `editComplete` | `EditCompleteEventArgs` | After any edit action completes |378| `cropping` | `CropEventArgs` | While crop is in progress |379| `rotating` | `RotateEventArgs` | While rotation is in progress |380| `flipping` | `FlipEventArgs` | While flip is in progress |381| `resizing` | `ResizeEventArgs` | While resize is in progress |382| `zooming` | `ZoomEventArgs` | While zoom is in progress |383| `panning` | `PanEventArgs` | While pan is in progress |384| `selectionChanging` | `SelectionChangeEventArgs` | While crop selection changes |385| `shapeChanging` | `ShapeChangeEventArgs` | While a shape is being changed |386| `shapeChange` | `ShapeChangeEventArgs` | After a shape change completes |387| `imageFiltering` | `ImageFilterEventArgs` | When a filter is applied |388| `finetuneValueChanging` | `FinetuneEventArgs` | While a fine-tune value changes |389| `frameChange` | `FrameChangeEventArgs` | While a frame is applied |390| `toolbarCreated` | `ToolbarEventArgs` | After toolbar is created |391| `toolbarUpdating` | `ToolbarEventArgs` | While toolbar is refreshed |392| `toolbarItemClicked` | `ClickEventArgs` | On toolbar item click |393| `quickAccessToolbarOpen` | `QuickAccessToolbarEventArgs` | When quick access toolbar opens |394| `quickAccessToolbarItemClick` | `ClickEventArgs` | On quick access toolbar item click |395| `click` | `ImageEditorClickEventArgs` | On click inside editor canvas |396397## Common Use Cases398399**Professional Image Editing Suite** - Full-featured editor with all tools400**Annotation Workflow** - Markup and redaction for documents401**Quick Crop Tool** - Simplified UI focused on cropping402**Social Media Tool** - Preset aspect ratios for platforms403**Screenshot Markup** - Quick annotation on screenshots404**Document Processing** - Straighten, crop, and export scans405**Dialog Integration** - Modal image editing workflows406407## Related Skills408409- `implementing-rich-text-editor` - For text document editing410- `implementing-buttons` - For control customization411- `implementing-dialogs` - For modal workflow integration412