inverting photos of color negatives with darktable

Your probably getting those numbers because, the linear file, has an ICC profile in it that it tells RT that it has gamma of 1. Then RT will give you values that are gamma corrected.

If I knew how to drive dcraw properly I would tell you the correct commands. A way around this if to open the .cr2 raw file in RT save it with sRGB profile that has a gamma of 1 as a 16bit tiff. The open the file tiff file in RT, and change the input profile to sRGB with normal gamma. It will then give values that match the intensities of the raw scan.

or in imagemagick just

convert 16bitsRGB.tif -set colorspace sRGB -colorspace RGB 16bitlineargammsRGB.tif

When I have some time I will have a look at this in more detail.

I have been considering adding Kodak Cineon scan system is darktable. Itā€™s now an experimental module :

Results :

7 Likes

Admittedly I donā€™t have any good quality b&w or colour negatives lying around, so this is based on a two (jpeg) downloads I could find on-line.

First impression: Very nice. Both colour and old-fashioned black and white negative.

As always one needs to get accustomed/familiar with the controls and find out where in the workflow you need to do stuff. What is the workflow in this case?

I initially didnā€™t do anything but turn on the module and had a look and go at the controls. Turned out that my example was somewhat underexposed which I can fix with the negative offset slider. Why is this set to 9% and should we try to correct the exposure before turning on this module (which would mean using the histogram).

Anyway: This would be a very big step compared to the current invert moduleā€¦

1 Like
  1. correct the camera or scanner colour using exposure, input profile and white balance (which, in this case, correct the light going through the film to the sensor), to get a scan properly exposed between 0 and 100%, and remove colour casts due to the sensor,
  2. enable negadoctor, and correct:
    1. the Dmin, which is the colour of the orange mask or the density of the film substrate (a colour picker will be added soon),
    2. the Dmax, which is the paper density (same concept as the dynamic range but in dB/log10 unit, instead of the EV/log2)
    3. the WB coefficients (R, G, B) to correct colour casts due to the film emulsion, (colour picker planned here too),
    4. the negative inversion offset, to anchor the black level during the inversion process (9% by default comes from Kodak Cineon recommendations),
  3. then adjust the printing adjustments to your taste.
  4. denoise, sharpen, dehaze if needed.
  5. finish with colour balance if you need more contrast or split-toning / warm paper effects.

The actual pixel operations performed are stupid simple, the whole code takes 5 lines. (But 540 lines of GTK UI madness).

5 Likes

Wow this looks awesome! Iā€™ve recently started scanning negatives on an Epson flatbed and have struggled a bit with colour correction. This seems like a huge step up and something Iā€™d definitely use. Iā€™ll be sure to test it out with my next batch of scans.

trying to get something from sky with ART

I couldnā€™t find the negadoctor module.
Steps I followed:
1 - git clone https://github.com/aurelienpierre/darktable.git
2 - cd darktable
3 - git submodule init
4 - git submodule update
5 - ./build.sh --prefix /opt/darktable --build-type Release
6 - sudo cmake --build ā€œ/home/gustavo/darktable/buildā€ --target install ā€“ -j4
7 - renamed ~/config/darktable to backup my current database and start from fresh
8 - Started darktable as /opt/darktable/bin/darktable

Hei Rei!

Look for the branch negadoctor.

Have fun!
Claes in Lund, Sweden

God morgon, Claes!

I suspected of that, but how does it translate in the building steps? I donā€™t know nothing about git ā€¦

Good info here:
https://rawpedia.rawtherapee.com/Linux#Choose_a_branch
Even if that deals with RawTherapee, the handling of git and branches works the same.

1 Like

Thanks, Claes, that did the job!

For further reference, the correct steps are:

1 - git clone https://github.com/aurelienpierre/darktable.git
2 - cd darktable
2.1 - git checkout negadoctor
3 - git submodule init
4 - git submodule update
5 - ./build.sh --prefix /opt/darktable --build-type Release
6 - sudo cmake --build ā€œ/home/gustavo/darktable/buildā€ --target install ā€“ -j4
7 - renamed ~/config/darktable to backup my current database and start from fresh
8 - Started darktable as /opt/darktable/bin/darktable

1 Like

@anon41087856 negadoctor seems to be very promising.
I did a quick test on two negatives and it was quick and easy to get presentable results.
Color pickers will be great
Thanks for your work, perfect timing, I just started to digitize my negatives last week :grinning:

1 Like

The true beauty of that module is you get a fine control over the dynamic range, especially how much details you want to bring back from the shadows. I find it much better than the examples shown above and even Silver Fast, for that matter. But itā€™s only Kodak magic.

Iā€™m curious about that.
Did Kodak shared the math behind the chemical transforms?

See references here : Improve the negative film inversion Ā· Issue #4113 Ā· darktable-org/darktable Ā· GitHub

2 Likes

Shouldnā€™t gain (500) be a gui parameter?
Or the film density it refers to, according to your description, is an invariant?

The gain is computed as 1 / Dmax, and Dmax is a GUI parameter (but 500 is assuming a 10 bits integer encoding, while everything I do is in floating point). The description is a typical example (with typical values), but every number depends on the film stock used (+ developing process).

1 Like

So, unless we know in advance the film density of the negative weā€™re digitizing, DMAX shouldnā€™t be touched, right?

Same as usual, Dmax is bounded by the abilities of your film emulsion (thatā€™s your max) but a particular capture could use only part of these abilities, and also, it depends on how the scanner has anchored the exposure.

The default Dmax (2.05) corresponds to modern colour emulsions, for B&W you could go as high as 3.8. At this point, I donā€™t know if itā€™s better to set Dmax to the film theoritical value, then adjust the contrast on the print parameters at the end (since everything is highly non-linear, it might be good to use the right pivot during the inversion), or if you can simply adjust the Dmax straight from the beginning to account for your image dynamic range.

1 Like

While the color pickers donā€™t arrive, Iā€™m using the following procedure in trying to get a more precise film setup.
The procedure starts with a negative exposure that contains some unexposed part.
After applying white balance on the exposed part of the negative, I go to color picker and select an area on the unexposed part:

Then I use the R, G and B values to calculate the percentage of each channel relative to 255:

image

Then, in negadoctor, I apply these values on the film Dmin section. This gives me a good starting point:

So far, so good.

1 Like