In order to easily correct typical out-of-
gamut mapping problems when freely applying a desired luminance mapping function to a luminance /
chrominance color representation, the inventors propose an apparatus (500) or method for transforming an input
pixel color (CHb) of a
high dynamic range input image into an output color (CSb) of an output image, the input color is represented as a gamma logarithmic defined triple comprising an initial first color component, an initial second color component and an initial third color component according to a photoelectric
transfer function having a gamma logarithmic shape, the
color transformation circuitry (501) is arranged to transform the initial first color component, the initial second color component and the initial third color component into an intermediate red component (R "im), an intermediate
green component (G" im) and an intermediate blue component (B "im) by mapping the initial color component with the same function for each color component, the invention relates to a device for maximizing a function (551) for a sub-range of darkest color component values comprising an initial color component, the function having a slope greater than 1, characterized in that the device comprises:-a first maximization circuit (551) arranged to calculate a first value (Mx), the first value being a largest one of three intermediate color components for each input color; -a first
subtractor (552) arranged to subtract a second value (V2) from the value, the second value (V2) being equal to a value obtained from applying the photoelectric
transfer function to a
tertiary value equal to a target display maximum brightness (MLTo) of the output image divided by a maximum brightness (MLPQ) associated with the photoelectric
transfer function, the subtraction resulting in a fourth value (V4); -a second maximization circuit (553) arranged to calculate a fifth value, which is the highest one of the fourth value and zero; -a second
subtractor (554), a third
subtractor (555) and a fourth subtractor (556) arranged to calculate three output color components (R ''out, G'' out, B ''out) by subtracting a fifth value from the corresponding intermediate color components, and arranged to set the output color components equal to zero if the subtracting produces a negative value.