This paper presents a parallel algorithm for the weighted distance transform and the nearest feature transform of an n 2 n binary image. We show that the algorithm runs in O(log n) time using n 2 = log n processors on the EREW PRAM and in O(log log n) time using n 2 = log log n processors on the common CRCW PRAM. We also show that the algorithm runs in O(n 2 =p 2 + n) time on a p 2 p mesh and in O(n 2 =p 2 +(n log p)=p) time on a p 2 processor hypercube (for 1 p n). The algorithm is cost optimal on the PRAMs, on the mesh (for 1 p pn) and on the hypercube (for 1 p n= log n). We show that the time complexity on the EREW PRAM is time optimal.