Voronoi image encoder in JS