1. A method for improving image quality, comprising steps of: inputting an image to any generic computer; computing a probability density function based on the image to generate a first luminance histogram; computing a weighing distribution function based on the first luminance histogram to generate a second luminance histogram through pixel redistribution of the first luminance histogram, wherein the weighing distribution function is defined as follows: PDF w ⁡ ( l ) = max ⁢ ⁢ ( PDF ) ⁢ ( PDF ⁡ ( l ) - min ⁡ ( PDF ) max ⁡ ( PDF ) - min ⁡ ( PDF ) ) α where l represents pixel of the image, l=lmin, lmin+1, lmin+2,. .. , lmax, PDFw(l) represents weighing probability density, max(PDF) represents maximum probability density, min(PDF) represents minimum probability density, and α represents an adaptive parameter that can be experimentally set to 0.5, the PDF(l) represents probability density function of l; computing a cumulative density function based on the second luminance histogram, wherein the cumulative density function is defined as follows: CDF s ⁡ ( l ) = ∑ h = 0 l ⁢ PDF w ⁡ ( h ) ∑ PDF w , where l=lmin, lmin+1, lmin+2,. .. , lmax, ΣPDFw represents a sum of weighing probabilities, and CDFs(l) represents cumulative density function; and computing a gamma conversion function based on the cumulative density function to adjust luminance distribution of the input image, wherein the gamma conversion function is defined as follows: T ⁡ ( l ) = 255 ⁢ ( l 255 ) 1 - CDF S ⁡ ( l ) .