ThreadedEdgeMask: Reduce memory usage