A web application that transforms images into beautiful Voronoi mosaics. Upload any image, adjust the settings, and create stunning geometric art with customizable Voronoi diagrams.
-
Multiple Image Input Methods
- Upload images from your computer
- Load images from URLs
- Paste images directly from your clipboard (⌘+V / Ctrl+V)
-
Customizable Processing
- Adjust the number of Voronoi points (100-6000)
- Control color smoothness (1x1 to 9x9 sampling)
- Set line thickness for cell borders (0-10px)
-
Export Options
- Download processed images as PNG
- Copy SVG code to clipboard for vector graphics
-
Beautiful UI
- Light and dark theme support
- Responsive design that works on desktop and mobile
- Custom design system with smooth animations
- Fun "Moth Mode" theme toggle
-
Load an Image
- Enter an image URL and click the load button, or
- Click "Choose File" to upload from your computer, or
- Press ⌘+V (Mac) or Ctrl+V (Windows/Linux) to paste from clipboard
-
Adjust Settings
- Number of Points: More points = more detail (but slower processing)
- Smoothness: Higher values = smoother color transitions
- Line Thickness: Set to 0 for no borders, or increase for visible cell edges
-
Process Image
- Click "Process Image" to generate your Voronoi mosaic
- Watch the progress percentage as it processes
-
Export Your Creation
- Click "Download" to save as PNG
- Click "Copy SVG" to get vector code for use in other applications
Simply open index.html in a modern web browser. No build process or installation required!
# Clone the repository
git clone https://github.com/A7-RD/Voronoisaic.git
# Open in your browser
open index.html- A modern web browser (Chrome, Firefox, Safari, or Edge)
- No server required - works offline after initial load
Voronoisaic/
├── index.html # Main application page
├── app.js # Voronoi processing logic
├── MothMode.png # Theme toggle icon
└── design-system/ # UI component library
├── design-system.css
├── tokens.css
├── base.css
└── components/ # Individual component styles
Voronoisaic uses a custom implementation of the Voronoi diagram algorithm:
- Point Generation: Random points are generated across the image (plus border points for clean edges)
- Delaunay Triangulation: Points are triangulated using the Bowyer-Watson algorithm
- Voronoi Cells: Each cell is created from the circumcenters of adjacent triangles
- Color Sampling: The average color from the original image is calculated for each cell
- Rendering: Cells are drawn as filled polygons with optional borders
- Pure JavaScript: No external dependencies or frameworks
- Canvas API: Uses HTML5 Canvas for image processing and rendering
- Custom Voronoi Implementation: Built from scratch (not using d3-delaunay)
- Chunked Processing: Processes cells in chunks to keep the UI responsive
- SVG Export: Generates clean, scalable vector graphics
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
Requires support for:
- HTML5 Canvas
- ES6 JavaScript features
- CSS Custom Properties
- Clipboard API (for SVG copy feature)
The project includes a complete design system in the design-system/ folder. See design-system/README.md for documentation on using the component library in other projects.
Themes are controlled via CSS custom properties. Modify colors in design-system/tokens.css to create your own theme.
This project is open source and available for use in your own projects.
- Uses the Geist font family
- Design system inspired by modern UI patterns
- Voronoi algorithm implementation by the project author
Contributions are welcome! Feel free to open issues or submit pull requests.
Enjoy creating beautiful Voronoi mosaics! 🎨