redact_image_area

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Redaction MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-redaction -- dnx GroupDocs.Redaction.Mcp --yes
Folders, licensing and more →

redact_image_area covers a rectangle with a solid-colour box, permanently hiding whatever is underneath — a face, a signature, a stamp, a region of a scan. Coordinates are in pixels from the top-left of the page. The tool takes no page argument — only the file and the rectangle — so check every page of the output. Example prompt: “Cover the signature block in the rectangle at the bottom of scan.png”.

Tool description (as the AI agent sees it):

Covers a rectangular area of a document page with a solid-color box, permanently hiding image content (e.g. faces, signatures, stamps). Coordinates are in pixels from the top-left corner of the page. Call this tool whenever the user asks to hide, cover, or black out an image area or region in a document. Do NOT pre-check whether files exist — just pass the filename the user provided. The tool resolves files from storage and returns an error with available files if a name is not found. On failure, the response text starts with ‘Image area redaction failed for’ followed by the underlying exception type, message, and inner-exception chain.

Parameters

NameTypeRequiredDescription
fileobjectyesThe document — see FileInput shape
xintegeryesX coordinate (pixels) of the top-left corner of the area to redact
yintegeryesY coordinate (pixels) of the top-left corner of the area to redact
widthintegeryesWidth (pixels) of the area to redact
heightintegeryesHeight (pixels) of the area to redact
colorstringnoFill color for the redaction box — named color (e.g. ‘Black’, ‘Red’) or hex (e.g. ‘#FF0000’). Default: ‘Black’
passwordstringnoPassword for protected documents

Example call

{
  "name": "redact_image_area",
  "arguments": {
    "file": {
      "filePath": "scan.png"
    },
    "x": 100,
    "y": 640,
    "width": 300,
    "height": 120,
    "color": "black"
  }
}

Result

A saved-path message naming the redacted file.

This is the tool for content that has no text layer. Getting the coordinates right is the practical difficulty: use get_document_info for the page dimensions, and check the result visually before relying on it — a box that is 20 pixels too small is a redaction that failed.

On failure the text starts with Image area redaction failed for, followed by the exception type and message.

Example prompts

  • “Cover the signature block at the bottom of scan.png with a black box.”
  • “Black out the photo in the top-right corner.”
  • “Hide the stamp area in the top-left corner of the scan.”