A method for generating inverse tone mapping parameters, comprising: receiving a first image stream of a first dynamic range and a first color space and a second image stream of a second dynamic range in a layered codec, wherein: the first dynamic range is lower than the second dynamic range, the first image stream is in a base layer and the second image stream is in an enhancement layer, and the layered codec comprises a decoder and an encoder; encoding the first image stream in the base layer using the encoder to obtain an encoded first image stream; decoding the encoded first image stream using the decoder to obtain a decoded first image stream; converting the decoded first image stream from the first color space to a second color space of the second image stream to obtain a decoded color converted image stream; and characterized by, for each pixel of an image of the decoded color converted image stream, generating a respective single inverse tone mapping parameter that parameterizes a tone mapping function of the log luminance of a pixel of the decoded color converted image stream, wherein the tone mapping function comprises a quadratic function of the log luminance of a pixel of the decoded color converted image stream, the quadratic function providing a mapping which becomes increasingly S-shaped as the single inverse tone mapping parameter increases, and wherein the respective single inverse tone mapping parameter is selected such that the tone mapping function outputs an approximation of the log luminance of a corresponding pixel of the second image stream. receiving a first image stream of a first dynamic range and a first color space and a second image stream of a second dynamic range in a layered codec, wherein: the first dynamic range is lower than the second dynamic range, the first image stream is in a base layer and the second image stream is in an enhancement layer, and the layered codec comprises a decoder and an encoder; the first dynamic range is lower than the second dynamic range, the first image stream is in a base layer and the second image stream is in an enhancement layer, and the layered codec comprises a decoder and an encoder; encoding the first image stream in the base layer using the encoder to obtain an encoded first image stream; decoding the encoded first image stream using the decoder to obtain a decoded first image stream; converting the decoded first image stream from the first color space to a second color space of the second image stream to obtain a decoded color converted image stream; and characterized by, for each pixel of an image of the decoded color converted image stream, generating a respective single inverse tone mapping parameter that parameterizes a tone mapping function of the log luminance of a pixel of the decoded color converted image stream, wherein the tone mapping function comprises a quadratic function of the log luminance of a pixel of the decoded color converted image stream, the quadratic function providing a mapping which becomes increasingly S-shaped as the single inverse tone mapping parameter increases, and wherein the respective single inverse tone mapping parameter is selected such that the tone mapping function outputs an approximation of the log luminance of a corresponding pixel of the second image stream.