GIMP 3 MCP

v0.2.0
io.github.tifyr/gimp3-mcp Checked 3 days ago Published 2 months ago

Let AI assistants paint, edit and export images in a running GIMP 3, with 80 tools.

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 - gimp_version: if connected successfully - error: description if not connected Use this before any other operation to verify the GIMP plugin is running. If not connected, open GIMP and run Tools > MCP > Start MCP Server.

restart_server

Drop and re-establish the connection to the GIMP MCP plugin. Use this when: - GIMP was restarted after the MCP client 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: Image name reported by list_images, also used for the background layer (default: "Untitled") - color_mode: "RGB" (default), "RGBA", "GRAY", "GRAYA" - fill: Background: "white" (default), "transparent", or a color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) - resolution: DPI resolution (default: 72) R…

ParameterTypeDescription
height *integer
width *integer
color_modestring
fillstring
namestring
resolutioninteger

get_image_bitmap

Get an open image in GIMP as an Image object with optional scaling and region selection. Renders the image data (all visible layers), independent of GIMP's zoom or scroll. 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: - max_width, max_height: Box to scale the image into, preserving aspect ratio (smal…

ParameterTypeDescription
image_indexinteger
max_height
max_width
region

get_image_metadata

Get metadata about an open image in GIMP without the bitmap data. Parameters: - image_index: Which open image to describe (default 0 = most recently opened; see list_images) Returns detailed information about the 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…

ParameterTypeDescription
image_indexinteger

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 This information helps AI assistants provide better support and troubleshooting by understanding the specific GIMP setup they're working with. Returns: - Dictionary containing comprehensive GIMP environ…

get_state_snapshot

Return a live visual snapshot of the current image state — no file save needed. A shortcut for get_image_bitmap with a single max_size and x/y region keys. 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: Longest side of the returned PNG in pixels (default: 512). The image or region is scaled to fit, so small regions are enlarged: positions in the snapshot a…

ParameterTypeDescription
image_indexinteger
labelstring
max_sizeinteger
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 as sRGB hex ("#rrggbb", as tools accept) and alpha 0-1 - Current brush and its properties - Opacity setting (0-100%) - Paint mode, named like set_layer_properties blend modes (e.g. "NORMAL") - Feather state and radius [x, y] - Antialiasing state Use cases: - Verify colors before d…

call_api

Call GIMP 3.2 API methods through PyGObject console. GIMP MCP Protocol: - Use api_path="exec" to execute Python code in GIMP - args[0] should be "pyGObject-console" for executing commands - args[1] should be array of Python code strings to execute - Each array item runs as its own exec(): put a multi-line block (for/if/def) in ONE item with embedded newlines, not split across items - Only print() output is returned (one string per item); bare expressions are not echoed. To get values back, use args[0] = "pyGObject-eval" with a list of expressions, e.g…

ParameterTypeDescription
api_path *string
args
kwargs

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

ParameterTypeDescription
file_path *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 = most recently opened; see list_images) Returns: - status: "success" or "error" - file_path: confirmed output path

ParameterTypeDescription
file_path *string
image_indexinteger

export_image

Export the current image to a raster file (PNG, JPEG, WEBP, TIFF). Parameters: - file_path: Absolute path for the output file - format: Output format — "png" (default), "jpeg", "webp", "tiff" - quality: JPEG/WEBP quality 1-100 (default 90; ignored for PNG/TIFF) - 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

ParameterTypeDescription
file_path *string
flattenboolean
formatstring
image_indexinteger
qualityinteger

batch_export

Export all open images (or a specific one) to a directory. Parameters: - output_dir: Directory to write exported files into - format: "png", "jpeg", "webp", "tiff" (default "png") - quality: JPEG/WEBP quality (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 any export errors

ParameterTypeDescription
output_dir *string
formatstring
image_index
name_patternstring
qualityinteger

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 active layer Returns status dict.

ParameterTypeDescription
image_indexinteger
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], ...] override (overrides preset) - channel: "value" (all), "red", "green", "blue", "alpha" - image_index: Target image index (default 0) - layer_name: Layer to adjust; defaults to active layer Returns status dict.

ParameterTypeDescription
channelstring
image_indexinteger
layer_name
points
presetstring

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 active layer Returns status dict.

