maxCleanupResolution

Maximum area (width × height) of the axis-aligned cleanup-region crop. If the mask's bounding rectangle exceeds this limit, the input image is downscaled before cleanup is applied. The cleaned result is then upscaled and written back into the original-resolution image. Use this option to limit peak memory consumption. Memory consumption depends on both the input image resolution and the cleanup area size. Set to 0 to disable the limit. For example, setting it to 1200000 uses approximately 0.5 GB for a 12 MP input image. Whenever possible, prefer running DocumentCleanup on smaller areas instead of relying on this option, as it reduces cleanup quality.

Default is 0.