1. A method of generating a distance map comprising the steps of: a) identifying a boundary curve of a source image; and b) assigning a distance value to each pixel of the distance map associated with a corresponding region of the source image, wherein for each pixel, the distance value represents a distance between a center of that pixel and a nearest point of the boundary curve, wherein the nearest point is located to sub-pixel accuracy.