I’ve been wanting to learn my way around the darktable code base, and I am thinking about starting by scratching a small itch: some UI/UX improvements to the lens correction module. At least for now, I don’t intend to change the way the image is actually processed, just to experiment with how the options are presented.
Before diving too deep, I thought I share what I’m thinking of doing, and see if other people find it interesting, or if I’m being oblivious to something.
Tweak #1: how to turn on/off specific corrections
Lens correction can do 3 types of corrections: (a) distortion, (b) TC aberrations, and (c) vignette. The user can select which one they want using a dropdown, which goes:
- none
- a+b+c
- a+b
- a+c
- b+c
- a
- b
- c
To me, that seems like a convoluted and not particularly convenient way to do this, and it would feel much simpler to have 3 separate check boxes.
Tweak #2: how to see which correction is available
Lensfun doesn’t always have data for all of distortion, TC aberrations, and vignette. But the module doesn’t directly let you know what’s available. What you need to do is, using the drop down discussed above, pick what you’d like to see, and then look at the “corrections done” field to see if it’s different from what you asked. If it’s different, what’s missing wasn’t available.
Instead, I’d suggest adding, next to each checkbox, an icon of some kind (maybe ○ vs ⦿), together with a tooltip, letting you know which are available, separately from which is active.
Tweak #3: Warnings
If the lens you’re using cannot be found in the lensfun database, the modules warns you with a red triangle and a warning message. I think that’s very useful, because if you turn on the module despite it doing nothing, you might get unexpected results if a later version of the lensfun database does have info on your lens, and darktable starts applying corrections “behind your back”. Those unexpected corrections might even clash with some other edits you made.
However, I think that for the same reason, we should extend that logic to when a lens is available, but you’ve turned on a correction for which lensfun has no data. I’d still include the top level red warning triangle (or maybe just a yellow one?), but also a similar warning triangle next to the relevant check box.
Tweak #4: initialization
When the module is turned on with default parameters, currently, if your lens can be found, all 3 corrections are turned on, even if only a subset is available. Again, to avoid future version of the database silently turning on corrections which were not available when the initial edit was made, I’d like to change the initialization to only tick those corrections that are actually there.
I think that’d be more in line with the general darktable approach than the current behavior: even as new modules or new version of existing modules, or different defaults for existing modules get added in new version of darktable, they do not get auto-applied, and your pictures stay the same as you upgrade, unless you actually go and opt into the new things.
You’d still be able to manually check those corrections that aren’t available if you’d like to opt into them being corrected if a future database makes them available, but you’d get a warning, and that wouldn’t be the default behavior.
Tweak #5: manual mode
Currently, in the lensfun mode, you can apply manual vignette corrections, and you can also tick a box and apply (simple) manual TCA corrections, called TCA override. Or you can switch away from the lensfun mode, into a “only manual vignette” mode, where you can do the same manual vignette corrections, but not the TCA corrections.
I think the “only manual vignette” mode should be renamed “manual”, and that it should not only have the vignette controls, but also the manual TCA controls.
Also (but I’m less sure about that), maybe the vignette and TCA override controls should only be available in the manual mode. People who want to mix and match could use an additional module instance, one in lensfun mode, one in manual mode. That would also make it clearer how these things combine: currently, the vignette control adds to the effect of the lensfun vignette correction, but TCA override replaces it. With two separate module instances, the use can decide what they want.
Then again, for processing efficiency, maybe it’s better to keep it all available in the lensfun mode, but then I’d suggest that manual TCA should be an addition, not a replacement (and if you want it as a replacement, you untick the automatic TCA).
Or maybe there shouldn’t be a lensfun vs manual mode switch, and there should just be a “where do you get your profile from” switch, (embeded, lensfun autodetect, lensfun manual selection, none), and the manual controls would always be available below that.
Tweak #6: manual distortion correction
Having the ability to manually correct for barrel/pincushion distortion would be useful. It’s not as good as having a full lens profile, but it can help some already. The module can already handle it internally thanks to lensfun processing, so all we’d need to do is to expose this in the UI.