Skip to content

TruaShamu/voronoi-mosaic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

voronoi-mosaic

game plan:

  1. generate n random seeds / points.
  2. brute force the generation of a voronoi diagram - for each pixel, allocate it to a region depending on the seed to which it has the shortest euclidean distance. we can naively persist the regions and all the pixels are in it.
  3. for each region, find a representative color, which is the mean of all pixel RGB values in the region.
  4. recolor each region with the representative color.

extra items:

e1. run edge detection on the input image using adaptive thresholding and 'paint' the edges back onto the mosaic to give better form or shape to the main subjects of the image. (there's probably some other visual saliency things we could do too)

e2. a trivial way to optimize is to chunk pixels together (so a nxn pixel image can be translated to mxm chunks, where m < n)

e3. look into better ways of finding the voronoi diagram (i.e. fortunes, lloyds)

e4. look into hausner's paper on mosaic tiling

#results (as of 12/24)

Input Output (3000 seeds)*
image output
Takes ~20s for a 512x512 image using 3000 seeds, ~7s for 1000 seeds, ...

About

uwu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors