A non-transitory computer-readable storage medium, wherein a backlight control program is stored on the non-transitory computer-readable storage medium, the backlight control program, when executed by a processor, implements the following steps:
- acquiring each pixel of each area in an image;
- calculating first backlight values based on each pixel, threshold-limiting the first backlight values, to obtain a second backlight value subjected to threshold-limiting and a third backlight value without threshold-limiting;
- and
- sending the second backlight value to a backlight control circuit, performing backlight compensation on the image based on the third backlight value, and outputting the image after backlight compensation to a liquid crystal display screen;
- wherein the step of calculating first backlight values based on the pixel comprises:
- calculating a grayscale value of each pixel by using a maximum value algorithm;
- calculating an average grayscale value by using an average value algorithm based on the grayscale value;
- and
- correcting backlight of an entire area based on a backlight correction function to obtain the first backlight values,
- a formula for calculating the first backlight values is as follows:
- BL′(i)=Localavg+f(Localavg, Localmax), wherein BL′(i) is the first backlight values, Localavg is the average grayscale value by using the average value algorithm, Localmax is the grayscale value of each pixel by using the maximum value algorithm, and f(Localavg, Localmax) is the backlight correction function;
- wherein the step of threshold-limiting the first backlight values, to obtain a second backlight value subjected to threshold-limiting and a third backlight value without threshold-limiting comprises:
- determining whether the first backlight values comprise a backlight value less than a preset threshold;
- in a determination that the first backlight values comprise the backlight value less than the preset threshold, taking the backlight value less than the preset threshold as the third backlight value;
- and
- taking a backlight value not less than the preset threshold as the second backlight value;
- a formula for calculating the third backlight value is as follows:
- BL(i)=min(BLmax, BL′(i)), and BLmax is the preset threshold.