Honestly dehazing is likely the wrong tool for this job. Dehazing algorithms generally need to deal with varying levels of haze because of variations in depth - now while the variation in the distance of different stars and the milkyway are gigantic, they are pretty much irrelevant because most of it is empty space.
If you want to take milkyway shots IMO stacking is your biggest friend. This will give you a relatively clean image to work with which can then be whitebalanced, pushed using curves and some form of local contrast enhancement and denoising and of course saturation boosts.
This is the result I got doing pretty much what was described above, using a fairly cheap aps-c camera (a6000) and non exotic lens (24/1.8).
Now back on the actual dehazing thing. It’s something I wanted to do for quite some time. I take a lot of shots when paragliding or generally in the mountains and haze is pretty much always an issue. I currently solve it using either Lab curves or local white balance for the color part and curves + some form of local contrast for the luminance part of the equation, trying to reconstruct depth using painted and parametric masks. But that’s dumb manual labor.
What I want to try when I find some time is to basically use the local contrast (variance) as an estimation of depth/haze, filter it with some edge preserving filter (guided bilateral blur or something) and then use that with an auto detect (or user provided) haze color to subtract the haze.
I lack time and some familiarity with the tools to rapidly prototype the idea so of someone else wants to give it a shot, be my guest.
However, in the darktable version I used a parametric mask, in which I attempted to capture haze by varying the L and b channels. The foreground is relatively unchanged in that version (at least when compared to the original rather than dehazed versions). I also managed to recover some colour using the colour correction module, it looks somewhat similar to the dehaze +50 setting:
It merely moderates the overall brightness of the hazy area, lowering it mildly, while increasing local contrast, rather than explicitly subtracting out brightness.
It doesn’t really remove the haze at all, but it should be more like what you actually perceived when looking at the scene.
(settings: drama of 89, and adjusted blackpoint and whitepoint to taste)
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.
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.
Gave it another whack, trying to fake what would happen if you could remove the residual in darktables equalizer:
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.
I want to propose another sample image… 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: https://drive.google.com/file/d/0B28JOPvq926IZllFTGlaS1VINk0/view?usp=sharing (updated).
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).
@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 pixls.us, I really appreciate the new articles look and this new forum!