A web-based image mask editor for creating masks from images, designed for 3D card cutting with plotters.
Kirika is a browser-based tool that allows you to create and manage layered masks from images. These masks can be exported as PDFs optimized for plotter cutting, or as SVG paths for further processing. The application includes a real-time 3D preview to visualize how the layered cuts will look.
- Node.js 18 or later
- npm or yarn
git clone https://github.com/your-username/kirika.git
cd kirika
npm installnpm run devOpen http://localhost:3000 in your browser.
npm run build
npm start| Key | Action |
|---|---|
| B | Brush tool |
| F | Flood fill tool |
| A | Add to selection mode |
| S | Subtract from selection mode |
| E | Toggle selection edges |
| Ctrl+Z | Undo |
| Ctrl+Shift+Z / Ctrl+Y | Redo |
| +/- | Zoom in/out |
| Ctrl+0 | Reset zoom |
| Ctrl+Scroll | Zoom at cursor |
app/ Next.js pages and API routes
components/
editor/ Core editor components
Canvas/ Multi-layer canvas system
LayerPanel/ Mask hierarchy management
Toolbar/ Export, import, and tool controls
preview3d/ Three.js 3D preview
ui/ Reusable UI components
lib/
canvas/ Image editing operations
commands/ Undo/redo command pattern
print/ PDF generation and bin packing
preview3d/ 3D geometry generation
svg/ SVG export utilities
store/ Zustand state management
hooks/ Custom React hooks
types/ TypeScript type definitions
- Load an image using the toolbar or by dragging a file onto the canvas
- Create a new mask using the "New Mask" button in the layer panel
- Use the brush or flood fill tools to define the mask area
- Create additional masks as needed, optionally nesting them under parent masks
- Use the 3D preview to visualize the layered result
- Export as PDF for cutting or save the project for later
MIT