darktable article lede image
compressing dynamic range with exposure fusion

compressing dynamic range with exposure fusion

modern sensor capture an astonishing dynamic range, namely some sony sensors or canon with magic lantern’s dual iso feature.

this is in a range where the image has to be processed carefully to display it in pleasing ways on a monitor, let alone the limited dynamic range of print media.

example images

use graduated density filter to brighten foreground


graduated density filter

using the graudated density iop works well in this case since the horizon here is more or less straight, so we can easily mask it out with a simple gradient in the graduated density module. now what if the objects can’t be masked out so easily?

more complex example

this image needed to be substantially underexposed in order not to clip the interesting highlight detail in the clouds.

original image, then extreme settings in the shadows and highlights iop (heavy fringing despite bilateral filter used for smoothing). also note how the shadow detail is still very dark. third one is tone mapped (drago) and fourth is default darktable processing with +6ev exposure.





tone mapping also flattens a lot of details why this version already has some local contrast enhancement applied to it. this can quickly result in unnatural results. similar applies to colour saturation (for reasons of good taste, no link to examples at this point …).

the last image in the set is just a regular default base curve pushed by six stops using the exposure module. the green colours of the grass look much more natural than in any of the other approaches taken so far (including graduated density filters, these need some fiddling in the colour saturation …). unfortunately we lose a lot of detail in the highlights (to say the least).

this can be observed for most images, here is another example (original, then pushed +6ev):



exposure fusion

this is precisely the motivation behind the great paper entitled Exposure Fusion: what if we develop the image a couple of times, each time exposing for a different feature (highlights, mid-tones, shadows), and then merge the results where they look best?

this has been available in software for a while in enfuse

even with a gui called EnfuseGUI.

we now have this feature in darktable, too.

find the new fusion combo box in the darktable base curve module:


options are to merge the image with itself two or three times. each extra copy of the image will be boosted by an additional three stops (+3ev and +6ev), then the base curve will be applied to it and the laplacian pyramids of the resulting images will be merged.


this is a list of input images and the corresponding result of exposure fusion:

















image from beginning:


note that the feature is currently merged to git master, but unreleased.

