The reconstructed area doesn’t need to be 1:1 the clipped area, sometimes it helps for smooth blending, to get a bit more from the surround.
The wavelets inside also helps to smooth transitions, it depends on your region.
The reason is your image doesn’t have any texture to reconstruct, it’s smooth highlights from the sun disc. The maximum you can do is to remove the magenta highlights and blend valid/clipped regions without sharp edges.
Generally, here is how it works:
- we split each RGB channel into a pyramid of blurry pictures (low-pass filters of increasing radii), and for each blurry scale, compute the difference between the higher scale and the current blur (high-pass filters of increasing radii). The stack of high-pass filters and the coarsest scale of blur is a wavelet decomposition.
- Then, at each pixel:
- the texture term is the sum along all the scales of high-pass filters of the maximum over all RGB channels. This represents the most “sharpness” we can grab from non-clipped channels at this pixel.
- the structure term is the sum, for each channel, along all the scales of high-pass filters, of the interpolated high-pass scales. This “fills” the voids we have in the high-pass scales and ensures smooth gradients, even if it is not as sharp as the texture. It has a chromatic variant (for each RGB channel) and an achromatic variant (as the max of all channels).
- the reconstruction term is the sum of texture and structure terms (again with chromatic and achromatic variants), which represents the most high-frequencies we can restore.
- the blooming term is the sum, for each channel, of all the scales of low-pass filters. It represents the gaussian blur at this pixel. Again, it has a chromatic variant (for each RGB channel) and an achromatic variant (as the min of all channels).
If we take the coarsest scale of blur (called the residual), and sum all the high-pass filters stack on top, it is a straight wavelet synthesis, and we get the original image back. So, in the same logic, we replace the residual by the blooming term (which avoids solid color backgrounds you sometimes get in color-reconstruction algos), and replace the high-pass stack by the reconstruction term, then sum them back altogether.
Then, as a user, you can weight every term in the final mix to favour a sharper or blurrier reconstruction.
TL; DR:
- texture inpaints high frequencies with valid RGB channel if any (in 1D, along channels depth),
- structure inpaints high frequencies by interpolation of the neighbouring pixels (in 2D, along the image plane),
- blooming inpaints the lowest frequency with a pure gaussian blur (in 2D, along the image plane),
- final reconstruction is a × (b × texture + c × structure) + blooming, where a, b, c are user weights (with b + c = 1 no matter what). If a = 0, then you get only blooming, if a = 1, you get full reconstruction.
- each term is again split in two such that term = d × achromatic + e × chromatic (with d + e = 1 no matter what).
Finally, the high-quality reconstruction method runs an extra step of reconstruction but with RGB ratios, instead of RGB channels directly.