Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.81k stars 318 forks source link

Feature Request: Add Editable Base Curve #2883

Open marcchristopher opened 9 years ago

marcchristopher commented 9 years ago

As discussed over in the RT forum (http://rawtherapee.com/forum/viewtopic.php?f=1&t=6218) it would be advantageous to have a way for creating a base curve that is applied to the linear RAW data (instead of after gamma as the tone curves in the Exposure panel) and very early in the pipeline - probably just before the color profile.

One way how this could be implemented in the GUI would be to put this new base curve into the Color Management tool: There is already a button to read the tone curve that is embedded in a DCP profile, so that very curve could simply be made explicit and editable (maybe hidden at first). And when the profile doesn't have come with a curve, the base curve is simply linear at first, but can be edited by the user.

Such a base tone curve would be useful for various reasons:

  1. It would increase the compatibility with Capture One: The ICM profiles used by CO don't contain a base curve - instead the user is allowed to choose a base curve from a dropdown. At the moment this workflow is not possible with RT. (The two tone curves in the Exposure panel are applied after the rest of the tools and after gamma.)
  2. While "a linear tone curve is the right thing for reproduction work [...], in general-purpose photography the actual scene has typically considerably higher dynamic range than the output media". "The solution to this problem since the early days of photography is to apply an S-shaped tone curve." (Citing http://www.ludd.ltu.se/~torger/dcamprof.html#tone_curves) It is my understanding that such a tone curve should ideally be applied to linear data.
  3. It would also be useful to establish a good baseline look that works for general-purpose photography, without the need for adjusting any of the sliders in the Exposure panel (provided the image has been properly exposed and such). RT could, e.g., come with a set of pre-defined tone curves or allow the user to create new ones.

Thank you for considering this request.

atorger commented 9 years ago

RT's internals is floating point linear since a long time back. The gamma you see in various curves tools (sRGB gamma) is just in the tool to make it easier to use. In the internals the curve itself works in linear gamma, just as the whole pipeline. Only when converting from floating point to a integer output format like JPEG a gamma is applied to the data.

Using an S-shaped "perceptual" curve in the exposure panel on top of a colorimetric DNG or ICC profile should do what you want.

We have some primitive support for C1 profiles already in RT, but it's not really 100% compatible. C1 is an integer-based raw converter with a gamma space internally and is not really a good role model for RT. Lightroom's pipeline is closer to how RT works. I'm thinking about improving the C1 support by moving the ICC application later in the pipeline.

I agree with that it would be nice with a baseline look. There are a few ideas how to best achieve that. Personally I use my own DNG profiles with an embedded tone curve to provide this base look. The closest to this by using the bundled colorimetric RT profiles is to make your own default .pp3 which just applies a "perceptual" tone curve in the exposure panel.

marcchristopher commented 9 years ago

Thanks, atorger, for your reply. I understand that CO is really not a good role model for RT - or for any RAW converter, for that matter. :) I also understand that a curve in the Exposure panel will basically be a good workaround. I'm currently doing just that.

The problem is that both of these tone curves are applied pretty late in the pipeline. In particular, later than the other tools in the Exposure panel. Which makes it difficult to use these tone curves as "base curves", as the effect of the curves will change depending on all the other sliders. That should not be the case for the suggested base curve. (Which has been implemented already, I think, as the curve is read from the DCP. All that remains would be to make this editable.)

Creating DNG profiles with embedded curves is, of course, a possibility. It's only feasible to do that, however, for a limited number of cameras. This quickly becomes inconvenient, if someone is collaborating with a large number of photographers (as in my case) and each camera model needs one or more different base curves (as is the case when using ICM profiles from CO). What's more, this is really not a good solution for non-professionals.

As to the baseline look: Currently, as I see it, all the sliders and curves in the Exposure panel combined will become the baseline look. In my opinion it would be both clearer and better for compatibility to have one user-editable curve that is applied early in the pipeline that sets the baseline look. The user can then further adjust the rendering by using the Exposure panel. Or not.

atorger commented 9 years ago

The tone curves are not added so late in the pipeline. In between the DCP looktable + DCP tone curve and the RGB curves there's only the brightness/contrast sliders. So to be at their "ideal" positions for a camera curve they would be before the brightness/contrast sliders.

marcchristopher commented 9 years ago

Thanks for clarifying that. I agree that the ideal position would be before the brightness/contrast sliders... but also before all the other tools in the Exposure panel (Exposure Comp, Highlight Recovery, Black etc): Not sure, if they are already added later in the pipeline?

BTW, I'm assuming we are talking about the tone curves in the Exposure panel? Or are you talking about the "RGB curves"?

atorger commented 9 years ago

Yes tone curves in exposure panel. RGB curves is applied later. A tone curve should be added after exp comp, high light recovery, black etc, shadows/highlights like they are today. The colorimetric correction (DCP HueSatMap) is done very early in the pipeline, then the look (DCP Looktable and curve) is applied later. The reason is that the first part is scene-referred, but the curve is output-referred, a "look". The curve applied "late" like this is the same way as for example Adobe Camera Raw does it, or indeed Capture One.

(Few know it but Capture One ICC profiles actually do contain a base curve, a mild one, then the main curve is user-selectable. The reason they've split it is to minimize color shift introduced by a plain RGB curve. RawTherapee has solved it by having a "perceptual" tone curve instead.)

Base look with editable curve would be nice though from a GUI arrangement perspective, but the processing pipeline would not really change, except possibly moving the curve before the brightness/contrast sliders.

marcchristopher commented 9 years ago

You mean, the user-selectable tone curve in Capture One is also applied after exposure compensation, black level etc? Indeed, I didn't know that. Thanks for pointing this out. I was under the impression that the selectable curve in CO was part of the scene-referred part of the workflow (correcting for the fact that human vision is non-linear).

I agree with the last part. The possibility to create a base look using a curve and leaving the other sliders for later, would be nice.

atorger commented 9 years ago

I haven't analyzed in detail in exactly which stage Capture One applies the curve. It's surely after exposure compensation, otherwise contrast would change when you adjust exposure. In which order all other of the many tools in there I don't know though.