Core Concepts
Fluent API
ArtistAPhoto uses a fluent (chainable) API pattern. Most methods return this, allowing you to chain operations:
editor
.crop({ x: 0, y: 0, width: 500, height: 500 })
.filter('grayscale')
.brightness(20)
.resize(400, 400);Non-Destructive Editing
All edits are stored as operations in a queue. The original image is never modified, allowing you to:
- Undo/redo any operation
- Reset to the original image at any time
- Preview changes before exporting
Operation Queue
Operations are applied in order when you call preview(), toCanvas(), toBlob(), toDataURL() or download().
// Operations are queued, not immediately applied
editor.brightness(20); // Queued
editor.contrast(10); // Queued
// Operations applied when rendering
const canvas = await editor.preview();