Thank you @xfer
Lately i’ve made some progress. Here is a somewhat usable version:
It does not introduce any additional dependency, so to try it, just checkout the filmnegative
branch from the above repo, and compile normally as per the RawPedia instructions.
I wanted to limit my modifications to the bare minimum, but unfortunately i had to touch a bunch of files in order to support parameters load/save and connect all the layers between the toolpanel and rawimagesource.
I tried to figure things out by looking at similar interactions made by other toolpanels like gradient.cc and whitebalance.cc. Code-wise, it doesn’t seem too crazy to me, but i’m not sure, since i’m not a C++ programmer.
Here is how it works (or should work) from a user standpoint:
- open a raw image (only bayer sensor supported at the moment, otherwise the tool is not shown in the panel)
- select the “Raw” page.
- scroll down and enable the “Film Negative” tool. This should give you a positive image, using the default exponents which should be ok for a modern Kodak ColorPlus 200.
- now, perform white balance as usual; actual values will not be the same that you would have with a normal, positive picture. The easiest way is to use spot WB.
- adjust exposure / contrast / tone curves as you would do with a normal, positive picture. You’re done.
- bonus: to get more accurate exponents for any film type, you can use the “Pick white and black spots” button. Think of it like a sort of “dual spot white balance”. Click on it, then select a piece of clear unexposed film (for example the strip between frames, or on the sides where the perforations are. Then click on a dense, highly exposed spot (that was white or bright gray in the original scene). Actually, the order in which spots are picked does not matter. After you select the second spot, the exponent sliders are updated with values guessed from the spots, and the processing is started.
Here is an example; the green arrows show location of the chosen spots. The result is shown below:
You only have to do this exponents calculation once per roll. If you have several film rolls of the same type and the same age, most probably they will work fine with the same exponents.
Here is what’s still missing:
- only raw, bayer sensor images are supported. Can someone post, or PM me a Fuji X-Trans raw file that i can use for testing?
- thumbnails still appear as negative. Other processing functions like exposure, contrast, WB are reflected in the thumbnail, but not the film negative raw calculations. I didn’t track down the exact path in the source code, but i guess the thumbnail is obtained from the jpeg preview embedded in the raw file.
- after applying reciprocal and exponent,
RawImageSource::filmNegativeProcess
does a “pre-balance” of the image in order to make WB easier. Channel multipliers are guessed from the median of each channel and are not saved as parameters in the processing profile. This may not be very future-proof because, should we ever change the way those multipliers are “guessed” in the future, an existing processing profile made with a previous version of RT would now yield a different result, forcing the user to re-balance all his previous photos. I wonder if it would be wise to always save the “guessed” multipliers along with the exponents, to make sure the same pp3 will alway produce the same output. And re-guess new multipliers only when the user changes an exponent.
Should i send a PR now, or try to fix the above issues first? Do you see other problems in the code? What about the usability?
Please send opinions / feedback / suggestions …
Thanks!