1. A method for encoding an input high dynamic range (HDR) image represented in a first color space, the method comprising: accessing an input lower dynamic range (LDR) image represented in a second color space, the input LDR image corresponding to the input high dynamic range image, wherein the second color space is different than the first color space; generating a second HDR image; said generating the second HDR image comprising color transforming the input HDR image from the first color space to a third color space; generating a second LDR image; said generating the second LDR image comprising color transforming the input LDR image from the second color space to a fourth color space; generating a prediction function based on the second HDR image and the second LDR image; obtaining a predicted HDR image, said obtaining comprising applying the prediction function to the second LDR range image; generating a residual image representing differences between pixel values in the predicted HDR image and corresponding pixel values in the second HDR image; and encoding the second LDR image, the prediction function, and the residual image.