ParameterTypeDescription
brightnessinteger
contrastinteger
image_indexinteger
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 active layer Returns status dict.

ParameterTypeDescription
color_rangestring
huenumber
image_indexinteger
layer_name
lightnessnumber
saturationnumber

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 active layer Returns status dict.

ParameterTypeDescription
cyan_rednumber
image_indexinteger
layer_name
magenta_greennumber
rangestring
yellow_bluenumber

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 (default 0) - image_index: Target image index (default 0) - layer_name: Layer to sharpen; defaults to active layer Returns status dict.

ParameterTypeDescription
amountnumber
image_indexinteger
layer_name
radiusnumber
thresholdinteger

blur

Apply Gaussian blur to a layer. Same as apply_gaussian_blur, but with separate horizontal and vertical radii. 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 active layer Returns status dict.

ParameterTypeDescription
image_indexinteger
layer_name
radius_xnumber
radius_ynumber

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 active layer Returns status dict.

ParameterTypeDescription
image_indexinteger
layer_name
strengthinteger

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 active layer Returns status dict.

ParameterTypeDescription
image_indexinteger
layer_name
modestring

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 active layer Returns status dict.

ParameterTypeDescription
image_indexinteger
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}

ParameterTypeDescription
height *integer
width *integer
image_indexinteger
interpolationstring

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

ParameterTypeDescription
max_height *integer
max_width *integer
image_indexinteger
interpolationstring

crop_to_selection

Crop the image canvas to the current selection bounds. 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} — crop region applied

ParameterTypeDescription
autocropboolean
image_indexinteger

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}

ParameterTypeDescription
height *integer
width *integer
x *integer
y *integer
image_indexinteger

rotate_image

Rotate the entire image. Parameters: - angle: Rotation in degrees — 90, 180, 270 use lossless GIMP rotation; other values rotate all layers about the center with interpolation, enlarge the canvas to fit, and flatten - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
angle *number
image_indexinteger

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.

ParameterTypeDescription
directionstring
image_indexinteger

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: New canvas areas: "transparent" (default) or a color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple). A color is painted on a new bottom layer named "Canvas fill"; existing layers and the…

ParameterTypeDescription
height *integer
width *integer
anchorstring
fillstring
image_indexinteger

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.

ParameterTypeDescription
height *integer
width *integer
x *integer
y *integer
feathernumber
image_indexinteger
operationstring

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.

ParameterTypeDescription
height *integer
width *integer
x *integer
y *integer
feathernumber
image_indexinteger
operationstring

select_by_color

Select regions by color similarity. Parameters: - color: Target color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) - threshold: Color similarity tolerance 0-255 (default 15) - operation: "replace" (default), "add", "subtract", "intersect" - image_index: Target image index (default 0) - layer_name: Layer to sample from; defaults to active layer Returns status dict.

ParameterTypeDescription
color *string
image_indexinteger
layer_name
operationstring
thresholdinteger

select_all

Select the entire image canvas. Parameters: - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
image_indexinteger

select_none

Remove / deselect all selections. Parameters: - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
image_indexinteger

invert_selection

Invert the current selection (select what is not selected). Parameters: - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
image_indexinteger

modify_selection

Grow, shrink, feather, border, or sharpen the current selection. Parameters: - operation: "grow", "shrink", "feather", "border", "sharpen" - amount: Pixel radius for grow/shrink/feather/border; ignored for sharpen - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
amount *number
operation *string
image_indexinteger

create_layer

Create and insert a new layer into an image. Parameters: - name: Layer name (default "New Layer") - width, height: Layer dimensions; defaults to image dimensions - fill: "transparent" (default) or a color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) - opacity: Layer opacity 0-100 (default 100) - blend_mode: NORMAL (default), MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, DODGE, BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, HUE, SATURATION, COLOR, LUMINOSITY or…

ParameterTypeDescription
blend_modestring
fillstring
height
image_indexinteger
namestring
opacitynumber
positioninteger
width

duplicate_layer

Duplicate a layer and insert the copy above it. Parameters: - layer_name: Name of the layer to duplicate; defaults to active layer - image_index: Target image index (default 0) Returns: {layer_name, layer_id}

ParameterTypeDescription
image_indexinteger
layer_name

delete_layer

