# How are the levels and curves tools are related?

I started to use levels and curves tools quite recently and now I mostly use the second one. Mostly this is due to the fact that I understand the underlied mathematics of curves better than levels. My current understanding of levels is that it is simplified linear version of curves. I mean that those left and right sliders in levels are responsible for the edges of the linear curve like this one (but strictly linear in between). Am I right? Where can I find a strict mathematical description of levels?

The other version of the question: is it always possible to replace levels by curves? Or there are things which can be done only using levels?

Levels are a special case of curves, where the curve is pinned at both ends and has one control point in between. The two pairs of "input levels" and "output levels" specify the coordinates of the end points of the curve.

The "middle value" specificies the degree of curvature. Levels can only have one radius of curvature, so the curve you posted is not possible using levels. A value greater than 1 means the line is bent outward, a value less than one means it's bent inward. Here's what a levels adjustment would look like in the curves tool:

http://www.mattgrum.com/photo_se/curves1.png

Curves may have many more control points and can "double back" having negative slope, meaning two or more different input values can reach the same output value (levels is strictly "one to one" from a mathematical point of view). This is not possible using levels:

http://www.mattgrum.com/photo_se/curves2.png

As such curves are slightly more powerful, but often levels allows you to get to the desired result more quickly as there only five numerical parameters to adjust. Getting exactly the same result in curves is possible but probably requires more clicks.

Yes, you can replace levels with curves. I don't think there is an exact mathematical consistency in the definition of levels, but each level corresponds to a portion of the curve from left to right and will boost or drop it based on the value. I don't know that q factors are published or consistent, but normally they cover roughly 25% of the spectrum with a smooth curve. In Lightroom, I believe you can actually see the impact of the levels on a curve display, but I could be losing my mind.

Generally I use levels if I just need some quick and basic adjustments to a particular region where as I use curves if I need to adjust the exposure curve with more control. I do this since accomplishing the same thing with curves as I can with levels requires multiple control points to be created and requires changes in the interpolation of the curve between control points. (Levels tend to only impact their area and not others where as curves tend to impact the next set of points over.)