1. A method to encode with a processor a high dynamic range (HDR) image, the method comprising: receiving an input HDR image (HDR) with an input color gamut and an input dynamic range; applying a tone mapping and a gamut mapping function to the input HDR image to generate a first base image in a first dynamic range and a first color space, wherein the first color space comprises a first color gamut, wherein the first dynamic range is lower than the input dynamic range and the first color gamut is narrower than the input color gamut; applying a color transform process to the first base image to generate a second base image in a second color space with a second color gamut, wherein the second color gamut is different than the first color gamut; generating HDR metadata in response to the input HDR image and the second base image; and generating an output coded HDR image based on the first base image and the HDR metadata.