1. In an image decoder, a method to decode image data, the method comprising: receiving image coded data, the image coded data comprising a compressed low dynamic range image, a compressed residual image, and a prediction function, wherein for input pixel values in a low dynamic range the prediction function provides corresponding predicted pixel values in a high dynamic range; decompressing the compressed low dynamic range image to generate a reconstructed low dynamic range image; decompressing the compressed residual image to generate a decoded residual image, wherein the decoded residual image is based on a reference high dynamic range image representing the same scene as the reconstructed low dynamic range image; applying the prediction function to the reconstructed low dynamic range image to generate a predicted high dynamic range image; and combining the predicted high dynamic range image with the decoded residual image data to generate an output high dynamic range image, wherein the method is performed by one or more processors.