Hi Sander,
Could you comment on the differences between the pixel math combinations (min vs * ~)?
Of course. Both techniques are valid to generate a combined mask, but I tend to prefer multiplication.
The Min function computes the minimum value from its arguments. The expressions:
Min( mask, star_mask )
Min( mask, ~star_mask )
will yield the least value of the mask and star_mask images (or the inverse of star_mask in the second expression) for each pixel. Where star_mask is black (white), this will obviously give black pixels for sure. An important characteristic of the above expressions is that they return either a mask pixel or a star_mask pixel, but never a combination of them.
Contrarily, the expressions:
mask * star_mask
mask * ~star_mask
will in general give values different from mask and star_mask pixels, except when one of the pixels involved is exactly one or zero, since it multiplies mask by star_mask (inverse of star_mask).
So the second expressions (multiplying expressions) tend to give smoother transitions between the (un)protected stars and their neighboring areas. The expressions based on Min() may yield more abrupt transitions just where mask becomes less than (or greater than) star_mask.