A browser-based image annotation tool for creating bounding box annotations on document images. Built for annotating text, music, and staves regions in scanned documents and sheet music.
Live demo: https://ddmal.ca/mothra-annotator/
- Bounding box annotation — Draw, move, and resize bounding boxes directly on images
- Three annotation classes — Text, Music, and Staves, each with a distinct color and keyboard shortcut (
1,2,3) - Draw and Select modes — Switch between creating new boxes (
D) and selecting/editing existing ones (V) - Resize handles — 8-handle hit testing for precise box adjustments
- Zoom and pan — Scroll to pan, Shift+Scroll to zoom, or use
+/-keys; press0to reset view - Class filter toggles — Show or hide annotations by class
- Label visibility toggle — Press
Lto show/hide annotation labels - Undo support —
Ctrl/Cmd+Zto undo actions - Auto-save — Annotations persist to localStorage automatically
- Export formats — Export as JSON (full session) or YOLO (normalized center-format with 0-indexed class IDs), with ZIP support for batch export
- Import — Load previously exported JSON annotations
- Quick save —
Ctrl/Cmd+Sto download annotations as JSON - Keyboard-driven workflow — Shortcuts for class selection, mode switching, deletion (
Delete/Backspace), and more
React 19, TypeScript, Vite 7, Tailwind CSS 4, Zustand
npm install
npm run dev| Command | Description |
|---|---|
npm run dev |
Start Vite dev server with HMR |
npm run build |
Type-check and build for production |
npm run lint |
Run ESLint |
npm run format |
Format with Prettier |
npm run deploy |
Build and deploy to GitHub Pages |