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.54k stars 1.13k forks source link

How about a lens unspecific Lens Correction Module? #11022

Closed andre-fuchs closed 2 years ago

andre-fuchs commented 2 years ago

Is your feature request related to a problem? Please describe. I am totally in love with darktable first of all! The only thing I find really annoying is the way lens correction is handled. The lensfun project is amazing. But I happen to own some lenses for which there is no profile in the Lensfun database.

I work on Linux and meanwhile I switched from the Flatpack to a Debian binary to use the full range of the Lensfun library which was quite cumbersome, to be honest (Flatpack does contain a fraction only and cannot be extended). Now my Flatpack installation updated automatically to the last update, but I cannot really update the Debian binary in a reasonable way. The point is, that this was a workaround to begin with to get more Lensfun profiles working. Some are still missing and I do not see a point in getting into the creation of Lensfun profiles if I cannot use them immediately.

Describe the solution you'd like So how about some generic sliders to correct distortion from barrel to pincushion like many other apps have? Same could work with vignetting. Not perfectly, of course, but close enough.

Alternatives Or am I missing some module here? Having no such module seems pretty opinionated in favor of the Lensfun project.

Additional context I would like to contribute to the funding of such a module/update. The lens correction module is working great! Including a slider to control basic barrel-to-pincushion distortion should be simple update, I guess. I would put 100 € in the pot.

rabauke commented 2 years ago

@andre-fuchs : Not directly related to your feature request. Have you tried to update the lensfun data base via update‑lensfun‑data? See for example https://lensfun.github.io/manual/v0.3.2/lensfun-update-data.html There is also a script that allows to read Adobe LCP files and convert their content to one Lensfun XML file. See https://github.com/lensfun/lensfun/blob/master/apps/lensfun-convert-lcp

elstoc commented 2 years ago

It's lensfun-update-data on my machine

rabauke commented 2 years ago

@elstoc : Here as well. The reference that I was referring to is apparently slightly outdated.

andre-fuchs commented 2 years ago

Have you tried to update the lensfun data base via update‑lensfun‑data?

Yes, I updated the Lensfun data as I was moving over to the binary package. This is not possible with the Flatpak version though, for example. Understanding Lensfun and getting it to work took me time. I've still got two lenses that I use on a regular basis that are not included. The standard barrel distortion patterns could be corrected easily with a generic approach, I think. My point is, that there is no need for a lens profile often. Lens profiles do not work totally precise either due to sample variation of lenses and multiple construction variants. So the results of a generic approach would not be worse often, I guess, especially with older lenses with spherical elements only. And maybe somebody wants to use (exaggerated) distortion as a stylistic device, too.

elstoc commented 2 years ago

This looks to me like a duplicate of #1990.

I would like to contribute to the funding of such a module/update.

This is a volunteer project and is not funded. There is a developer who takes donations but not for specific work (and I doubt he would be interested in doing this). As a general principle, 100 € doesn't really buy you much developer (a couple of hours if you're lucky) so paying for people to do work isn't really practical. You just have to hope someone wants to do it.

andre-fuchs commented 2 years ago

@elstoc I am aware of hourly rates of developers. I did not want to just ask for more, but offer something in exchange also as an inspiration to others to do likewise. Other open source projects crowd funded features this way. If I could do it with confidence I would just add this little control element myself, but I cannot go down this rabbit hole any time soon.

PeterWem commented 2 years ago

Not an answer to your request, but which lenses do you own without a Lensfun profile?

andre-fuchs commented 2 years ago

@PeterWem Mostly vintage ones, but also a native Sony lens, that I quite love. Here are three that I use most often (and recommend them in general), all without a Lensfun profile. I would like to contribute to these profiles, if I could use them afterwards with darktable 3.8.

Two more thoughts on this: What if the profile is not accurate enough or there is sample variation in lens production? Some of the Lensfun profiles I used for other lenses weren’t matching, sometimes overcorrecting vignetting, for example.

How about a module to correct distortion and vignetting based on a standardized test chart? I mean something like a color test chart, but for distortion and vignetting (black grid (lines or dots) on white background). This could be printed easily by most people on a DIN A4 sized sheet of paper. The automatic perspective correction module worked like magic, for example. Why not have a photo of a test chart in your series to generate the distortion correction on demand. I love the idea behind Lensfun, but why not having the option to correct manually if necessary one way or another?

kmilos commented 2 years ago

I would like to contribute to these profiles, if I could use them afterwards with darktable 3.8.

AFAIK, there should be nothing stopping you from doing that.

PeterWem commented 2 years ago

To me it seems there are minor variations in production or Canon EF 24-105/4L USM was corrected way off in Lensfun. I recorrected for my lens. You have prime lenses and that is good if you want to create lens correction fast. I have a prepared a VirtualBox with the calibration script.

andre-fuchs commented 2 years ago

@kmilos I am repeating myself here. Three issues make me hesitate to create these profiles. And this is not the main question here.

  1. Flatpack My two main machines that I use for RAW development are running on Linux, Pop_OS! to be precise. And although beeing Debian based I am really happy with it for 3 years now. The most user friendly way to install darktable here is Flatpak, which does include a fraction of the Lensfun database only. This cannot be extended.

  2. Debian Binary It was relatively cumbersome to switch from the Flatpak to the binary to get the full database of Lensfun. Following some tutorials I was able to get this running in a couple of hours, or course. But now I could not update to version 3.8 of darktable. Maybe just a matter of time. But I find myself using the Flatpak version more often, to be honest. This could be caused be the marvelous new "diffuse and sharpen" module.

  3. Missing immediacy What is the opposite of immediacy? I mean is, that the whole process of creating these lens profiles is slow and indirect. I would love to create profiles myself, test them immediately and polish them further until I am happy with the result. This could also start with an existing Lensfun profile that might not fit my lens perfectly and needs a bit of tweaking.

The main question again in short: Why no optional manual correction? This could mean profiles on demand or adjusting/overriding of existing profiles via the user interface.

kmilos commented 2 years ago

I get it. Yet, those are not showstoppers. You can always generate the profile and whack it manually into the appropriate xml file yourself. I responded to a very specific comment you made.

andre-fuchs commented 2 years ago

I am aware of the XML files and I also know how to edit them. Generating the profile to start with is not trivial now, these profiles do not work with the Flatpak. Not everybody working with darktable might be used to the these low level rabbit holes and would prefer the user interface of a module. Could be as simple as one or two sliders. Could be as advanced as a color checker calibration.

No Offense! And no offense taken. I would love to do it myself. I reckon that you had these discussions before and decided against individual/manual control here. Just trying to get the ball rolling in this direction. I think, this feature would help not just me.

andre-fuchs commented 2 years ago

You have prime lenses and that is good if you want to create lens correction fast. I have a prepared a VirtualBox with the calibration script.

Thanks Peter! I will give this a try if I find the time.

c-h-r-i-s-t-i-a-n commented 2 years ago

You can do some distortions with the liquify module.

Bild1

abnormally-distributed commented 2 years ago

I agree, a lens correction method with manual adustments would be nice. Or something like rawtherapee's automatic distortion correction, which tries to match the distortion correction for the raw to the embedded JPEG preview (this only works when the JPEG preview is the in-camera processed jpeg and not just a little thumbnail of the raw like for CHDK dngs of course but I get around that with exiftool to write the jpeg the kolari pocket makes to the dng's jpegfromraw tag).

github-actions[bot] commented 2 years 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.