Working on a RAW highlight recovery/synthesis idea. Seems to be working.
I have included some of Rawtherapee’s highlight recovery options for comparision.
very interesting. I was at some point thinking about doing something like this. I briefly tried and failed though
As far as I understand, the color propagation method of RT also uses some kind of gradient, but the code is a bit too convoluted for me to properly understand.
Is your implementation available somewhere?
Split the bayer pattern into four half-size images (red, green, green, blue)
Stack and sort these images so you have one image containing the brightest pixels of all the channels, one with the minimum and two in the middle.
Reconstruct the clipped values for the image of minimum values. This is your reference image.
However, it is possible that you are missing some details that are contained in the other channels, so we need to make a better reference image.
We are going to use the minimum image as a reference to reconstruct the clipped values in the next brightest image.
Find the difference between the reference image and the reconstruction candidate. Inpaint the pixels that were clipped in the candidate image on the difference image based on the closest unclipped values.
Add the difference image back to the reference image. We have now reconstructed the highlights on another image in the stack. Average the reference image and the new reconstructed image together to create a new reference image
Repeat this process for the remaining images in the stack. The last image will be the brightest one with the most clipped values.
You now have one grey scale reference image with the most details possible.
… will we ever reconstruct the highlights on the colour channels, what will become of the reference image, find out next time…
Now that you have the best reference image you can have, with the information of all the colour channels, you can use that to reconstruct the highlights of each colour channel.
You must do your white balance before the next step.
It is the same process as before, but the candidate image is one of the colour channels. The clipped pixels are in painted on the difference image between the reference and the colour channel and then the difference image is added to the reference.
This is quite strange. As I was typing “pixls.us” in the address bar to visit the forum I was thinking about highlight recovery and how I’m not able to get anywhere near good results with darktable and how I’m very close to happy with what RawTherapee brings. Seconds later I find this thread and I’m filled with hope! Is there any chance this could be translated into something that could be used in RT?