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.88k stars 1.15k forks source link

Add noise-reduction stacking for low-light pictures #17328

Closed gluckgluckwasserbauch closed 2 months ago

gluckgluckwasserbauch commented 3 months ago

This feature request is basically part 2 of my previous suggestion, see #17326

In that feature request, I suggested adding a dialogue window to the 'Merge to HDR' button, where pictures can get alligned onto each other.
My idea was, when we're already at it, to extend that feature.


There's a technique called "stacking", where you basically take a series of almost identical dark pictures, and then stack them onto each other. This drastically improves the noise-to-information ratio and is also used in the "Night mode" in many smartphones.

This technique is most famous in astrophotography, where the most popular software used is Siril. In Siril, most astrophotographers put more effort into their work and also create references and stuff, but that isn't needed per se. Using only "lights" (basically the pictures of the stars or whatever) can work fine too.

Of course, Darktable shouldn't exactly do what Siril does, but for low-light pictures, it would be nice to just press the shutter button for a few seconds, get 10 images, and then stack them for noise-free, well-lit pics. Not necessary astro photos, but just "normal" pics, like nature or buildings.

Creating this feature shouldn't be a big step from the improved HDR merge, since the auto-allign also works for pictures shot at night. It would basically be the same feature, but with one toggle more.


This new feature could transform even a relatively cheap compact camera into a great option for night photography!

Right now, my shitty Google Pixel 5 creates almost better low-light photos than my "proper" camera, even though my camera has way better hardware than my phone. The only difference is the software.

Here are two photos I shot right now at bad lighting conditions. PXL_20240814_174811994 NIGHT This one was shot with the shitty phone with the "Night mode" enabled.

And this one was shot with my camera. 1/30s SS, f2.0. DSC00649 I shot 15 of those, but couldn't stack them correctly. But if I would have been able to, they would have come out way better.

I tried it first with Siril, but it always aborted. Probably because there weren't any stars available as reference points. Then I used the G'MIC plugin for GIMP, which alligned the layers and in theory makes a median, but that didn't work too. It was my first time tho.

But, on the bright side, there are countless people using GIMP or Photoshop to merge many photos together, and it works great.

ralfbrown commented 3 months ago

'hugin' already does alignment and stacking, so it will be much more efficient to write a Lua script to invoke the appropriate utility programs in the hugin package rather than writing code which duplicates that functionality.

wpferguson commented 3 months ago

There's already a lua-script, image_stack.lua, that does this.

ralfbrown commented 3 months ago

See, way more efficient :)