Can you recover a curves adjustment from an original and edited image?
Asked 4/6/2017
2 views
2 answers
0
If you have both the original image and the edited version, can you determine a Curves adjustment that reproduces the edit? I’m thinking of edits that act on pixels individually, such as Levels or some color changes. Is every per-pixel transformation equivalent to Curves, and if not, when is it possible to infer a curve from before/after images?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
9y ago
2 Answers
4
You say:
I suppose that all the transformation we can make to an image which operate on one pixel per time (for example levels, saturation, color balance) can just be done with curves.
This is not correct. Some examples include converting to monochrome, making the image sepia toned, or even your example of changing the saturation. Increasing the saturation involves moving the maximum of the red, green, and blue channels away from the other 2 channels. (Or if there are 2 maxima, moving them both away from the third channel.) Since curves applies a separate curve to each channel (or the same curve to all channels), there's no way to achieve that sort of effect for all pixels with just an application of curves.
There is, however, a tool that is able to capture all of these things, and that's a look-up table (aka LUT). A 3D LUT has a red axis, a green axis, and a blue axis. Any triple in the input image can be used to look up a new triple in the LUT. You can apply the same LUT to different images to give them a similar look.
You can figure out the LUT if you have a before and after picture. (Or at least you can figure out a good portion of it, if not the whole thing.) You simply take each pixel in the original image, find its coordinates in the LUT and set it to whatever the corresponding pixel in the output is. If your input image covers most of the range from dark to light in most of the colors, you should get back a LUT that performs the same function.
There are a variety of algorithms for automating the copying of styles from one image to another one. They often do more than just color transfers. Here are a few:
Originally by user22895. Source · Licensed CC BY-SA 4.0
user22895
9y ago
0
Generated from our catalog & community — verify before relying on it.
Not in general. A Curves adjustment is only a channel mapping: it remaps tone values in RGB channels, either together or per channel. Some edits can be represented that way, but many cannot.
For example, saturation changes are not just a simple per-channel curve for all pixels, because they depend on the relationship between channels within each pixel. Conversions like monochrome or sepia also are not generally recoverable as a single curves adjustment.
Even when an edit looks curve-like, you usually cannot know from a flattened edited image whether it came from one global curve, multiple adjustments, or masked/local edits. Different edit combinations can produce similar results.
If both images differ only by one global tonal remapping, you may be able to approximate a curve by comparing corresponding input and output values. But this is only an approximation and not a guarantee of the original edit.
So: sometimes you can estimate a global curve, but you cannot reliably recover a unique curves adjustment for arbitrary image transformations.
Recommended products
UniqueBot
AI9y ago
Your Answer
Related Questions
How are Levels and Curves related in photo editing?
Can GIMP apply Curves as a non-destructive adjustment layer?
Can Photoshop save a color transformation and apply it to another image?
What’s the difference between contrast, levels, and curves in photo editing?
How do the RGB and individual channel curves interact in a single Photoshop Curves adjustment?