almost finished distance transform conversion (discrete voronoi diagram mode is not ready yet)