RawTherapee vs Darktable: invert scanned B&W negatives

RawTherapee has been my primary raw converter for at least a couple of years. Part of my work involves sorting, scanning and archiving a large collection of historical negatives and transparencies. For this I use a Nikon D7100 (24 mp) for 35mm and a D800 (36 mp) for medium and large format film. RawTherapee does an excellent job of inverting the raw files and adjusting tonal range etc. I then bring the positive images into Gimp for cleaning up, sharpening and any fine tuning before printing. Out of curiosity I tried darktable for this, but my attempts to invert the raw files have been failures. In RT I simply invert the curve, with the bottom left going to top left and the top right to bottom right, then bring in the end points of the curve to meet the histogram, with some variation depending on the tonal range of the image. In darktable, inverting the curves gives a washed out result and even when adjusting this the image ends up clipping both highlights and dark regions. I was finding a similar problem with Aftershot Pro. Is the problem to do with linear vs logarithmic processing, or is something else going on?

This is an interesting topic… would you have the possibility to share at least one sample for experimenting with it? I’d like to see the effect of linear vs. gamma-encoded processing, which I suspect is indeed the reason behind the differences you observe.

The raw files from the D800 are close to 50 mb. Is that okay here?

Yes, file size limit is 100mb.

It may be due to darktable using LAB for most things, including (IIRC) the curves.

Inverting the L curve is very much not what you want to do to invert a negative.

Darktable has a special module for this purpose: The “Invert” module. It looks like this:

With the picker, you can select a region where the base material of the film should be gray. For negatives with orange mask, this could be part of the outer, not exposed, regions of the image. Clicking on the colour field allows to specify the colour directly or selection of a predefined colour. It works great, no reasons to complain about it :grinning:.

Here’s a B&W negative scanned with a D7100 so it’s a bit smaller than the D800. It’s upside down but that shouldn’t matter for this purpose. XAB_0871.NEF (26.5 MB)
Image is copyrighted. It can be used here for testing with Rawtherapee and darktable, but not for other purposes. Thanks.

Chris, try that raw B&W scan I just posted. I haven’t been able to get that invert function to give me a good result with B&W scans, but admit I haven’t gotten into darktable to the same extent as Rawtherapee.

I don’t know how exactly it should look like, but I think the result is reasonable. Could you post an example of a reasonable result?

I used invert without specifying a region but just using the whole image, set black point and exposure (in the exposure module), selected the neutral base curve, and removed the colour noise of your camera. Of course this is only a starting point. Unfortunately, there’s no details in the shadows on the bottom right corner, if this is a problem of the “scan” I would consider some HDR technique to preserve it.

Edit: And, of course, consider making it a B/W in darktable to get rid of the remaining colour cast, especially since it changes over the image.

This one is from Rawtherapee, just basic inverting with the curves, then minor adjustments to align the dark and light points to the histogram. No sharpening or other adjustments, just reduced in size in Gimp.

1 Like

Hm, got it, what about:

This time I did it correct and inverted based on the film material, the image shows the picked region:

Edit: The steps:

Invert based on film colour as explained, exposure, and tone curve (the base curve is neutral, better would have been to set the base curve correct and skip the tone curve). Sharpening is auto-applied, could have it deactivated.


This time with a proper base curve and almost nothing else. There is some general colour cast remaining, therefore the monochrome module. Monochrome above, before monochrome below.

And forget what I wrote in the upper post, I was not careful enough checking the image, therefore the nonsense.

I had a first look at the image, and here are my first couple of considerations:

  • the shot is quite underexposed… I have to apply a +1.7EV exposure compensation to approximately fill the dynamic range, which means that you are using almost only 1/4 of the bits of your RAW file. Here is the histogram of the RAW data, after spot WB and without exposure compensation:

    Maybe you could consider bracketing few shots and then choose the optimal one…
  • RawTherapee seems to apply the RGB curves in gamma-encoded space, not linear… here is what you would get by inverting the linear RGB data (after raising the RAW exposure by +1.7EV):

    and here is the same inverted image after an additional negative gamma compensation of -0.55:

EDIT: the last image is what you would basically obtain with Darktable with a 1.7EV exposure compensation, inverted base curve and an adjustment of the central point in the levels tool:

1 Like

Maybe you can enhance that for PhotoFlow and Filmulator?

1 Like

Okay, that certainly works a lot better. So you need to use the film base? I will need to go through the tutorials more carefully to understand the curve and histogram adjustments as they are completely unfamiliar to what I’m accustomed to. But at least I can see that Darktable is capable of inverting B&W negs with good tonal range. Thanks.

Here’s a screen shot from Rawtherapee. It’s really interesting the way Darktable shows the image as underexposed but in RT it matches the histogram from the camera and requires only small adjustments. Difference in the way it uses gamma?
In RT I just brought the contrast back to 0, inverted using the curve and brought in the end points to match the histogram on the top left, which represents the cropped area.

To be honest, this is the first I’ve heard of PhotoFlow and Filmulator. I’ll check them out to see how their enhancements compare to the tools I currently use. Thanks.

It looks like you have auto exposure correction enabled in RT.

I had Highlight reconstruction checked, but didn’t really mean to. It didn’t make much difference when I unchecked it. But I wasn’t using Auto Levels.

BTW, I cannot understand why the inversion with the curve does not work for you, it works here:

Using the “invert” module is a bit more tricky since you always have to consider that this is applied before the white balance, but the curve is applied afterwards. So for b/w scans you don’t need the “invert” module, but for colour scans it is extremely valuable.

I wanted to avoid problems for @Carmelo_DrRaw and @CarVac when showing the results of their software using your file (@Carmelo_DrRaw already did some some posts above)