gimp-mcp-plugin
v0.6.1GIMP MCP integration for external control of GIMP 3.2
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
check_server
Check whether the GIMP MCP plugin socket is reachable and responding. Returns a status dict: - connected: bool - host / port: where it tried - timeout_seconds: how long each command waits for GIMP (GIMP_MCP_TIMEOUT) - gimp_version: if connected successfully - plugin_version / server_version / version_ok: whether the GIMP plugin matches this server - version_warning: present when they don't match; pass it on to the user - error: description if not connected, or if GIMP is reachable but get_gimp_info failed (connected stays true and no version check is done…
restart_server
Drop and re-establish the connection to the GIMP MCP plugin. Use this when: - GIMP was restarted after Claude Code was already running - The socket connection dropped mid-session - check_server() shows not connected but GIMP is open Returns the new connection status (same format as check_server).
new_canvas
Create a new blank canvas in GIMP and open it in a display window. Parameters: - width: Canvas width in pixels - height: Canvas height in pixels - name: Name of the background layer (default: "Untitled"). It doesn't name the image: GIMP shows a new image as "[Untitled]" until it is saved - color_mode: "RGB" (default), "RGBA", "GRAY", "GRAYA" - fill: Fill color for the background layer. Any CSS color name or hex string: "white" (default), "black", "transparent", "#FF5733", "rgb(100,200,50)", etc. - resolution: DPI resolution, 1-10…
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
color_mode | string | |
fill | string | |
name | string | |
resolution | integer |
get_image_bitmap
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: 1. Full image with optional scaling (pass max_width/max_height) 2. Region extraction with optional scaling (pass region dict) Parameters: - image_index: Which open image to fetch (default: 0 = most recent) - max_width, max_height: Bounds for scaling (aspect-ratio preserved), at least 1. Either…
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
max_height | ||
max_width | ||
region |
get_image_metadata
Get metadata about the current open image in GIMP without the bitmap data. Returns detailed information about the currently active image including: - Image dimensions (width, height) - Color mode and base type - Number of layers and channels - File information if available - Layer structure and properties This is much faster than get_image_bitmap() since it doesn't export the actual image data. Perfect for when you only need to know image properties for decision making. Returns: - Dictionary containing comprehensive image metadata - Ra…
get_gimp_info
Get comprehensive information about the GIMP installation and environment. Returns detailed information about GIMP that AI assistants need to understand the current environment, including: - GIMP version and build information - Installation paths and directories - Available plugins and procedures - System configuration - Runtime environment details - timeout_seconds: how long each command waits for GIMP (GIMP_MCP_TIMEOUT) This information helps AI assistants provide better support and troubleshooting by understanding the specific GIMP setup they're wor…
get_state_snapshot
Return a live visual snapshot of the current image state — no file save needed. AI agents call this to get immediate visual feedback after any edit operation, letting them verify results and decide next steps without saving to disk. Parameters: - image_index: Which open image to snapshot (default: 0 = most recent) - max_size: Maximum width/height of the returned preview in pixels (default: 512, 0 = no scaling). Only shrinks: a smaller image or region comes back at its own size - region: Optional dict {x, y, width, height} to zoom into…
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
label | string | |
max_size | integer | |
region |
get_context_state
Get the current GIMP context state (colors, brush, settings). IMPORTANT: Context state can be changed by the user in GIMP UI at any time. Check context state before operations that depend on specific settings. Returns information about: - Foreground and background colors (RGB/RGBA values) - Current brush and its properties - Opacity setting (0-100%) - Paint/blend mode - Feather state and radius - Antialiasing state Use cases: - Verify colors before drawing operations - Check if feathering is enabled (avoid unwanted blurry edges) - Ensure c…
call_api
Call GIMP 3.2 API methods through PyGObject console. GIMP MCP Protocol: - args[0] is "pyGObject-console" to run code, or "pyGObject-eval" to evaluate expressions - args[1] is a list of Python code strings, run one after another - Commands execute in persistent context - imports and variables persist - Always call Gimp.displays_flush() after drawing operations For image operations, use get_image_bitmap() which return proper MCP Image objects that Claude can process directly. GUIDANCE PROMPTS: - For common operations and best practices, invoke the 'gimp_bes…
| Parameter | Type | Description |
|---|---|---|
api_path * | string | |
args | array | |
kwargs | object |
open_image
Open an image file in GIMP and create a display window. Parameters: - file_path: Absolute path to the image file to open (PNG, JPEG, TIFF, etc.) Returns: - image_id: internal GIMP image ID - width / height: image dimensions in pixels - color_mode: RGB / Grayscale / Indexed - num_layers: number of layers in the image - display_opened: whether a GIMP display window was created
| Parameter | Type | Description |
|---|---|---|
file_path * | string |
open_image_as_layer
Import an image file as a new layer in an open image. Use this to bring another image (texture, reference, cutout, background) into the image being edited. No new image window is opened. Unlike GIMP's File > Open as Layers, which keeps a file's layers separate, the file's visible content always becomes one new layer: a multi-layer file (XCF, PSD, ORA) is merged, and transparency is kept. The layer is converted to the image's color mode; in an indexed image its colors are reduced to that image's palette, so convert the image to RGB first to keep them. An animated GI…
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
image_index | integer | |
layer_name | ||
offset_x | ||
offset_y | ||
position | integer | |
scale | string |
save_xcf
Save the current image as a GIMP XCF file (preserves all layers and metadata). Parameters: - file_path: Absolute path for the output .xcf file - image_index: Index of the image to save (default 0 = first open image) Returns: - status: "success" or "error" - file_path: confirmed output path
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
image_index | integer |
export_image
Export the current image to a raster file (PNG, JPEG, WEBP, TIFF, BMP). Parameters: - file_path: Absolute path for the output file - format: Output format — "png" (default), "jpeg"/"jpg", "webp", "tiff"/"tif", "bmp"; other formats are rejected - quality: JPEG/WEBP quality 0-100 (default 90; ignored for PNG/TIFF/BMP) - flatten: Flatten all layers before export (default True) - image_index: Index of the image to export (default 0) Returns: - status, file_path, format, file_size_bytes
| Parameter | Type | Description |
|---|---|---|
file_path * | string | |
flatten | boolean | |
format | string | |
image_index | integer | |
quality | integer |
batch_export
Export all open images (or a specific one) to a directory. Parameters: - output_dir: Directory to write exported files into - format: "png" (default), "jpeg"/"jpg", "webp", "tiff"/"tif", "bmp"; other formats are rejected - quality: JPEG/WEBP quality 0-100 (default 90) - name_pattern: Filename template — use {name} for image name, {index} for position - image_index: If set, export only that image; omit to export all open images Returns: - exported: list of {file_path, name, width, height} - count: number of files written - errors: list of {index, erro…
| Parameter | Type | Description |
|---|---|---|
output_dir * | string | |
format | string | |
image_index | ||
name_pattern | string | |
quality | integer |
auto_levels
Automatically stretch the tonal range of an image (auto levels / auto stretch contrast). Parameters: - image_index: Index of the target image (default 0) - layer_name: Name of the layer to adjust; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name |
adjust_curves
Adjust tonal curves for a layer. Parameters: - preset: Built-in curve shape — "s_curve" (default), "lighten", "darken", "contrast" - points: Custom control points as [[input, output], ...] (overrides preset): 2-1024 points, each value 0-255, inputs in any order but no two alike. A flat list [input, output, input, output, ...] works too. Anything else is an error, and the layer is left as it was. - channel: "value" (all), "red", "green", "blue", "alpha". "alpha" needs a layer with an alpha channel; "red", "green" and "b…
| Parameter | Type | Description |
|---|---|---|
channel | string | |
image_index | integer | |
layer_name | ||
points | ||
preset | string |
adjust_brightness_contrast
Adjust brightness and contrast of a layer. Parameters: - brightness: -127 to +127 (default 0) - contrast: -127 to +127 (default 0) - image_index: Target image index (default 0) - layer_name: Layer to adjust; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
brightness | integer | |
contrast | integer | |
image_index | integer | |
layer_name |
adjust_hue_saturation
Adjust hue, saturation, and lightness of a layer. Parameters: - hue: Hue rotation -180 to +180 (default 0) - saturation: Saturation shift -100 to +100 (default 0) - lightness: Lightness shift -100 to +100 (default 0) - color_range: "all", "red", "yellow", "green", "cyan", "blue", "magenta" (default "all") - image_index: Target image index (default 0) - layer_name: Layer to adjust; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
color_range | string | |
hue | number | |
image_index | integer | |
layer_name | ||
lightness | number | |
saturation | number |
adjust_color_balance
Adjust color balance (shadows / midtones / highlights) of a layer. Parameters: - cyan_red: -100 to +100 (negative = cyan, positive = red; default 0) - magenta_green: -100 to +100 (default 0) - yellow_blue: -100 to +100 (default 0) - range: "shadows", "midtones" (default), "highlights" - image_index: Target image index (default 0) - layer_name: Layer to adjust; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
cyan_red | number | |
image_index | integer | |
layer_name | ||
magenta_green | number | |
range | string | |
yellow_blue | number |
sharpen
Sharpen a layer using unsharp mask. Parameters: - amount: Sharpening strength 0-500 (default 50.0) - radius: Blur radius for the mask in pixels (default 3.0) - threshold: Minimum difference before sharpening is applied, a whole number 0-255 (default 0) - image_index: Target image index (default 0) - layer_name: Layer to sharpen; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
amount | number | |
image_index | integer | |
layer_name | ||
radius | number | |
threshold | integer |
blur
Apply Gaussian blur to a layer. Parameters: - radius_x: Horizontal blur radius in pixels (default 5.0) - radius_y: Vertical blur radius in pixels (default 5.0) - image_index: Target image index (default 0) - layer_name: Layer to blur; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name | ||
radius_x | number | |
radius_y | number |
denoise
Reduce noise in a layer using GEGL noise-reduction. Parameters: - strength: Noise reduction strength 0-100 (default 50) - image_index: Target image index (default 0) - layer_name: Layer to denoise; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name | ||
strength | integer |
desaturate
Convert a layer to grayscale (desaturate). Parameters: - mode: Desaturation algorithm — "luminosity" (default), "luma", "average", "lightness" - image_index: Target image index (default 0) - layer_name: Layer to desaturate; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name | ||
mode | string |
invert_colors
Invert all colors in a layer (create a negative). Parameters: - image_index: Target image index (default 0) - layer_name: Layer to invert; defaults to the selected layer, else the top layer Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name |
scale_image
Scale an image to exact pixel dimensions. Parameters: - width: Target width in pixels - height: Target height in pixels - interpolation: "cubic" (default), "linear", "none" - image_index: Target image index (default 0) Returns: {status, width, height}
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
image_index | integer | |
interpolation | string |
scale_to_fit
Scale an image to fit within a bounding box, preserving aspect ratio. Parameters: - max_width: Maximum allowed width in pixels - max_height: Maximum allowed height in pixels - interpolation: "cubic" (default), "linear", "none" - image_index: Target image index (default 0) Returns: {status, width, height} — final dimensions after scaling
| Parameter | Type | Description |
|---|---|---|
max_height * | integer | |
max_width * | integer | |
image_index | integer | |
interpolation | string |
crop_to_selection
Crop the image canvas to the current selection bounds. The selection itself stays. With no selection (and autocrop off) this returns an error and changes nothing. Parameters: - autocrop: If True, auto-detect crop bounds instead of using selection (default False) - image_index: Target image index (default 0) Returns: {status, x, y, width, height}: the selection's bounds that the image was cropped to. With autocrop, only {status, width, height}, the image's new size.
| Parameter | Type | Description |
|---|---|---|
autocrop | boolean | |
image_index | integer |
crop_to_rect
Crop the image canvas to an explicit rectangle. Parameters: - x, y: Top-left corner of the crop rectangle - width, height: Dimensions of the crop rectangle - image_index: Target image index (default 0) Returns: {status, x, y, width, height}
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
image_index | integer |
rotate_image
Rotate the entire image. Parameters: - angle: Rotation in degrees, clockwise (negative = counter-clockwise). Multiples of 90 rotate losslessly. Other angles rotate every layer, channel, path and the selection about the image centre with interpolation, and resize the canvas to fit the rotated image; the uncovered corners are transparent. Layers are kept (nothing is flattened). A layer, channel or path with locked contents or position is an error, and the image is left unchanged. - image_index: Target imag…
| Parameter | Type | Description |
|---|---|---|
angle * | number | |
image_index | integer |
flip_image
Flip the entire image horizontally or vertically. Parameters: - direction: "horizontal" (default) or "vertical" - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
direction | string | |
image_index | integer |
resize_canvas
Resize the image canvas without scaling the content. Parameters: - width, height: New canvas dimensions in pixels - anchor: Position of existing content — "center" (default), "top-left", "top", "top-right", "left", "right", "bottom-left", "bottom", "bottom-right" - fill: Color for new canvas areas — CSS color or "transparent" - image_index: Target image index (default 0) Returns: {status, width, height, offset_x, offset_y}
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
anchor | string | |
fill | string | |
image_index | integer |
select_rectangle
Create a rectangular selection. Parameters: - x, y: Top-left corner of the selection - width, height: Dimensions of the selection - operation: "replace" (default), "add", "subtract", "intersect" - feather: Feather radius in pixels (default 0 = no feather) - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
feather | number | |
image_index | integer | |
operation | string |
select_ellipse
Create an elliptical selection. Parameters: - x, y: Top-left corner of the bounding box - width, height: Bounding box dimensions - operation: "replace" (default), "add", "subtract", "intersect" - feather: Feather radius in pixels (default 0) - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
feather | number | |
image_index | integer | |
operation | string |
select_by_color
Select regions by color similarity. The threshold is a color-similarity tolerance in 0-255 sRGB units: a pixel is selected when its color is within that distance of the target. The selection is global to the sampled layer, so a higher threshold also selects other regions with similar colors — a black shape over a gray background selects the background too at threshold 128. Inspect the selection after raising the threshold. The threshold is also not a hard cutoff: GIMP's antialiasing may partially select pixels whose color is slightly beyond it. For a sha…
| Parameter | Type | Description |
|---|---|---|
color * | string | |
image_index | integer | |
layer_name | ||
operation | string | |
threshold | integer |
select_all
Select the entire image canvas. Parameters: - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
select_none
Remove / deselect all selections. Parameters: - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
invert_selection
Invert the current selection (select what is not selected). Parameters: - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
modify_selection
Grow, shrink, feather, border, or sharpen the current selection. Parameters: - operation: "grow", "shrink", "feather", "border", "sharpen" - amount: Pixel radius, 0 or more (default 0): a whole number for grow/shrink/border, any number for feather; ignored for sharpen - image_index: Target image index (default 0) Returns {status, has_selection}, plus x, y, width, height (the selection's bounds) when something is still selected. A shrink or border can leave nothing selected, and on an empty selection the operations do nothing; has_selection is then false.…
| Parameter | Type | Description |
|---|---|---|
operation * | string | |
amount | number | |
image_index | integer |
create_layer
Create and insert a new layer into an image. Parameters: - name: Layer name (default "New Layer") - width, height: Layer dimensions in pixels, from 1 to 524288 inclusive; omitted or None values use the corresponding image dimension. Zero is invalid. - fill: Initial fill — "transparent" (default), "white", "black", or any CSS color; it covers the whole layer, whatever the selection - opacity: Layer opacity 0-100 (default 100) - blend_mode: NORMAL (default), MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, DODGE, BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, H…
| Parameter | Type | Description |
|---|---|---|
blend_mode | string | |
fill | string | |
height | ||
image_index | integer | |
name | string | |
opacity | number | |
position | integer | |
width |
duplicate_layer
Duplicate a layer and insert the copy directly above it, in the same layer group. Parameters: - layer_name: Name of the layer to duplicate, also inside a layer group; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns: {layer_name, layer_id}
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name |
delete_layer
Delete a layer from an image. Parameters: - layer_name: Name of the layer to delete, also inside a layer group - layer_index: Position of the layer among the image's top-level layers, 0 = top (alternative to layer_name) - image_index: Target image index (default 0) Provide either layer_name or layer_index. If neither is given, defaults to the selected layer, else the top layer. Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_index | ||
layer_name |
rename_layer
Rename a layer. Parameters: - new_name: New name for the layer - old_name: Current name of the layer to rename, also inside a layer group - layer_index: Position of the layer among the image's top-level layers, 0 = top (alternative to old_name) - image_index: Target image index (default 0) Returns: {old_name, new_name}
| Parameter | Type | Description |
|---|---|---|
new_name * | string | |
image_index | integer | |
layer_index | ||
old_name |
set_layer_properties
Set properties on an existing layer. Parameters: - layer_name / layer_index: Identify the layer; layer_name also finds layers inside groups, and layer_index is its position among the image's top-level layers, 0 = top (defaults to the selected layer, else the top layer) - opacity: New opacity 0-100 (omit to leave unchanged) - blend_mode: NORMAL, MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, DODGE, BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, HUE, SATURATION, COLOR, LUMINOSITY, or DISSOLVE. Names are case-insensitive and accept spaces or hyphens for underscore…
| Parameter | Type | Description |
|---|---|---|
blend_mode | ||
image_index | integer | |
layer_index | ||
layer_name | ||
opacity | ||
visible |
reorder_layer
Move a layer to a new stack position. Parameters: - new_position: Target stack index among the layer's siblings, counted from the top: 0 = top, 1 = second from the top, and so on; a value past the bottom moves the layer to the bottom, and a negative value moves it to the top. A layer inside a layer group stays in that group, and new_position is its index there. - layer_name / layer_index: Identify the layer (defaults to the selected layer; if several are selected, any one of them, so select only one). layer_name also finds layers inside groups; layer_…
| Parameter | Type | Description |
|---|---|---|
new_position * | integer | |
image_index | integer | |
layer_index | ||
layer_name |
flatten_image
Flatten all layers into a single background layer. Parameters: - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
merge_visible_layers
Merge all visible layers into a single layer. Parameters: - image_index: Target image index (default 0) Returns: {layer_name, layer_id}
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
list_layers
List all layers in an image with their properties. Parameters: - image_index: Target image index (default 0) Returns: {layers: [{index, name, id, visible, opacity, blend_mode, width, height, has_alpha, offsets: [x, y]}], count}. blend_mode is a name create_layer and set_layer_properties take (NORMAL, MULTIPLY, ...); a mode they don't take is named after GIMP's (ADDITION, NORMAL_LEGACY, ...).
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
fill_layer
Fill an entire layer with a solid color. Parameters: - color: Fill color as CSS name, hex, or rgb() string - layer_name: Layer to fill; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Fills the whole layer, also any part outside the canvas, whatever is selected, and leaves the selection as it was (fill_selection fills only the selection). A layer with locked alpha keeps its transparent pixels transparent. Returns status dict.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
image_index | integer | |
layer_name |
fill_selection
Fill the current selection with a color or fill type. Returns an error when nothing is selected; use fill_layer to fill a whole layer. Parameters: - color: Fill color as CSS name, hex, or rgb() string. Used unless fill_type is "background", "pattern" or "transparent"; omit it to fill with the current foreground color - fill_type: "foreground" (default), "background", "pattern", or "transparent" (clears the selected pixels) - image_index: Target image index (default 0) - layer_name: Target layer; defaults to the selected l…
| Parameter | Type | Description |
|---|---|---|
color | ||
fill_type | ||
image_index | integer | |
layer_name |
set_colors
Set the GIMP foreground and/or background color. Parameters: - foreground: New foreground color (CSS name, hex, rgb()); omit to leave unchanged - background: New background color; omit to leave unchanged Returns: {foreground, background} confirmation dict.
| Parameter | Type | Description |
|---|---|---|
background | ||
foreground |
draw_line
Draw a straight line on a layer. Parameters: - x1, y1: Start point - x2, y2: End point - color: Stroke color (CSS / hex / rgb); uses current foreground if omitted - width: Stroke width in pixels, 1-10000 (default 2.0) - tool: "pencil" (default, hard edge) or "paintbrush" (soft edge) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
x1 * | number | |
x2 * | number | |
y1 * | number | |
y2 * | number | |
color | ||
image_index | integer | |
layer_name | ||
tool | string | |
width | number |
draw_rectangle
Draw a rectangle outline (stroke only) on a layer. Parameters: - x, y: Top-left corner - width, height: Rectangle dimensions - color: Stroke color; uses current foreground if omitted - line_width: Stroke width in pixels, more than 0 and at most 2000 (default 2.0) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
color | ||
image_index | integer | |
layer_name | ||
line_width | number |
draw_ellipse
Draw an ellipse outline (stroke only) on a layer. Parameters: - x, y: Top-left corner of the bounding box - width, height: Bounding box dimensions - color: Stroke color; uses current foreground if omitted - line_width: Stroke width in pixels, more than 0 and at most 2000 (default 2.0) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
color | ||
image_index | integer | |
layer_name | ||
line_width | number |
fill_rectangle
Fill a rectangular region with a solid color. Parameters: - x, y: Top-left corner - width, height: Rectangle dimensions - color: Fill color (CSS name, hex, or rgb() string) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
image_index | integer | |
layer_name |
fill_ellipse
Fill an elliptical region with a solid color. Parameters: - x, y: Top-left corner of the bounding box - width, height: Bounding box dimensions - color: Fill color (CSS name, hex, or rgb() string) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
height * | integer | |
width * | integer | |
x * | integer | |
y * | integer | |
image_index | integer | |
layer_name |
gradient_fill
Fill a layer or selection with a gradient. Parameters: - color1: Start color (default "black") - color2: End color (default "white") - x1, y1: Gradient start point (default top-left 0,0) - x2, y2: Gradient end point (defaults to bottom-right of image) - gradient_type: "linear" (default) or "radial" - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
color1 | string | |
color2 | string | |
gradient_type | string | |
image_index | integer | |
layer_name | ||
x1 | number | |
x2 | ||
y1 | number | |
y2 |
add_text
Add a text layer to an image. Parameters: - text: The text string to render - x, y: Position of the text layer's top-left corner (default 0, 0) - font: Font name, as listed by list_fonts (default "Sans-serif"). Common GIMP 2 aliases (such as "Sans") resolve to their GIMP 3 names; an unknown name falls back to a default font and adds a warning to the result. - size: Font size in pixels (default 24) - color: Text color (CSS name, hex, or rgb() string; default "black") - image_index: Target image index (default 0) Returns: {layer_name, layer_id, text_…
| Parameter | Type | Description |
|---|---|---|
text * | string | |
color | string | |
font | string | |
image_index | integer | |
size | integer | |
x | integer | |
y | integer |
edit_text
Edit an existing text layer's content or formatting. Parameters: - layer_name: Name of the text layer to edit - text: New text content (omit to leave unchanged; pass an empty string to clear it) - font: New font name, as listed by list_fonts (omit, or pass an empty name, to leave unchanged). Common GIMP 2 aliases resolve to their GIMP 3 names; an unknown name falls back to a default font and adds a warning to the result. - size: New font size in pixels (omit to leave unchanged) - color: New text color (omit to leave unchanged) - image_index: Target imag…
| Parameter | Type | Description |
|---|---|---|
layer_name * | string | |
color | ||
font | ||
image_index | integer | |
size | ||
text |
list_fonts
List available fonts installed in GIMP. Parameters: - filter: Optional string to filter font names (case-insensitive substring match) Returns: {fonts: [font_name, ...], count}
| Parameter | Type | Description |
|---|---|---|
filter |
apply_drop_shadow
Apply a drop shadow effect to a layer. Parameters: - offset_x, offset_y: Shadow offset in pixels (default 5, 5) - blur_radius: Shadow softness radius (default 10) - color: Shadow color (default "black") - opacity: Shadow opacity 0-100 (default 60) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
blur_radius | number | |
color | string | |
image_index | integer | |
layer_name | ||
offset_x | integer | |
offset_y | integer | |
opacity | number |
apply_gaussian_blur
Apply Gaussian blur as a destructive filter operation. Parameters: - radius: Blur radius in pixels (default 5.0) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name | ||
radius | number |
apply_pixelate
Pixelate a layer using a mosaic/block effect. Parameters: - block_size: Size of each mosaic block in pixels (default 10) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
block_size | integer | |
image_index | integer | |
layer_name |
apply_emboss
Apply an emboss (bas-relief) effect to a layer. Parameters: - azimuth: Light direction in degrees 0-360 (default 315 = top-left) - elevation: Light elevation angle 0-90 (default 45) - depth: Effect depth/intensity, 1-100 (default 2) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
azimuth | number | |
depth | number | |
elevation | number | |
image_index | integer | |
layer_name |
apply_vignette
Apply a vignette darkening effect around the edges of a layer. Parameters: - softness: Edge softness / fade width, 0.0-1.0 (default 0.8) - shape: "circle" (default), "square", "diamond", "horizontal" or "vertical" - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
layer_name | ||
shape | string | |
softness | number |
apply_noise
Add noise/grain to a layer. Parameters: - amount: Noise intensity 0.0-1.0 (default 0.2) - layer_name: Target layer; defaults to the selected layer, else the top layer - image_index: Target image index (default 0) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
amount | number | |
image_index | integer | |
layer_name |
export_icon_sizes
Export an image as a complete icon set for Android or iOS. Android sizes: 48 (mdpi), 72 (hdpi), 96 (xhdpi), 144 (xxhdpi), 192 (xxxhdpi), 512 (Play Store) iOS sizes: 20x1/2/3, 29x1/2/3, 40x2/3, 60x2/3, 76x1/2, 83.5x2, 1024x1 Parameters: - output_dir: Directory to write icon files into - platform: "android" (default) or "ios" - source_image_index: Image to use as source (default 0) - format: Output format — "png" (default), "jpeg"/"jpg", "webp", "tiff"/"tif", "bmp" Returns: {exported: [{size, file_path}], count, platform}
| Parameter | Type | Description |
|---|---|---|
output_dir * | string | |
format | string | |
platform | string | |
source_image_index | integer |
export_web_optimized
Export an image as both JPEG and PNG, choosing the smaller format. Parameters: - output_dir: Directory to write output files - jpeg_quality: JPEG quality 0-100 (default 85) - png_compression: PNG compression level 0-9 (default 9) - max_width / max_height: Optional scaling before export - image_index: Source image index (default 0) Returns: {jpeg_path, jpeg_size, png_path, png_size, recommendation}
| Parameter | Type | Description |
|---|---|---|
output_dir * | string | |
image_index | integer | |
jpeg_quality | integer | |
max_height | ||
max_width | ||
png_compression | integer |
warp_region
Warp / liquify a region of the image by pushing pixels in a direction. Works like GIMP's Warp Transform tool in "Move pixels" mode. Ideal for subtle facial expression edits — e.g. turning a neutral mouth into a smile by pushing the mouth corners upward. An active selection limits the change. All vectors are applied together as one undo step. Parameters: - vectors: List of warp stroke dicts, each with: - x, y : center of the warp influence (image pixels; required) - dx, dy : push direction — negative dy = push upward (required,…
| Parameter | Type | Description |
|---|---|---|
vectors * | array | |
image_index | integer | |
layer_name |
batch_resize
Resize all open images to a common target size. Parameters: - width / height: Target dimensions in whole pixels, above 0 (provide one or both) - scale_factor: Proportional scale, above 0 (e.g. 0.5 = 50%); overrides width/height if set - maintain_aspect: Preserve aspect ratio (default True). With only one dimension the other follows; with both, each image fits inside width x height. One of width, height or scale_factor is required. Bad values, no open images, or a result above GIMP's 524288-pixel limit for any image are errors, and no image is res…
| Parameter | Type | Description |
|---|---|---|
height | ||
maintain_aspect | boolean | |
scale_factor | ||
width |
export_sprite_sheet
Combine multiple frames into a sprite sheet PNG with a transparent background. Every cell has the size of the first frame; larger frames are cut to it. Each frame is drawn at full opacity in Normal mode, with its mask and filters; hidden layers are made visible and included. Parameters: - output_path: Absolute path for the output PNG file - columns: Number of columns in the grid (defaults to square root of frame count) - padding: Pixel gap between frames (default 0) - source: "layers" (each layer is a frame, starting at the layer's top-left corner; defau…
| Parameter | Type | Description |
|---|---|---|
output_path * | string | |
columns | ||
image_index | integer | |
padding | integer | |
source | string |
export_social_media_kit
Export an image resized for multiple social media platforms. Platform sizes (all in pixels): - instagram_square: 1080x1080 - instagram_story: 1080x1920 - twitter_header: 1500x500 - facebook_cover: 820x312 - youtube_thumbnail: 1280x720 Parameters: - output_dir: Directory to write output files - platforms: List of platform names to export (omit for all five) - image_index: Source image index (default 0) Returns: {exported: [{platform, file_path, width, height}], count}
| Parameter | Type | Description |
|---|---|---|
output_dir * | string | |
image_index | integer | |
platforms |
list_images
List all images currently open in GIMP. Returns: - images: list of {index, image_id, name, width, height, color_mode, num_layers, file_path, is_dirty} - count: total number of open images
set_active_image
Raise a specific image's window to the front in GIMP. Only windows the plug-in opened (open_image, new_canvas) can be raised. For an image whose window was opened in GIMP directly or by call_api code (Gimp.Display.new), or was closed, this fails with an error; other tools still work on it by image_index. Parameters: - image_index: Index of the image to activate (from list_images) Returns status dict.
| Parameter | Type | Description |
|---|---|---|
image_index * | integer |
undo
NOT SUPPORTED on GIMP 3.x: this tool always fails. GIMP 3.x gives plug-ins no way to perform an undo: its API only groups operations into undo steps. The call raises with an explanation rather than undoing anything (scriptable undo is tracked in issue #86). Do not plan a workflow around being able to undo. Instead: - work on a copy (duplicate_layer) and delete it to revert, or - check with get_state_snapshot before a change that is hard to reverse. A human can still press Ctrl+Z in GIMP. Most drawing and editing tools group their changes, so one Ctrl+Z revert…
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
steps | integer |
redo
NOT SUPPORTED on GIMP 3.x: this tool always fails. Same limitation as undo: GIMP 3.x gives plug-ins no way to perform a redo. The call raises with an explanation rather than redoing anything. A human can still press Ctrl+Y in GIMP. Parameters: - steps: Ignored (kept for client compatibility) - image_index: Ignored (kept for client compatibility)
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
steps | integer |
convert_color_mode
Convert an image to a different color mode. Parameters: - mode: "RGB", "RGBA", "GRAY", "GRAYA", or "INDEXED". RGBA and GRAYA also add an alpha channel to every layer. An image already in the requested mode is left as it is. - num_colors: Number of colors for INDEXED mode, 1-256 (default 256), no dithering. INDEXED needs an 8-bit non-linear image without layer groups. An image that is already INDEXED keeps its palette; to use fewer colors, convert it to RGB first. - image_index: Target image index (de…
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
image_index | integer | |
num_colors | integer |
close_image
Close an image, optionally saving as XCF first. Closes images whose window the plug-in opened (open_image, new_canvas) or that have no window. An image whose window was opened in GIMP directly, or by call_api code (Gimp.Display.new), can't be closed from here: this fails with an error and the image stays open. Unsaved changes are discarded without asking. Pass save_first=True to keep them as XCF (export_image flattens by default, so it doesn't keep layers). Parameters: - image_index: Index of the image to close (default 0) - save_first: If True, save as X…
| Parameter | Type | Description |
|---|---|---|
image_index | integer | |
save_first | boolean |
get_selection_bounds
Get the bounding rectangle of the current selection. Parameters: - image_index: Target image index (default 0) Returns: {has_selection, x, y, width, height}
| Parameter | Type | Description |
|---|---|---|
image_index | integer |
get_pixel_color
Get the color of a single pixel. Parameters: - x, y: Pixel coordinates relative to the layer's top-left corner (whole numbers). For a layer that covers the canvas at offset (0, 0), these are image coordinates; otherwise subtract the layer's offsets (list_layers). A point outside the layer is an error that gives the layer's size and offsets. - image_index: Target image index (default 0) - layer_name: Layer to sample from; defaults to the selected layer, else the top layer Returns: {color_hex, color_rgb: [r, g, b], alpha} - color_hex / color_rgb: 8-bit…
| Parameter | Type | Description |
|---|---|---|
x * | integer | |
y * | integer | |
image_index | integer | |
layer_name |
get_histogram
Get histogram statistics for a channel of the selected layer (else the top layer). Parameters: - channel: "value" (the brightest of red, green and blue; default), "luminance" (perceived brightness), "red", "green", "blue", "alpha". A grayscale layer has only "value" and, with an alpha channel, "alpha"; "alpha" needs a layer with an alpha channel. - image_index: Target image index (default 0) Returns: {mean, median, std_dev, pixels, count} - mean, median, std_dev: on a 0-255 scale, whatever the image's precision - pixels: number of pixels counted; wit…
| Parameter | Type | Description |
|---|---|---|
channel | string | |
image_index | integer |