Delete a layer from an image. Parameters: - layer_name: Name of the layer to delete - layer_index: Position index of the layer (alternative to layer_name) - image_index: Target image index (default 0) Provide either layer_name or layer_index. Defaults to active layer if neither given. Returns status dict.

ParameterTypeDescription
image_indexinteger
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 - layer_index: Position index alternative to old_name - image_index: Target image index (default 0) Returns: {old_name, new_name}

ParameterTypeDescription
new_name *string
image_indexinteger
layer_index
old_name

set_layer_properties

Set properties on an existing layer. Parameters: - layer_name / layer_index: Identify the layer (defaults to active layer) - opacity: New opacity 0-100 (omit to leave unchanged) - blend_mode: Omit to leave unchanged, or one of NORMAL (default), MULTIPLY, SCREEN, OVERLAY, DARKEN, LIGHTEN, DODGE, BURN, HARD_LIGHT, SOFT_LIGHT, DIFFERENCE, HUE, SATURATION, COLOR, LUMINOSITY or DISSOLVE (case-insensitive; other names are rejected) - visible: True/False visibility (omit to leave unchanged) - image_index: Target image index (default 0) Returns status dict.…

ParameterTypeDescription
blend_mode
image_indexinteger
layer_index
layer_name
opacity
visible

reorder_layer

Move a layer to a new stack position. Parameters: - new_position: Target stack index, 0 = top (same order as list_layers) - layer_name / layer_index: Identify the layer (defaults to active layer) - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
new_position *integer
image_indexinteger
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.

ParameterTypeDescription
image_indexinteger

merge_visible_layers

Merge all visible layers into a single layer. Parameters: - image_index: Target image index (default 0) Returns: {layer_name, layer_id}

ParameterTypeDescription
image_indexinteger

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, active}], count}. Index 0 is the top layer; active marks the layer that tools use when layer_name is omitted. blend_mode uses set_layer_properties names (e.g. "NORMAL"); offsets is [x, y].

ParameterTypeDescription
image_indexinteger

fill_layer

Fill an entire layer with a solid color. Parameters: - color: Fill color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) - layer_name: Layer to fill; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
color *string
image_indexinteger
layer_name

fill_selection

Fill the current selection with a color or fill type. Parameters: - color: Fill color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) (used when fill_type is omitted) - fill_type: Instead of color: "foreground" or "background" (GIMP's current colors, see set_colors), "pattern", or "transparent" (clears the selection). Give color or fill_type. - image_index: Target image index (default 0) - layer_name: Target layer; defaults to active layer Returns status dict.…

ParameterTypeDescription
color
fill_type
image_indexinteger
layer_name

set_colors

Set the GIMP foreground and/or background color. Parameters: - foreground: New foreground color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); omit to leave unchanged - background: New background color, same formats; omit to leave unchanged Returns: {foreground, background} confirmation dict.

ParameterTypeDescription
background
foreground

draw_line

Draw a straight line on a layer. Parameters: - x1, y1: Start point - x2, y2: End point - color: Stroke color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); uses current foreground if omitted - width: Stroke width in pixels (default 2.0) - tool: "pencil" (default, hard edge) or "paintbrush" (soft edge) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
x1 *number
x2 *number
y1 *number
y2 *number
color
image_indexinteger
layer_name
toolstring
widthnumber

draw_rectangle

Draw a rectangle outline (stroke only) on a layer. Parameters: - x, y: Top-left corner - width, height: Rectangle dimensions - color: Stroke color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); uses current foreground if omitted - line_width: Stroke width in pixels (default 2.0) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
height *integer
width *integer
x *integer
y *integer
color
image_indexinteger
layer_name
line_widthnumber

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 as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); uses current foreground if omitted - line_width: Stroke width in pixels (default 2.0) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
height *integer
width *integer
x *integer
y *integer
color
image_indexinteger
layer_name
line_widthnumber

fill_rectangle

Fill a rectangular region with a solid color. Parameters: - x, y: Top-left corner - width, height: Rectangle dimensions - color: Fill color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
color *string
height *integer
width *integer
x *integer
y *integer
image_indexinteger
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 as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
color *string
height *integer
width *integer
x *integer
y *integer
image_indexinteger
layer_name

gradient_fill

