A method for varying a luminance of an image to be displayed on a liquid crystal display or a digital micro-mirror device, said method comprising: a) generating an image luminance histogram (h, 1151, 1153, 2032) for the image, said luminance histogram (h, 1151, 1153, 2032) comprising bin values; b) weighting said histogram bin values from said image luminance histogram (h, 1151, 1153, 2032) with distortion weight values comprising multiplying said distortion weight values by said histogram bin values, wherein said distortion weight values correspond to a display error vector at a particular source light illumination level, thereby creating weighted histogram values; c) combining said weighted histogram values to obtain a distortion value for each of said source light illumination levels (L source), said distortion values each estimating a sum of display error vectors between each of a plurality of pixels' displayed values when displayed at said source light illumination level on said liquid crystal display device or said digital micro-mirror device and said pixels' displayed values when displayed on an ideal display, weighted by the histogram bin values d) selecting a source light illumination level for said image so that said distortion value decreases; e) temporal filtering said selected source light illumination level to determine a filtered source light illumination level; characterized by f) determining a compensation strength factor so as to avoid excessive desaturation of color images; g) determining the luminance based on said filtered source light illumination level (L source) and further a slope defined by the following equation: slope = S ⋅ + 1 − S ⋅ BL BL 1 7, wherein S is the compensation strength factor, BL is the filtered source light illumination level and γ is a display gamma value, the slope indicating a ratio between an input luminance and the determined luminance wherein said compensation strength factor S is 25%, 50% or 100%. a) generating an image luminance histogram (h, 1151, 1153, 2032) for the image, said luminance histogram (h, 1151, 1153, 2032) comprising bin values; b) weighting said histogram bin values from said image luminance histogram (h, 1151, 1153, 2032) with distortion weight values comprising multiplying said distortion weight values by said histogram bin values, wherein said distortion weight values correspond to a display error vector at a particular source light illumination level, thereby creating weighted histogram values; c) combining said weighted histogram values to obtain a distortion value for each of said source light illumination levels (L source), said distortion values each estimating a sum of display error vectors between each of a plurality of pixels' displayed values when displayed at said source light illumination level on said liquid crystal display device or said digital micro-mirror device and said pixels' displayed values when displayed on an ideal display, weighted by the histogram bin values d) selecting a source light illumination level for said image so that said distortion value decreases; e) temporal filtering said selected source light illumination level to determine a filtered source light illumination level; characterized by f) determining a compensation strength factor so as to avoid excessive desaturation of color images; g) determining the luminance based on said filtered source light illumination level (L source) and further a slope defined by the following equation: slope = S ⋅ + 1 − S ⋅ BL BL 1 7, wherein S is the compensation strength factor, BL is the filtered source light illumination level and γ is a display gamma value, the slope indicating a ratio between an input luminance and the determined luminance wherein said compensation strength factor S is 25%, 50% or 100%.