rp-image-editor

Image annotation in JavaScript

Mark up screenshots, documents and photos in the browser: arrows, rectangles and circles, text, speech-bubble callouts and freehand drawing. Annotations stay attached to the image through crop, rotate and zoom, and export at full resolution.

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

Usage

<!-- No build step: load the CDN bundle -->
<script src="https://unpkg.com/@rageshpikalmunde/rp-image-editor@1/dist/browser/rp-image-editor.min.js"></script>
<input type="file" id="file" accept="image/*">
<script>
  document.getElementById('file').addEventListener('change', async (e) => {
    const result = await RpImageEditor.openEditorModal({
      image: e.target.files[0],
      config: { defaultBrushColor: '#e11d48' },
    });
    if (result) document.body.append(Object.assign(new Image(), { src: result.base64 }));
  });
</script>

Need annotations on a page instead of a popup? Create new RpImageEditor.RpImageEditor(container, config) and call getResult() when you save.

What you get

Questions

Which annotation tools are included?

Freehand draw, eraser, text, arrows, lines, rectangles, squares, circles, ellipses and callouts (a label with a pointer), each with colour and size settings and full undo/redo.

Is the exported image full resolution?

Yes. Exports are PNG or JPEG at the original image size, with every annotation drawn in.

Can I use it without React or Angular?

Yes. The core is plain JavaScript/TypeScript, and a single-file CDN build exposes a global RpImageEditor.

Try the full demo   npm · GitHub · API reference