Fill a layer or selection with a gradient. With an active selection, only the selected part of the layer is filled. Parameters: - color1: Start color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); default "black" - color2: End color, same formats; default "white" - x1, y1: Gradient start point in image pixels (default 0, 0) - x2, y2: Gradient end point in image pixels (default: the image's bottom-right corner); must differ from the start point - gradient_t…

ParameterTypeDescription
color1string
color2string
gradient_typestring
image_indexinteger
layer_name
x1number
x2
y1number
y2

paint_stroke

Paint a batch of brush strokes, working in rounds like a painter. Paints on an open image. To start a new painting, first call new_canvas(width, height) (white by default), or open a file with open_image. Paint a few strokes (typically 3-30), look at the result (preview=True or get_state_snapshot), then paint the next batch. All strokes in one call land on one layer and form a single undo step in GIMP's own history. To be able to discard a round, paint it on a new layer (create_layer) and remove it with delete_layer. Every stroke is validated before anything i…

ParameterTypeDescription
strokes *array
image_indexinteger
layer_name
previewboolean
preview_max_sizeinteger

list_brushes

List brushes available to paint_stroke. Parameters: - filter: Optional regular expression matched against brush names, e.g. "Oils|Bristles" Brushes that paint well: "2. Hardness 025" to "100" (plain round), "Acrylic 01"/"03" (dry, textured), "Bristles 01" to "03" (streaky), "Oils 01" to "03" (soft blending), "Charcoal 01"/"Chalk 01" (grainy), "Pencil 02" (sketchy line), "Sponge 01" (soft texture). Returns: {brushes: [name, ...], count}

ParameterTypeDescription
filter

sample_color

Pick a color from the canvas, like a painter's eyedropper. Same as get_pixel_color, plus optional averaging over a radius. Parameters: - x, y: Image coordinates in pixels - radius: Average the color over this many pixels around the point (default 0 = one pixel) - sample_merged: true (default) samples what is visible across all layers; false samples one layer - layer_name: Layer to sample when sample_merged is false; defaults to the active layer - image_index: Target image index (default 0) Returns: {color_hex: "#rrggbb" (sRGB, usable as a paint_stroke color),…

ParameterTypeDescription
x *number
y *number
image_indexinteger
layer_name
radiusnumber
sample_mergedboolean

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 family name — "Sans" (default), "Serif", etc. - size: Font size in pixels (default 24) - color: Text color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); default "black" - image_index: Target image index (default 0) Returns: {layer_name, layer_id, text_width, text_height, position}

ParameterTypeDescription
text *string
colorstring
fontstring
image_indexinteger
sizeinteger
xinteger
yinteger

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) - font: New font family (omit to leave unchanged) - size: New font size in pixels (omit to leave unchanged) - color: New text color as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple) (omit to leave unchanged) - image_index: Target image index (default 0) All values are checked before anything changes. A f…

ParameterTypeDescription
layer_name *string
color
font
image_indexinteger
size
text

list_fonts

List fonts installed in GIMP. Parameters: - filter: Optional text matched against font names, case-insensitive (e.g. "sans") - limit: Maximum number of names to return (default 100). There can be thousands of fonts: if truncated is true, narrow with filter instead of assuming a font is missing. Returns: {fonts: [font_name, ...], count (returned), total (matching filter), truncated}

ParameterTypeDescription
filter
limitinteger

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 as hex "#rrggbb" or a basic name (black, white, gray, silver, red, maroon, yellow, olive, lime, green, aqua, teal, blue, navy, fuchsia, purple); default "black" - opacity: Shadow opacity 0-100 (default 60) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
blur_radiusnumber
colorstring
image_indexinteger
layer_name
offset_xinteger
offset_yinteger
opacitynumber

apply_gaussian_blur

Apply Gaussian blur as a destructive filter operation. Same as blur with equal horizontal and vertical radii. Parameters: - radius: Blur radius in pixels (default 5.0) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
image_indexinteger
layer_name
radiusnumber

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 active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
block_sizeinteger
image_indexinteger
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, whole number 1-100 (default 2) - layer_name: Target layer; defaults to active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
azimuthnumber
depthnumber
elevationnumber
image_indexinteger
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 active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
image_indexinteger
layer_name
shapestring
softnessnumber

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 active layer - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
amountnumber
image_indexinteger
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) Returns: {exported: [{size, file_path}], count, platform}

ParameterTypeDescription
output_dir *string
formatstring
platformstring
source_image_indexinteger

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 1-100 (default 85) - png_compression: PNG compression level, 0 (fastest, largest) to 9 (smallest; default) - 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}