Filed under: Blog Development Further Reading Upcoming Feature
These are comments from the old website, archived as static HTML
  1. Hi!

    (Sorry, my English is very poor.)

    I think this method will never replacing an real enfused LDR from exp.bracketed image series, but very interesting idea. I'm using too sometimes in Gimp with composite layers.

    I tested this upcoming future some heavily underexposed raw files from Nikon D90, D7000 and D800 with camera default base curves shipped by Darktable and linear base curves + extracted Nikon ICC input profiles with gamma correction. Images are back- or sidelight landscapes and backlight indoor scenes in various ISO.

    The +3+6EV settings is totally unusable for this cameras, but the only +3EV is nice in first look. +3+6EV is making very ugly halo effect and overexposed high tones. Of course, in +3EV mode the noise level is increased in the recovered deep shadow areas. The noise is very high in homogeneous part like blue sky - but easily kill with masked noise filters. Apart from this the overall result have natural tones, nice look for human eye.

    Nikon D90 have the worst result with unacceptable high level noise especially over ISO400. D800 is the best - maybe thanks for the more higher resolution. All time the week point if the scene have high contrast areas, example Sun behind mountain peek. In this case I have got some ugly dark and bright halo around border of the very bright and very dark parts - in +3EV mode too.

    Yes I know this is an experimental project, but maybe this feature need an independent module in the "Tone group" named "Enfuse" or "Fake HDR". It will been very usable with more adjustable parameters like weight of expo, contrast, saturation, etc. what comes from Enfuse. And it's highly usable with masks! The only three option "none" "+3EV" +3EV+6EV" is very poor.

    I think in the actual state this feature is incapable for fine prints, but sometimes usable to processing content-weighted art photos, were the overall image quality is not the primary consideration.

    Darktable is my only RAW processing tool from ver 1.1RC and I'm very curious as to where You would develop the latest upcoming future. Thx for the works!
  2. AwesomeSauce!

    Is this going to be available for 2.0.x?
  3. This is really cool. Can't wait for release!
  4. Hans Bull on Wed Aug 10 04:19:55 2016:
    This will save me so much processing time! Byebye enfuse! Please get that new stuff released ASAP (ashift too)!
  5. Is this only applicable where you use dual iso, or does it help with images taken with the regular Canon firmware at low exposure?

    It seems quite neat, but I notice the enfused (exfused?) images look like they are quite over-saturated at the border between the trees and the sky, is there a good way of avoiding that? Otherwise it feels like this method could lead to a lot of manual work anyway :/
  6. the images here are taken straight out of camera, no dual iso (from a fuji in this case).

    you can influence the result a fair bit by choosing the base curve accordingly. usually making it more gamma-shaped makes the result flatter/less saturated.

    the laplacian merge indeed sometimes introduces slight overshoots, but in general i think it's better than what we could achieve so far.
  7. i think enfuse is somewhat more powerful because it exposes a few more settings that influence the merge. so in edge cases you may still need it (or we may want to expose more settings in the future).
  8. I really can't wait to try this. I have a lot of photographs that would benefit from this feature. Like Hans Bull said it will be very time saving. Bravo and thank you.
  9. while i don't think there's much i can do against very noisy sensors (not all of them allow to push 6 or 7 stops, even with denoising).. we may be able to improve things or come up with strategies for your halo cases if you care to share example files + xmp?

    as to separate iop: it can't be, as it requires to apply the base curve a couple of times to an image that is boosted in exposure while it's still linear. we could duplicate the base curve, but that would feel artificial.
  10. I'm dying to use this feature!
  11. nope, this will be released as part of the upcoming 2.2.x series.
  12. great to see that feature merged! I previously did that manually: exported three images with darktable and use enfuse afterwards. Raw images contain a lot of dynamic range!
  13. I couldn't find this feature in base curve (Basiskurve). I work with DT 2.0.5
  14. Wow!!! Awesome! When can we expect this release approximately?
  15. Awesome! I have been doing something similar using ufraw and an enfuse frontend, very time consuming. So, now I'm starting on darktable and can't wait to have this feature.
    But please make sure the boosts can be more customized in the sense of custom amounts of boosts as well as custom boost steps. So far, I usually boosted about 3 EV in steps of 0.5 EV. In my experience, more steps resulted in more details in the resulting image.
    In conclusion, I would recommend to have an number field for boost range and another number field for the desired amount of boost steps.
  16. Hmm, this feature seems very interesting. I'm impatient to try it. If it works well, it could be a nice alternative to the shadows and highlights module.
  17. "note that the feature is currently merged to git master, but unreleased." The blogpost (as usual for this project) is about work-in-progress features.
  18. yes, there is already a parameter for the ev difference between shots in the parameters of this module, i thought we may have to extend it that way sooner or later. let's play with it for a while and release a new version once we have a better understanding what else we may need.
  19. Great! Would it possible to build a flatpak, so people could try and test future features?
  20. We only provide source tarballs of all our releases and leave maintaining binary builds to those that know what they are doing. So if you want to create such a thing more power to you, but we won't do it.
  21. Please take a look for Your sample picture. http://www.darktable.org/wp-content/uploads/2016/08/img_0009.jpg
    The bush on the left side is very interesting ;)

    I make some test meantime. The strong aura is visible if the base curve is linear.

    The Darktable make wrong colors with the default settings: some colors have irrational saturation and hue especially in the light shadows, and skin tones is very-very far from the natural look too. So I'm using the most of time Nikon Picture Control icms as input color profile. In this case I don't need adjust the base curve because it is defined in the icm - I must set the base curve to linear in the iop. Otherwise I have too many contrast. But if I use camera-match base curves in the iop with standard or enhanced color matrix as input color profile I have any or really light auras.

    There is a sample where the auras coming out with non-linear base curve too.

    This photo is in right exposure and I never want to take back the deep tones in the real life, but is good sample for the noise and the auras.
    Look the backdrop near the arm on the left side: there are unwanted shadows around the arm. This is fake. And You can see the bigger noise in the originally dark areas. Please note: this is ISO100, what is the native ISO setting in this camera.

    I'll really happy, that the stable release have more control of enfuse in the future. Please think about of the EV differences too. 0-3EV and 0-3-6EV is very wide in the most of case, it have too flat look for the overall image. 0-1, 0-2 and 0-1-2EV is perfect to bring back more details from the deep shadows. It's only +3 option. There are some scene where we don't want or can't taking exp. bracket HDR. Example if there are some moving object, the shutter speed is too slow in the overexposed shot, strong wind, etc. In this situations an underexposed pseudo-HDR maybe good way to taking great photos.

    If You need same D90 D7000 and D800 raw files please send me an e-mail. Nikon revers some rights of the PC icm, so I don't want to share in a blogpost comment.

    Have a nice night!
  22. The last darktable releases were yearly and around Christmas. I can't speak for the devs, but it seems likely that the next release will be around December 2016 (there are already a bunch of unreleased really cool stuff in master ...).
  23. We would prefer to do the release even earlier this time, but no promises.
  24. The feature will be released in darktable 2.2, so you've got a while to wait (unless you compile from source).
  25. thanks for your input + example image!

    right, it does do these halos, very clearly so in your example. the shape of the base curve still greatly influences it, but i suppose you're right and we need to have smaller exposure intervals as well as more control over the merging parameters to be able to better deal with this. i'll see to get some time to work on this.
  26. Dutch_Wolf on Tue Sep 13 08:08:19 2016:
    Finally a reason to enable base curve module ;) (IME it often blows out the highlights quite severely so prefer to deal with curves later in the pipeline, although might need to experiment a bit more with non-default settings to be honest)
  27. if you use opensuse/fedora, you can try the snapshots found in http://download.opensuse.org/repositories/home:/darix:/darktable:/master/
  28. correct me if I'm wrong, boosting the exposure two or three times might be definitely good for underexposed images, while it would be useless for the overexposed. would negative exposure fusion steps, like 0 -3 -6, work for overexposed images and why such negative steps are not implemented in the basecurve?
  29. negative ev doesn't work well in this case, since you'd be pulling in overexposed highlights. this tool doesn't fix a wrong exposure during picture taking, it compresses dynamic range in carefully taken pictures.
  30. the exposure offset is now a parameter in current git. the number of exposures is still 1, 2, or 3 (and i'm reluctant to do more because it becomes kind of slow to process after that).