Photoshop Plugins Photoshop Filters Color Correction

Comparison of color enhancement algorithms

This 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.


One 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.


Contrast increase via s-shaped curve on the RGB channels.

Contrast increase that maintains the R:G:B ratio.

*Original image courtesy Steve Shaw of


A 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.

Brightness lowered via gamma.

Brightness lowered while holding the R:G:B ratio constant.

*Original image courtesy Steve Shaw of


The 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.


Saturation reduced via Lab.

The problem with HSL

In 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.


Saturation reduced via HSL.

The problem with Y'CbCr

In 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.

Normal Y'CbCr-based saturation.

Modified algorithm with constant luminance.

Out-of-Gamut colors

If 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:

  • An algorithm with and without out-of-gamut handling.
  • Luminance calculated correctly and incorrectly (depending on whether gamma correction is taken into account), as discussed previously in the problem with Y'CbCr.
  Normal Y'CbCr-based saturation. Modified algorithm with constant luminance.
No out-of-gamut handling.
With out-of-gamut handling.

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.


The 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.


The images below are some examples of images graded with the better color grading algorithms discussed.

Base grade.

Final image.

Source: Maxsomma, "Fishermen's Beach 2".

Base grade.

Final image.
Source: Lizerixt, "A Foggy Morning".



Home   |  White Papers  |  Support/Manuals |  Demo | Contact  |  Store | Privacy policy & Terms of Use | Licensing

Products: Boundary Noise Reduction [reviews] | Colormancer color correction tools