Hybrid mask

See #817 for history.