The invention discloses an optical compensation method for a display panel, which comprises the following steps of: shooting a gray
scale test chart of the display panel at different
exposure time, acquiring corresponding gray scale data, and establishing a quadratic polynomial fitting model of the
exposure time and a gray scale value; and then, in combination with a
Gamma correction principle, the Gamma value of the display panel is reversely deduced based on the fitting model, so that accurate mapping between the gray scale and the actual brightness is realized, the nonlinear influence of the display
system is eliminated, the accuracy and reliability of a
compensation algorithm are ensured, and the overall brightness reduction effect is further improved. And finally, combining the correction result, dividing the display panel into a plurality of grid areas, counting an average gray value of each grid, calculating a local compensation amount, generating a compensation
lookup table (LUT), and applying the compensation
lookup table to a real-time display compensation process. The display uniformity, the brightness consistency and the terminal visual effect of the panel can be improved, and good adaptability and practicability are achieved.