# How to find curve that correspond to a given transformation?

I am having a little bit of a mathematical approach here... 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.

Is there a way to take the orginal image, the transformed one and find out what curve adjustment can give the same result?

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:

• Your entire first paragraph is wrong. True monochrome and true sepia tone (two tone print as opposed to just visually) are not pixel level transformations so irrelevant to the original question. Saturation (or visually making something sepia tone or even monochrome) however can all be done with curves. Commented Apr 7, 2017 at 14:48
• @RyanFromGDSE Really? Do you have a reference I could read about it? I'm having a hard time understanding how for monochrome you could multiply all the channels by different constants, add those values together, and distribute the result to all 3 channels. But it sounds intriguing! I'd love to learn more. Commented Apr 7, 2017 at 15:38
• Please post a new question. Include two images - an original and one monochrome using your current "multiply, add, distribute" methodology but ask how you could do the same thing with curves. I'll do my best to answer it for you. It may be a better fit for graphicdeesign.stackexchange.com but I don't think its off-topic here either. Commented Apr 7, 2017 at 15:57
• @RyanFromGDSE OK, I've posted it here. Thanks for your time! Commented Apr 8, 2017 at 3:28
• Curves is a 3d LUT Commented Apr 17, 2017 at 14:18

At best you can only makes guesses because you'll have no way to know if it was only one curve applied to the entire image.

For example when I'm working on nearly any photo I almost always have a folder structure that includes: