maxMaskBoundingBoxArea

Maximum allowed area (width × height, in pixels) of the axis-aligned bounding box enclosing all non-zero pixels of the mask passed to run(). If the mask's bounding box area exceeds this limit, cleanup is not performed: run() returns the current (unchanged) image with status ERROR_MASK_TOO_LARGE and the undo/redo history is left untouched. Use this option as a hard guard against unintentionally large cleanup regions that would take a long time to process. Execution time of a single cleanup call grows roughly with the mask's bounding-box area, so capping it bounds the worst-case latency of run(). Note the difference from maxCleanupResolution: maxCleanupResolution silently reduces quality by internal downscaling to bound peak memory, whereas maxMaskBoundingBoxArea rejects oversized masks outright so the caller can react (e.g. ask the user to select a smaller area). The default of 600000 (approximately 0.6 MP) is a good fit for typical interactive cleanup on a single object or text block. Set to 0 to disable the limit.

Default is 600000.