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-editorUsage
<!-- 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
- Crop, rotate, flipAspect-ratio presets, rule-of-thirds guide, keyboard nudging.
- AnnotateDraw, text, arrows, shapes and callouts that stay attached through crop and rotate.
- Filters & adjustSeven filters with live previews, plus brightness, contrast, saturation and blur.
- Multi-imageEdit a batch with a thumbnail strip and per-image undo.
- AccessibleWCAG 2.2 AA, full keyboard support, focus management.
- Mobile-readyBottom tool bar, 44 px targets, pinch zoom, HEIC support.
- 15 languagesBuilt-in translations, every string overridable, light and dark themes.
- Full-quality exportPNG or JPEG at the original resolution, as File, Blob or base64.
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.