Comparison of color enhancement algorithmsThis article will look at typical color enhancement approaches and how better algorithms can solve their shortcomings. The problem with current approaches is that they do not fully isolate hue, saturation, and luminance. Color manipulations can result in unintended shifts in the other components. Full isolation of hue, saturation, and luminance allows for more natural-looking results. ContrastOne method of increasing contrast is to apply a s-shaped curve to each of the RGB channels. One issue that arises is that the R:G:B ratio does not stay the same, resulting in saturation shifts (as well as hue shifts). This is most visible as an overall increase in saturation. An algorithm that maintains the R:G:B ratio will not have such dramatic shifts in saturation.
*Original image courtesy Steve Shaw of digitalpraxis.net Brightness/GammaA straightforward approach to manipulating brightness (without changing white or black level) would be to alter the gamma of the image. The problem here is the same with contrast: the R:G:B ratio does not stay the same, resulting in saturation shifts (as well as hue shifts). Of course, an algorithm that maintains the R:G:B ratio does not have this problem.
*Original image courtesy Steve Shaw of digitalpraxis.net SaturationThe problem with CIE L*a*b*Saturation in Lab color space can be changed by multiplying the a and b components by a constant. In the image below, saturation has been decreased to 25%. Note that the blue bar turns purple (and to a lesser extent, red turns orange). This happens because Lab color space is designed for perceptually uniform spacing (the ability to differentiate between colors), not perceptually uniform hue.
The problem with HSLIn HSL space, the L component is calculated by taking the average of MAX + MIN. MAX is whichever of red, green, and blue is greatest. Similarly, MIN is whichever of red, green, and blue is the lowest. By this definition, one of the primary colors is always ignored! This means that HSL saturation cannot maintain constant luminance. The colored bars below have different luminances so they should de-saturate to different shades of grey. With HSL-based corrections however, all the colored bars de-saturate to the same shade of grey.
The problem with Y'CbCrIn Y'CbCr space, the calculation of Y' (luma) glosses over gamma correction and therefore does not maintain constant luminance (see Poynton, Charles. "YUV and luminance considered harmful: A plea for precise terminology in video"). When increasing saturation, this discrepancy causes saturated colors to be brighter than they should be. These colors may pick up a somewhat neon appearance. The solution is to take gamma correction into account to maintain constant luminance as shown below. Doing saturation manipulations in this manner avoids the problems of the other methods presented.
Out-of-Gamut colorsIf saturation is increased too much, colors can end up outside RGB gamut and clip. This can be avoided by increasing saturation just before the point of clipping (for each pixel). Doing so avoids any hue shifts caused by clipping. The 2x2 table below shows the differences between:
Note that subtle hue shifts occur in the wooden ledge the vase sits on, as well as the yellow/brown wall depicted in the painting. SummaryThe examples above illustrate the problem with common color spaces. By paying attention to the principles of color science, it is possible to come up with better algorithms for manipulating and isolating color. GalleryThe images below are some examples of images graded with the better color grading algorithms discussed.
|
||||||||||||||||||||||||||||||