i’d like to start a thread about highlight reconstruction here because i missed the opportunity to discuss this on irc yesterday. i have a new implementation which is related to the “colour mode” in dt, but actually works in 2d. but i’m interested: how do people do it? how does it work in rawtherapee for instance?

but first some background for discussion: sensors clip, you can’t get past full well capacity. unfortunately now you do white balancing after that, so an innocent clipped (1,1,1) value becomes magenta, mostly (say (2,1,1.8)). the solution is to clip all channels at the lowest, so they become (1,1,1) after wb and extended clipping. in this example this throws away half of the range in the red channel.

there’s all sorts of hacky business going on that you can do for a single pixel in isolation. but ideally you’d like to reconstruct the brightness from the non-clipped channels (red here) and multiply a colour from the local surroundings.

i thought mean value coordinates were a good candidate for this local interpolation. i know @aurelienpierre likes solving differential equations, Poisson’s equation in this case.

there’s an interesting connection between Poisson’s equation and Laplace pyramids, both facilitate gradient domain editing/blending. side info: i can do a Laplace pyramid up/down pass for a 16Mpix raw in 0.5ms.