1. A method of generating a second pixel based on a first pixel by an inverse mapping function, wherein a first image comprises the first pixel and a second image comprises the second pixel, the first image having a lower dynamic range and the second image having a higher dynamic range, the method comprising: providing the first pixel; providing a value of the first pixel; generating context information based on at least one pixel neighboring the first pixel; and computing a value of the second pixel based on the value of the first pixel and the context information of the at least one pixel to generate the second pixel; generating statistical information based on the provided values of the at least one pixel neighboring the first pixel, wherein: the statistical information comprises at least one of mean of the provided values, variance of the provided values, texture associated with the provided values, and gradient associated with the provided values, the computing is based on the statistical information, the at least one pixel neighboring the first pixel comprises neighboring pixels on a different channel than the first pixel, the generating of context information comprises reading values of the at least one pixel neighboring the first pixel, and the computing comprises estimating an inverse mapping function based on the value of the first pixel and the generated context information, the estimated inverse mapping function being adapted to map a value from the lower dynamic range to the higher dynamic range; and applying the inverse mapping function to the first pixel to generate the second pixel.