Dehaze equivalent in darktable or RawTherapee

Yeah, the color shift is the biggest problem, otherwise Darktables Equalizer is already fairly good. If the would allow chroma control on the residual it would work much better I think.

I gave it a quick whack in Gimp with the Wavelet-Decompose plugin and a simple mask based on similarity to the haze color.

(left is the raw as I exported it from DT, right is dehazed in gimp with some simple masking at the sky and around the trees mostly because there was some fugly haloing caused by the non edge-avoiding wavelets the plugin presumably uses).

IMO the lighroom results still look the best - and that with a simple slider. :smile:

it would be really interesting to try to do something a bit more advanced with darktables edge optimized wavelets. But I guess it would be sufficiently painful to extract that code into something usable outside of darktable. :confused:

Gave it another whack, trying to fake what would happen if you could remove the residual in darktables equalizer:

This time at a slightly less extreme setting.


Couldn’t resist and gave it another whack this time just darktable:

  • Equalizer + Parametric Mask
  • Exposure (pushing blacks) + Parametric mask
  • Color correction + Parametric mask
  • Some velvia

IMO quite a good result and more natural looking than the Lightroom one. :smile:


so now we need to get the raw of the star sky to apply your technique to that :smiley:

Here you go guys. Shot this RAW the other night.

1 Like

is it intentional that it needs a login to download the file?

No it is not. Maybe it just needs ANY login (like your own Google login) to work?

try this, it’s a shot of the Milky Way with a decent bit of haze:

hope it helps you guys figure it out. I would love to see something similar in an open-source program.

1 Like

I still would not use dehazing on the night sky. Just mask out the night sky and apply curves + whitebalance and you are mostly there, without any of the ugly artifacts introduced by more local techniques.

Another way is to create a really blury version of the image, so you basically only have the haze, then subtract that. This essentially gives you a low pass filter. You will need to readjust the brightness using some curves but this works too.

The getting rid of the haze/light pollution isn’t so much the problem, it’s getting enough signal that’s hard. And this is where stacking can help a lot as it gives you much better data to work with.

@Michael_Moreau a tip for the next night sky shot, leave to shutter open for a shorter duration, you have massive star trailing in the image. :wink:

That’s what I would do to to your Shot:

  • white balance (spot white balanced on the whole frame then tweaked it a bit)
  • slightly pushed the blacks
  • curves to make the dark parts a bit more dark and bring out the milkyway
  • a double dose of velvia to bring out the colors
  • pushed the low frequencies in the equalizer a bit to bring out the milkyway some more
  • denoise profiled with wavelets for chroma and non local means for luma
  • finally some RL deconvolution from G’MIC, set to exponential

looks even better than the LR dehaze. imho. mind to share the xmp?

There you go:

I want to propose another sample image… :wink: Last week-end I went to the Alpago mountains in Italy, the humidity was quite high and so was the fog in the distance. I shot this picture of a paraglider with a very foggy background. I think this could be a nice test bench. I was inspired by some of the corrections suggested by @Jonas_Wagner.
Here what I applied with darktable:

  • white balance corrections
  • base curve and tone curve tweaking
  • velvia and vibrance enhancements
  • color zone tweaking to improve the greens in the lower part of the image
  • equalizer to increase clarity
  • denoise profiled (wavelet for chroma - non local means for luma)

darktable output (left) - in-camera jpeg with default settings (right)

What do you guys think? The colors recovered don’t fully convince me. Maybe I went to far with the saturation… Unfortunately I don’t have a Lightroom copy to compare its dehaze algorithm.
If you want to experiment with this image feel free to use the RAW file: (updated).


Oh paragliding, I love paragliding :smile:

The file you linked is a JPEG. IMO you recovered a lot already, you are approaching the noise floor when looking at the background. So honestly I’d probably not push it any more. I probably wouldn’t push it much more. The colors you recovered are nice (to me at least). I think you should play with the saturation a bit though. IMO the sky/haze in the background is too saturated.

Did you apply @Jonas_Wagner’s xmp to the image? Your result feels very Velvia-ish to me (not a bad thing necessarily, just takes a minute for my eyes to adjust to it again). :slight_smile:

@Jonas_Wagner thank you for the comment. Sorry, I linked the wrong file! Here the CR2 file: Probably is exactly the saturated haze the thing that doesn’t convince me. Here an improved version, I desaturated a touch the haze:

@patdavid, I started the RAW developing from scratch bud I had a look at the @Jonas_Wagner xmp file. By the way, thank you for all the efforts you put in, I really appreciate the new articles look and this new forum!


Thanks! Played around with it a bit. Arrived at a similar result to yours.
A tip for when you take another shot like that: Expose it to the right (make the image as bright as possible without loosing to much detail in the highlights). That way you will have a lot less noise when processing.

1 Like

The exposure is set longer because I was shooting stuff for a timelapse, not to full-rez pixel peeping :wink:

I was more worried about using a lower ISO setting to capture a cleaner full image than about star trailing that wouldn’t be apparent when down-sized to 1920x1080 (or roughly 2MP).

Today I come across this thread while looking for sharpen methods. I found this very interesting. I was playing a little with one of the images.

I would like to share the results I got. I’m pretty new to raw editors and I have many problems while masking. By the way, I think that the results are reasonable

1 Like

Someone has started working on haze removal IOP for Darktable.
See GitHub - rabauke/darktable: darktable is an open source photography workflow application and raw developer.
It works quite well already and will hopefully make it into the next point release.


1 Like

Meaning this branch: ? It seems it was merged into master, and should appear in darktable 2.4.0.

Has anyone compared with LR6 / the above techniques?