Image registration is the process of establishing a common geometric reference frame between two or more data sets possibly taken at different times. In this paper we present a method for computing elastic registration maps based on the Monge--Kantorovich problem of optimal mass transport. This mass transport method has a number of advantages. First it is parameter free. Moreover, it utilizes all of the grayscale data in both images, places the two images on equal footing and is symmetrical: the optimal mapping from image A to image B being the inverse of the optimal mapping from B to A. The method does not require that landmarks be specified, and the minimizer of the distance functional involved is unique; there are no other local minimizers. Finally, optimal transport naturally takes into account changes in density that result from changes in area or volume. It is the last property that makes this method ideal for certain warping problems in medical imaging. Our method for finding the registration mapping is based on a partial differential equation approach to the minimization of the L2 Kantorovich--Wasserstein or ``earth-mover's'' distance under a mass preservation constraint. We show how this approach leads to practical algorithms, and demonstrate our method with a number of examples, including those from the medical field.