1. A computer-implemented method for generating a mesh characterizing an image, the method comprising: receiving the image; generating a set of points that span at least a portion of the image; adjusting the set of points according to a composite function of spatial coordinates of the set of points; wherein said composite function is a weighted combination of a first function of pair-wise distances between said points, and a second function of sampled values of said image near said points; and wherein the first function is a summation of terms, wherein each of said terms corresponds to one of said pair-wise distances between said points; and generating the mesh based on the adjusted set of points.