Distance functions on digital pictures