ENH: masking strategy for homogeneous background