rp-image-editor

Angular image editor

An injectable service that opens a full-screen, accessible image editor and resolves with the edited File. Built with Angular Package Format, so it works in AOT and production builds on Angular 15 and newer, including Ionic.

This is the real editor (v1.6.1). Pick a tool and try it.More demos, including multi-image →

Install

npm install @rageshpikalmunde/rp-image-editor @rageshpikalmunde/rp-image-editor-angular

Usage

import { Component, inject } from '@angular/core';
import { RpImageEditorService } from '@rageshpikalmunde/rp-image-editor-angular';

@Component({
  selector: 'app-photo-upload',
  standalone: true,
  template: '<input type="file" accept="image/*" (change)="edit($event)" />',
})
export class PhotoUploadComponent {
  private editor = inject(RpImageEditorService);

  async edit(event: Event) {
    const file = (event.target as HTMLInputElement).files?.[0];
    if (!file) return;
    const result = await this.editor.openEditor(file, { exportFormat: 'jpeg' });
    if (result) this.upload(result.file);
  }
}

For an inline editor use <rp-image-editor> from RpImageEditorModule. On Angular 17+ with the esbuild builder, add "externalDependencies": ["jsdom", "canvas"] to angular.json.

What you get

Questions

Which Angular versions are supported?

Angular 15 and newer, in JIT and AOT builds. Angular SSR is safe: the component only starts in the browser.

Does it work with Ionic and Capacitor?

Yes. The modal is mobile-first (bottom tool bar, 44 px touch targets, pinch to zoom) and iPhone HEIC photos are converted when heic2any is installed.

Can I edit a batch of images?

Yes: openMultiEditor(files) opens them all with a thumbnail strip and returns one result per image.

Try the full demo   npm · GitHub · API reference