Here is a small tutorial showing how to replace bloomings with Steve's images.
First we open both images and set identifiers to facilitate subsequent work:
with_bloomings is the 32-bit floating point linear integrated image with bloomings;
debloomed is the 16-bit linear image where bloomings have been fixed with a debloomer software tool in other application.
The first step is building a blooming replacement mask. We duplicate the
with_bloomings image and rename it to
blooming_mask.The next screenshot shows the three images with active screen transfer functions applied.
Bloomings are very easy to isolate in a linear image because they consist of nearly saturated pixels. A simple PixelMath expression:
$T > 0.85
allows us to generate a binary mask where pixels are white over bloomings; black elsewhere. The 0.85 cutting value has been found after a couple tries. Usually a value between 0.8 and 0.9 is appropriate. The resulting mask is shown below.
Bloomings usually have a 1-2 pixel border formed by dimmer pixels, and this case isn't an exception. That forces us to expand the mask slightly in order to perform a complete blooming replacement. This can be done very easily with a dilation filter, as shown below.
The next step is smoothing the mask to prevent any hard transitions. Removing the first two wavelet layers acts like a low-pass filter and does just what we want. Note that the mask in the screenshot below has no STF applied.
Now the mask (blooming_mask) must be activated over the 32-bit image. As can be seen on the screenshot below, I've been perhaps too conservative. Instead of a 7-pixel dilation filter a 5-pixel filter might be sufficient. Anyway a slightly larger mask is better to ensure that no blooming residuals will be left in the combined image.
Finally a (masked) minimum operation between
with_bloomings and
debloomed yields the combined result. The PixelMath expression is:
min( $T, debloomed )
and must be applied to
with_bloomings with rescaling disabled and
blooming_mask as the active mask.
It is important to point out that
exactly the same procedure can be used to replace bloomings with real data from a shorter exposure. In this case, as Robert has noted, the LinearFit tool should be used to adapt background and signal levels between both images (large-exposure image with bloomings and short-exposure image without bloomings). After blooming replacement, the regions that have been replaced with short-exposure data will have lower SNR. The same mask can be used to apply a selective noise reduction with wavelets, which will fix this collateral problem perfectly. This is the recommended way to fix blooming artifacts.