A method to map using a processor an image from a first dynamic range to a second dynamic range, the method comprising: accessing first information data for an input image in the first dynamic range, the first information data comprising an input black point level (x1, SMin), an input mid-tones level (x2, SMid), and an input white point level (x3, SMax) in the first dynamic range; accessing second information data for an output image in the second dynamic range, the second information data comprising a first output black point level (TminPQ) and a first output white point level (TmaxPQ) in the second dynamic range; determining an output mid-tones value in the second dynamic range based on the first information data and the second information data; computing a tail slope, a head slope, and a mid-tones slope; determining a transfer function to map pixel values of the input image in the first dynamic range to corresponding pixel values of the output image in the second dynamic range; mapping the input image to the output image using the determined transfer function; characterized in that the method further comprises: computing a second output black point and a second output white point in the second dynamic range based on the first information data, the second information data and the output mid-tones value; computing a tail slope based on the input black point level, the input mid-tones level, the second output black point and the output mid-tones value; computing a head slope based on the input white point level, the input mid-tones level, the second output white point and the output mid-tones value; and computing a mid-tones slope based on the first information data, the second output black point, the second output white point and the output mid-tones value. wherein the transfer function comprises two segments, wherein the first segment is determined based on the tail slope, the mid-tones slope, the input black point level, the input mid-tones level, the second output black point, and the output mid-tones value, and the second segment is determined based on the mid-tones slope, the head slope, the input mid-tones level, the input white point level, the output mid-tones value, and the second output white point. accessing first information data for an input image in the first dynamic range, the first information data comprising an input black point level (x1, SMin), an input mid-tones level (x2, SMid), and an input white point level (x3, SMax) in the first dynamic range; accessing second information data for an output image in the second dynamic range, the second information data comprising a first output black point level (TminPQ) and a first output white point level (TmaxPQ) in the second dynamic range; determining an output mid-tones value in the second dynamic range based on the first information data and the second information data; computing a tail slope, a head slope, and a mid-tones slope; determining a transfer function to map pixel values of the input image in the first dynamic range to corresponding pixel values of the output image in the second dynamic range; mapping the input image to the output image using the determined transfer function; characterized in that the method further comprises: computing a second output black point and a second output white point in the second dynamic range based on the first information data, the second information data and the output mid-tones value; computing a tail slope based on the input black point level, the input mid-tones level, the second output black point and the output mid-tones value; computing a head slope based on the input white point level, the input mid-tones level, the second output white point and the output mid-tones value; and computing a mid-tones slope based on the first information data, the second output black point, the second output white point and the output mid-tones value. wherein the transfer function comprises two segments, wherein the first segment is determined based on the tail slope, the mid-tones slope, the input black point level, the input mid-tones level, the second output black point, and the output mid-tones value, and the second segment is determined based on the mid-tones slope, the head slope, the input mid-tones level, the input white point level, the output mid-tones value, and the second output white point.