Color Enhancement for Graphic Images

A color enhancement system may enhance color components in an image. In one embodiment, the color enhancement system suppresses banding by combining an input color value with an enhanced colored value. In another embodiment, local variation in saturation values around a pixel may be used to determine a modification of an input saturation value for color enhancement. As still another embodiment, flickering between frames may be suppressed by combining a histogram that counts the number of times a given pixel value occurs in a particular image with a historical histogram that keeps track of an average of how often given values have occurred in previous frames.

DETAILED DESCRIPTION

Referring toFIG. 1, a color enhancement system10may operate only on saturation in a hue, luminance, saturation (HSL) color space. The value for input luminance and input hue may be unaffected by the system10. Instead, only the input saturation may be modified in some embodiments. In some embodiments, the saturation enhancement is similar to a contrast enhancement.

Initially, a histogram is initialized. The histogram may be initialized by applying the same numbers to all entries within the histogram. In some embodiments, where the possible saturation values are from 0 to 255, each value may be given an initial entry of, for example, 500. In some embodiments, instead of using all 256 values, only 64 values are used, so that the saturation values are grouped. For example, saturation values 0 to 3, 4 to 7, etc. may be separate groups. The histogram basically keeps track of how many times a given value from 0 to 255 is encountered within the pixels in the input image. Thus, after initializing the histogram in block22, the local variance is measured in block24.

To measure the local variance, for each pixel, the saturation similarity between the central pixel and its neighbors is measured. For example, in one embodiment, the central pixel can be compared to four neighbors or eight neighbors, as desired. To do the comparison, the saturation values of the central pixel is compared to the average of the saturation values of its neighbors. As an example, the sum of absolute difference between the saturation values of the central pixel and its surrounding pixels may be determined. If the sum is higher than a predefined threshold, for example 50, the central pixel can be treated as a pixel coming from a non-uniform region, in terms of color saturation. Accordingly, the entry in the histogram, which corresponds to this pixel value, may be increased, for example, by one. If the sum is lower than the threshold, then, most probably, the pixel comes from a region of uniform saturation. In this case, in one embodiment, the value of the entry corresponding to this pixel's saturation is not changed.

After scanning the whole image, pixel by pixel, a histogram records the counts of each potential saturation value, for example, from 0 to 255. The histogram indicates how many pixels in the image have a particular saturation value. However, the histogram is slightly skewed because the values of pixels with local color variation are actually increased. The resulting histogram, indicated in block20, is then combined with a history histogram maintained in a history saturation lookup table (LUT)16. By blending, at block18, the updated histogram (block20) with the historical histogram (block16), the size of the saturation change may be reduced and flickering effects between neighboring frames may be reduced in some embodiments.

In one embodiment, a weighted average of the new histogram (block20) and the historical histogram (block16) may be used for blending. For example, in one embodiment, the current histogram is weighted as 7/16 and the historical histogram is weighted as 9/16. The new histogram may then be stored back in the historical saturation lookup table16. In one embodiment, the blending of the historical and current histograms may be done by alpha blending using a weighted average. The exact value of the weights or the use of weights is subject to considerable variation.

Then, the new histogram that is blended from the new data and the historical data is stored as the new lookup table16and then is used to adjust the input saturation in the local copy saturation lookup table12. The lookup table12may store a local copy of the historical saturation lookup table stored at16. In addition, the local copy may be transformed to provide a value for every possible saturation level from 255. Thus, while the saturation lookup table16may only have a value for each group of saturation values, say from 0 to 3 and 4 to 7 and so on, interpolation may be used to develop histogram values for each of 0 to 255 possible values in one embodiment.

Using the lookup table (block12), the input saturation values are adjusted. Histogram equalization is performed for the input image based on the updated local histogram.

In some embodiments, the output of local copy saturation lookup table12can then be used as the output saturation value. However, it is also advantageous for banding suppression to modify the local copy saturation lookup table12output values by blending the new value with the input saturation value in the banding suppression block14. In some embodiments, a weighted average of the input saturation values and the values from the local copy saturation lookup table12may be used in block14. As a result, color banding may be suppressed in some embodiments.

As a result, in some embodiments, saturation is made more even, the saturation contrast may be improved, and the difference between a pixel and its neighbors may be increased in some cases.

A flow chart, inFIG. 2, shows one sequence26for implementing the functions depicted inFIG. 1. In some embodiments, the color enhancement system10may be implemented in software using a storage device to store computer readable instructions which, when executed, cause the functions depicted inFIG. 1to be accomplished. In other embodiments, hardware may be used for this purpose.

Initially, the local copy saturation lookup table12is initialized and defined, as indicated in block28. In addition, the saturation lookup table16that stores the historical histogram may be defined and initialized at block30. Then, for each pixel in the image, the local variation is measured, as indicated in block32. If the local variation is less than or equal to a predefined threshold PT, as determined in diamond34, the pixel value PV is increased by one, as indicated in block36. The flow iterates until the last pixel in the image has been processed, as indicated in diamond38.

At this time, the information may be normalized to provide 256 interpolated values from a smaller number of values, such as 64, as described above, as indicated in block40. Then, the new histogram is blended with the historical histogram, as indicated in block42. The output luminance is set equal to the input luminance in block44. The output hue is set equal to the input hue in block46. In block48, the output saturation is set equal to the historical lookup table value stored in the local copy saturation lookup table12. Then, in block50, the local copy saturation lookup table value and the input saturation value are blended. When the last pixel is completed, as determined in diamond52, the flow ends.

Turning next toFIG. 3, a graphics processor112may include a video post-processing pipeline that accomplishes the functional blocks ofFIG. 1in one embodiment. The graphics processor112may be coupled to a frame buffer114by a bus106. The frame buffer114may be coupled to a display screen118to display the images produced by the graphics processor112. Buses107and108are coupled to the display screen118which is also coupled to a keyboard or mouse120.

The graphics processor112is coupled by a bus105, in one embodiment, to a chipset core logic110that couples the main processor100and storage130by a bus104. The storage130may include a main memory132, hard drives134, and removable optical or magnetic media136in some embodiments. In some embodiments, the sequence26depicted inFIG. 2may be implemented in software and may be stored in the region139of the main memory132. However, the present invention is not limited to software embodiments. The main memory132may also store the various lookup tables indicated inFIG. 1, in some embodiments. Of course the storage may be in any other storage device or within components such as the main processor100or graphics processor112in some embodiments.

The graphics processing techniques described herein may be implemented in various hardware architectures. For example, graphics functionality may be integrated within a chipset. Alternatively, a discrete graphics processor may be used. As still another embodiment, the graphics functions may be implemented by a general purpose processor, including a multicore processor.