ParameterTypeDescription
output_dir *string
image_indexinteger
jpeg_qualityinteger
max_height
max_width
png_compressioninteger

warp_region

Disabled: always returns an error and leaves the image unchanged. On GIMP 3.2 this erased the whole layer instead of warping it, and GIMP 3.2 gives plug-ins no working warp operation. Use GIMP's Warp Transform tool by hand. Parameters: - vectors: List of warp stroke dicts, each with: - x, y : center of the warp influence (pixels) - dx, dy : push direction — negative dy = push upward - radius : influence radius in pixels (default: 40) - amount : deform strength 0–1 (default: 0.3) - image_index: Which open image to edit (def…

ParameterTypeDescription
vectors *array
image_indexinteger
layer_name

batch_resize

Resize all open images to a common target size. Parameters: - width / height: Target dimensions in pixels (provide one or both) - scale_factor: Proportional scale (e.g. 0.5 = 50%); overrides width/height if set - maintain_aspect: Preserve aspect ratio when only one dimension is given (default True) Returns: {results: [{image_id, old_width, old_height, new_width, new_height}], count}

ParameterTypeDescription
height
maintain_aspectboolean
scale_factor
width

export_sprite_sheet

Combine multiple frames into a sprite sheet PNG. 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, in list_layers order; default) or "images" (each open image's visible result, in list_images order) - image_index: Source image when source="layers" (default 0) Each cell is the size of the first frame; bigger frames are cropped. Transparency is kept. Returns: {file_path,…

ParameterTypeDescription
output_path *string
columns
image_indexinteger
paddinginteger
sourcestring

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}

ParameterTypeDescription
output_dir *string
image_indexinteger
platforms

list_images

List all images currently open in GIMP. Index 0 is the most recently opened or created image, and indices shift when images are opened or closed; image_id stays the same for an image's lifetime. Every image_index parameter uses this order. 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. Works for images opened with new_canvas or open_image. GIMP 3 gives plug-ins no way to find windows opened from GIMP's own menus, so those return an error; every other tool still works on them by image_index. Parameters: - image_index: Index of the image to activate (from list_images) Returns status dict.

ParameterTypeDescription
image_index *integer

convert_color_mode

Convert an image to a different color mode. Parameters: - mode: "RGB", "RGBA", "GRAY", "GRAYA" (the A forms also add alpha to every layer) or "INDEXED" - num_colors: Number of colors for INDEXED mode, 1-256 (default 256) - image_index: Target image index (default 0) Returns status dict.

ParameterTypeDescription
mode *string
image_indexinteger
num_colorsinteger

close_image

Close an image, optionally saving as XCF first. Closes images opened with new_canvas or open_image, and images that have no window. GIMP 3 gives plug-ins no way to close a window opened from GIMP's own menus, so for those images this returns an error and they must be closed in GIMP. Parameters: - image_index: Index of the image to close (default 0 = most recently opened) - save_first: If True, save as XCF before closing (default False). An image opened from an XCF file is saved over that file. Any other image is saved as a new .xcf next to the file it came…

ParameterTypeDescription
image_indexinteger
save_firstboolean

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}

ParameterTypeDescription
image_indexinteger

get_pixel_color

Get the color of a single pixel. sample_color does the same and can average over a radius; it reports alpha as 0-1, this tool as 0-255. Parameters: - x, y: Image pixel coordinates - image_index: Target image index (default 0) - layer_name: Layer to sample when sample_merged is false; defaults to active layer - sample_merged: true (default) samples what is visible across all layers; false samples only one layer Returns: {color_hex (sRGB), color_rgb: [r, g, b], alpha (0-255), sampled (what was read)}

ParameterTypeDescription
x *integer
y *integer
image_indexinteger
layer_name
sample_mergedboolean

get_histogram

Get histogram statistics for one channel of a layer. Parameters: - channel: "value" (all; default), "red", "green", "blue", "alpha" - image_index: Target image index (default 0) - layer_name: Layer to measure; defaults to the active layer Returns: {layer, mean, std_dev, median (on a 0-255 scale), pixels (in the layer), count (pixels in range), percentile (fraction of pixels in range)}

ParameterTypeDescription
channelstring
image_indexinteger
layer_name