Trying to recover a damaged photo

Some relatives mailed me this photo. It’s a one and only smartphone shot from a rainy hike in Iceland. The photo is badly damaged by water on the lens.
Could I do some magic with Darktable to recover the photo?
Below you will find my result. I used a lot of local contrast in combination with masks.
Can anyone do a better job? And how can you recover the “bleeding” of the colors around the yellow hat and the blue backpack? I used spot removal to copy other parts of the background to repair the bleeding. Maybe the channel mixer could do a better job?

Original photo:

My result:

take original file & may be we can help

@Alex7 As it is a photo from a phone I think the jpeg is the original file.

I used only sharpen and the haze removel tool to get the colors in the background nicer.
But I would not try to recover the “bleeding” of the colors around the yellow hat and the blue backpack. I think this photo is more about the story. So it doesn’t need to be perfect.

1 Like

I do agree with @Tobias that the wet lens and its consequences are part of the story that this image tells.

If you do actually want/need to get rid of the bleeding colours then I believe that a RAW editor isn’t the tool for this job, a pixel manipulator, like GIMP, is. darktable does have some retouch facilities, but that one pales in comparison with what GIMP can do. You do need to spend time on getting it right though, there isn’t a quick solution for these kind of edits.

I did not spend much time perfecting this at all, this is just a quick proof of concept. I also did not spend any time in-painting the yellow hat itself, which might
be worth doing.

GIMP: Sharpening and retouching the bleeding colours (hand, blue backpack and yellow hat). Rest was done in darktable (iceland.hike.exr.xmp (10.9 KB))

But as I stated before: I agree with Tobias and I would concentrate on the awesome landscape instead.

1 Like

55104321848d99548fb50039a8e5f2e7024dda23.jpeg.xmp (8.9 KB)

Quick try from FB capture…used very little but key one is dehaze at full strength both sliders…blended in HSV lightness…you can load the jpg as a sidecar on your image to get the xmp data…

Tried a quick couple of things to tone down the hat and halo

1 Like

You can retouch of lighting on hands and cap and to up sharp of mountains from layers (in Gimp fo example). Its only my vision from your jpg.

Thanks to everyone for having a go at improving the photo.

The photo is the original except for the dark patches over the eyes.

I know I could have used GIMP (I have never used it and I have heard that GIMP requires a lot training since the user interface is quite different from Photoshop) or PSE to improve the photo but I was interested in seeing what Darktable can do. And that is actually quite amazing. Masking is a strong feature!

I see now that I got carried away by many layers of local contrast so the colors in the background got lost. Maybe the background should be more blurred/unsharp.

My first attempt was to use the haze removal tool but I soon realized that I needed to address the different patches of blur separately.

@priort I like the colors in your version. Could you explain what you mean by “you can load the jpg as a sidecar on your image to get the xmp data…”?

Sure…so when you make your edits in DT it is usually set up to save sidecar files or xmp files. These text files contain the info about your edit…this is how the non-destructive part works and your original is preserved. This same info in stored for the most part esp for simple edits in your exported jpg. So you can go to lighttable and select your original now in the right panel where it says selected files choose to load a side car. This can be an xmp file if some shares that with you…or as in my case you can download the jpg that I uploaded and select it instead of the sidecar. You may have to change the filter in the select files dialogue to show all files as by default it looks for xmp files…but you can instead select my jpg file as the side care and it will load the edit into your history….so what you can do is this make a duplicate and then load the sidecar (my jpg) into the duplicate and you should have all my steps….

Hi’ @priort

Thank you for a thorough explanation. I haven’t got lighttable so unfortunately I’m not able to follow your instructions. Could you upload the xmp-file to me?

Apart from getting an improved photo, I would also like to study your tricks. You mention FB capture. What is that?

Lighttable is the image editing mode in darktable, not to be confused with Adobe Lightroom.

Of course! Thank you. I was not aware of this facility in lighttable. I will try to follow your instructions….:+1:

Olaf….I just grabbed your photo from FB…no software so I edited a low quality image is what I was trying to say…also you do have lighttable…it is the part of the interface that opens when you start darktable. So select your original and use it. I just suggested for you to make a duplicate incase you have edits of your own to preserve. Now in lighttable you will see in the right panel History Stack…then some options …choose load side car. Now download and use my jpg as if it were an xmp file. When you select load side car it will default to showing only xmp files in the dialog box just change that to all files and select my downloaded xmp…This process will load all the step into your history stack so you can see them. I will look to see if I still have the xmp but I may have deleted it….In DT when you export a jpg it saves the processing steps in the meta data if you select that so you can use them pretty much like an xmp file to retrieve the processing….

That’s what I would do.


55104321848d99548fb50039a8e5f2e7024dda23.jpeg.xmp (18.6 KB)

Another fine result…:grinning:.

I like Todd’s edit most. As sharp as possible without making the picture looking “artifical”. People’s clothes and landscape, with significant darks, look really wet and probably closest to how it looked in real (no fashionable “ETTR” look).
Good work. And good tip on using HSV. Thanks.

Hi’ @priort

Your instructions worked just fine. Thank you very much….:+1: I was not aware that the xmp-data can be stored in the jpg.
I put a black patch over the persons eyes in order to make them unrecognizable and private. But if you are able to load the jpg as a sidecar and get the xmp-data this doesn’t work. Storing the xmp-data in the jpg must be the default since I have not selected storing the processing steps.

You can turn it off…its tempting to avoid sidecars but I think thete are still reasons to keep them…maybe export as tiff ?? Maybe it saves the information too…I haven’t checked…

Hi’ Todd

Thank you for your help and input.

Your trick using the haze removal tool with the HSV Lightness blend mode is excellent. It clearly expands the possibilities when using haze removal. I think that this method should be mentioned in the manual.

Haze removal in combination with this blend mode is a much better choice than using local contrast, which I used extensively in my (first) edit.

After some experiments it turns out that the channel mixer with a mask applied after the color zones module is able to reduce the “bleeding” of the yellow hat even more, see the image below. From left to right it shows the original image, original + color zones and original + color zones + channel mixer.