We introduce a new exact Euclidean distance transform algorithm for binary images based on the Linear-time Legendre Transform algorithm. The three-step algorithm uses dimension reduction and convex analysis results on the Legendre-Fenchel transform to achieve linear-time complexity. First, computation on a grid (the image) is reduced to computation on a line, then the convex envelope is computed, and finally the squared Euclidean distance transform is obtained. Examples and an extension to non-binary images are provided.