darktable-org / darktable

darktable is an open source photography workflow application and raw developer
https://www.darktable.org
GNU General Public License v3.0
9.77k stars 1.14k forks source link

Expose more parameters for manual control in Lens Correction module #1990

Closed junkyardsparkle closed 9 months ago

junkyardsparkle commented 5 years ago

The Lens Correction module in darktable could be made more useful by adding manual adjustment for distortion and vignetting parameters, similar to those that already exist for TCA.

This would provide several benefits:

Ideally, these sliders would always display the actual current values being applied, unlike the current implementation of the TCA sliders, where they show "1.00000" even after a profile is applied, and upon manually changing one value, both shown replace whatever was previously applied, which can be considered a confusing behavior, I think.

If showing the full set of sliders for all parameters of the more complex versions of the polynomials (a, b, c of "ptlens" distortion model and br, vr, bb, vb for complex TCA correction, etc) is considered too "busy" then perhaps a "simple" mode could be shown by default, whith a checkbox for "complex mode". However, given the space used by some modules, and the fact that this one doesn't offer a "blending" section, it might not be unreasonable to display a full set by default, as long as they were slightly distinguished from the more universally relevant "mm", "f/", and "d" etc information at the top.

There may be some uncommonly used models implemented in LensFun, but in practice the profiles generally (all in the current database, AFAIK) use ptlens/poly3 for distortion, poly3 for TCA, and pa for vignetting. How to handle the unlikely case where a profile using other models was loaded would be an open question; in the short term I think simply disabling the controls (perhaps with a way to explicitly activate them to override the profile) would be good enough.

Hopefully this would be not too hard for somebody with some GTK skills. :)

CRThaze commented 5 years ago

I for one would find this very useful, especially since I like to work with scans of some uncommon lenses. Profiles are great, but having the ability to fine-tune would make things even better.

owenjm commented 5 years ago

This would be amazingly useful.

jakubfi commented 5 years ago

I agree, this is a good idea. It is something I played with recently while adding initial, experimental support for lensfun-next. :-) I was planning on extending lens correction module functionality by adding manual controls for other correction parameters and perhaps splitting the module functionality into "automatic" and "manual" tabs, plus cleaning the module logic a bit (to be discussed). Problem is that the new (next) version of lensfun change things around quite a bit in the transformation handling and lens profiles departaments and I would prefer to wait with implementing those changes until a new stable lensfun arrives. On the other hand, I don't think we'll get the new version anytime soon... :-( Anyway, I have this on my todo list.

junkyardsparkle commented 5 years ago

LensFun does seem to be in a state of flux currently; maybe this will allow for any changes to the API that would facilitate this type of feature. When looking at the module source, my brain shut down quickly, but it appeared that the direct CA control was kind of a special case, and I couldn't see how it could be easily applied to the other parameters the same way, but it could be that I'm just stupid. ;)

In any case, I'm glad to hear there's interest in this. Another thing any module re-write might want to consider an additional tab for would be LensFun database updates. Variations on #2869 have become a FAQ at this point; the python script proposed as a solution doesn't really scale with darktable's increasing cross-platform popularity...

matt-maguire commented 4 years ago

One thing that would be useful if the "Scale Factor To 35 mm Equivalent" exif parameter could be used to specify crop factor to lensfun -- at the moment just uses the camera model to look up the crop factor in the lensfundb, but some cameras these days allow crop mode to be enabled when a full frame lens is attached, and in that case the lensfun model will not be scaled corrected to the cropped size capture.

github-actions[bot] commented 4 years ago

This issue did not get any activity in the past 30 days and will be closed in 7 days if no update occurs. Please check if the master branch has fixed it since then.

github-actions[bot] commented 3 years ago

This issue did not get any activity in the past 30 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

hodapp512 commented 3 years ago

This would be a very heavily used feature for me if added. I am constantly desiring to modify the distortion slightly or play with the amount of natural vignetting.

This would be most especially useful for new lenses that I've purchased that don't have lens correction data yet. I would at least be able to create a preset that imprecisely applies lens corrections while I create the lens correction data.

github-actions[bot] commented 1 year ago

This issue did not get any activity in the past 60 days and will be closed in 365 days if no update occurs. Please check if the master branch has fixed it and report again or close the issue.

github-actions[bot] commented 9 months ago

This issue was closed because it has been inactive for 300 days since being marked as stale. Please check if the newest release or nightly build has it fixed. Please, create a new issue if the issue is not fixed.