I'm going to continue the gradient compression discussion here, since the new thread is more aimed to the seamless mosaic...
Here is a test image with my new implementation. Basic changes are 3:
a) Multiscale power factor. The original algorithm uses a multiescale gradient evaluation, and creates a gradient map factor that uses the information of all included wavelet scales with the same "behaviour". Now there are "strength" sliders for each layer.
b) I added a new multiplication factor, that depends on the intensity on the original image. This means that contrast in the highlights are amplified more than in the shadows, preventing noise amplification. Also, for astronomical images it had the very pleasant effect of preserving star cores very well.
c) Now the strength value allows "negative" values. That means, small gradients are attenuated, and large gradients amplified.
a and c combined, allowed that we may create a variable compression, based on scale properties. For astronomical images, I found that small or negative small scale strengths, and aggressive large scale ones, with a "linear interpolation" performs quite well.
So, here is an example of this, with the same M42: