get_image_bitmap
Retrieve the current image open in GIMP as an Image object, with optional scaling or region extraction for targeted processing.
Instructions
Get the current open image in GIMP as an Image object with optional scaling and region selection.
No size restrictions — pass any max_width/max_height you need. For large images, omit max_width/max_height to get the full resolution.
Supports two main use cases:
Full image with optional scaling (pass max_width/max_height)
Region extraction with optional scaling (pass region dict)
Parameters:
max_width, max_height: Target dimensions for scaling (aspect-ratio preserved). Omit for full resolution.
region: Dictionary with keys:
origin_x, origin_y: Top-left corner of region to extract
width, height: Dimensions of region to extract
max_width, max_height: Optional scaling for the extracted region
Examples:
Full image at full res: get_image_bitmap()
Full image scaled: get_image_bitmap(max_width=2048, max_height=2048)
Region: get_image_bitmap(region={"origin_x": 0, "origin_y": 0, "width": 512, "height": 512})
Returns:
Image object containing PNG data in MCP-compliant format
Includes width, height, and base64-encoded image data
The returned Image object automatically handles base64 encoding and MIME types according to the Model Context Protocol specification.
Raises:
RuntimeError if no image is open, region is invalid, or export fails
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | ||
| max_width | No | ||
| max_height | No |