HiveForge: Edge-Consistent Wedge-Gradient Cell Vectorization
A technical overview of honeycomb mesh vectorization with perceptual quality optimization.
Abstract
HiveForge is a raster-to-vector conversion system designed for high-fidelity reproduction of photographs and patterns as print-safe SVG. Unlike traditional edge-tracing approaches (Potrace, Illustrator Live Trace), HiveForge uses honeycomb tessellation with wedge gradients to represent continuous-tone images.
1. Problem Statement
Existing vectorization tools fall into two categories:
- Edge tracers: Work well for flat colors but produce posterized results on photographs
- Mesh gradients: Can represent gradients but often produce non-print-safe output
HiveForge bridges this gap with a tessellation-based approach that maintains both visual fidelity and print compatibility.
2. Honeycomb Tessellation
The image is divided into hexagonal cells. Hexagons are chosen because:
- 6 neighbors vs 4 for squares (smoother gradients)
- Uniform distance to all neighbors
- No diagonal artifacts
- Better approximation of organic curves
3. Wedge Gradient Cells
Each hexagonal cell is decomposed into 6 triangular wedges. Each wedge contains a linear gradient from the cell center color to the shared edge color. When adjacent cells share edge colors, the result is a continuous gradient field with no visible seams.
4. Color Sampling
Colors are sampled in linear RGB space (not sRGB) for accurate averaging. Edge colors are computed from both adjacent cells to ensure consistency. The trimmed mean filter removes outliers from sampling.
5. Adaptive Refinement
The algorithm iteratively refines high-error regions:
- Render current mesh to raster
- Compute per-cell SSIM and ΔE00 error
- Mark cells exceeding threshold for subdivision
- Split marked cells using conforming refinement
- Repeat until quality targets met or max iterations reached
6. Quality Metrics
SSIM (Structural Similarity)
Measures structural similarity between original and vectorized images. Target: SSIM ≥ 0.95.
CIEDE2000 (ΔE00)
Perceptual color difference in Lab color space. More accurate than simple RGB difference. Target: mean ΔE00 ≤ 3.
7. Print-Safe SVG Subset
Output is restricted to primitives supported by professional RIP software:
- ✓ Linear gradients with
gradientUnits="userSpaceOnUse" - ✓ Closed path elements
- ✓ Solid fills and strokes
- ✗ Filters (blur, shadow, etc.)
- ✗ Clip-paths and masks
- ✗ Embedded raster images
- ✗ objectBoundingBox gradients
8. Multi-Stop Gradients
For complex color transitions, multi-stop gradients are generated. Stops are optimized using CIEDE2000 to minimize perceptual error. The algorithm greedily adds stops at points of maximum error until the threshold is met.
9. Edge Segmentation
When an edge crosses a significant color boundary, the wedge geometry is split to preserve the edge. This is critical for maintaining sharp boundaries in photographs.
10. Results
HiveForge achieves:
- SSIM ≥ 0.95 on photographic inputs
- Mean ΔE00 ≤ 3 on patterns
- 100% RIP compatibility (tested with Caldera, EFI, Onyx)
- Processing speed: ~5 seconds for 4K images
References
- Wang, Z. et al. (2004). Image Quality Assessment: From Error Visibility to Structural Similarity
- Sharma, G. et al. (2005). The CIEDE2000 Color-Difference Formula
- Secord, A. (2002). Weighted Voronoi Stippling