Sidestep the tonemapper wars, develop your raw files like your granddad did

Interesting. I’m using right now DT 5.7 33 (Windows nightly), and I don’t see the input field, like you have in your screenshot:

Do you use a custom LUT 3D module?

Yep, I added it to see if it makes any difference in practice. A relatively small patch.

If you know how, you can build darktable from my branch. It will give you this and PQ Rec 2020 in the LUT module. Though the LUTs need to be regenerated with a switch for that.

So now there are 2 modes:

  • display-referred to display-referred,
  • scene-referred to scene-referred (extrapolated output)

A tone mapper’s job is to go from scene-referred to display-referred.

Aaand, this is why I’m just playing around in my space rather than issuing a pull request :slight_smile:

but does it have practical consequences for me, if the LUTs put everything inside the [0,1] range? I guess not, right?

There was something about LUTs being an inappropriate tool in this area when Filmic was being introduced, wasn’t there? Or at least, I remember some raw tempers about LUTs, but I don’t remember the details and couldn’t follow the math. It’s been years now (wow) and I don’t know how to easily find the relevant discussions.

On a different note, speaking of film emulations and data sheets, have you been following the work over on Spektrafilm, specifically the technical discussion here? They’ve been doing some amazing work for the last several months, and projects like ART and vkdt have incorporated a lot of it.

You may know this already, but just in case… in the scene referred part of the pipeline, values can be <0 and >1. Tonemappers like agx and filmic don’t just apply an ‘s’ curve for contrast, but also a log curve that brings those values back into the 0-1 range, so no data is clipped.

I’m guessing your luts don’t apply any log curve, thus any value outside the 0-1 range before the lut module will simply be clipped when it is turned on.

If you were to apply a log curve before the lut module, the result would essentially be display referred (0-1) input and display referred output.

If however the luts contained a log curve within them, then you wouldnt need to apply that before the lut, thus the result would be scene referred (<0, >1) input and display referred output (just like agx and filmic).

Either way, I don’t really see how you can have both scene referred input and output.

With your (Claude’s) last commit:

when set to scene-referred, skips the clip and lets values above 1 (or below 0) extrapolate past the LUT’s boundary cell using its local gradient instead of being clamped.

Since there’s extrapolation involved, this no longer guarantees that output stays below 1 (depends on the shape of the LUT, but if the gradient is positive, the extrapolation will produce increasing values as input increases; a negative gradient would be equally undesirable, causing weird inversions).

Thanks for this! I have been aware of 2-3 high quality projects with the same theme, but only superficially, despite the fact that claude use one of these project’s data to kick this off.

Anyway, ran the thread through claude and picked the per pixel spectral upsampling to implement. Laptop was melting at full CPU usage for an hour but I’ve got the results.

Kodachrome (before/after)

velvia (before/after)

yeah, i actually see that, though it’s not too bad. Anyway, the play was to rely on exposure to make the waveform behave

Just pushed some significant changes. Both slide and negative films are now considered being in working state, both needed fixing (Tri-x was always fine)

Most significant was perhaps a fix affecting all color films, based on “On the theory of tone reproduction…” (Jones, 1920). For the rest, check the git log. The spectral upsampling discussed above is baked in.

A gamma variable was discovered that was variable during the physical process too, so that’s a switch now, you can generate LUTs with your own gamma. This might later replace the paper based punch/softness, with papers getting their own “dimension” in the combination of things resulting to LUTs.

NOTE: for all slide films, the LUTs noting punch/softness are all the old garbage and will be removed. Only the 2 ilfochrome and the radiance III versions are considered working

Some samples:

Ektachrome classic radiance III

velvia classic radiance III

reala classic normal (normal is becoming a misnomer here, papers will have their own name, and punch will be controlled by gamma)

portra classic normal

1 Like

Regardless of absolute correctness, damn those look good!

1 Like

Aand here is some Tri-X classic after moving it from geometric mean to spectral reconstruction.

nofilter normal

nofilter punchy

red filter normal

red filter punchy

1 Like

@huge_raw_tinkerer I haven’t used LUTs yet in any of my edits because it felt like I was handing over my creative control to another persons interpretation which often tries to simulate a certain film look. So my question is probably very naive. Why are tone mappers not used after applying the LUT?

As you probably understand, in these LUTs I explicitly set out to include zero interpretation, it all strictly adheres to data.

This changed now a bit as now you can generate the LUTs yourself with your chosen gamma, which was also variable in film development process depending on the lab’s judgment. But even here, the default comes from literature.

The answer to your question is simple: The LUT is supposed to be the tone mapper. Nothing else to it.

2 Likes

It is probably more natural now that I start growing out the LUT approach. I wanted to have gamma adjustable on the fly, and that needs its own tone mapper. So I converted all the LUT generation maths into a new tone mapper module. It’s not pushed to my dt fork yet, want to greatly extend the film/paper/etc options first.

4 Likes

A film emulation module. I am interested in seeing how it develops.

4 Likes

Even if I don’t end up using it I do like the idea of a film emulation module being introduced to DT. If it gives the look I like I will use it. Currently I am using a Fuji Film Provia like style from this forum as my starting point for edits of my Canon R7 so maybe one of these film simulations would work for me. Keep up the good work.

1 Like

It surprises me that Darktable doesn’t already feature a film emulation module, considering how popular film emulations are these days and also the great work others has done like Andrea with spektrafilm.

2 Likes

Can’t wait to try this out. Any idea when?

1 Like