more specific on mask
added optional constraint parameter to widen and heighten