Skip to main content
Glama

Process Image

process_image

Crop, resize, remove background, convert format, or trim whitespace locally. No API calls.

Instructions

Process an existing image locally using sharp. Crop, resize, remove background, convert format, or trim whitespace. Free, fast, no API calls. For AI-powered editing (style changes, complex background removal), use generate_image with the image as input instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imagePathYesPath to the image file to process
cropNoCrop image. Use width+height for pixel-exact, or aspectRatio for ratio-based. Strategy controls where to crop from.
resizeNoResize image. Maintains aspect ratio if only width or height given.
removeBackgroundNoRemove background. mode 'auto' (AI matte, any subject), 'chroma' (green screen), or 'threshold' (white). Defaults: chroma if color set, else threshold.
trimNoAuto-trim whitespace borders
formatNoConvert to format. Defaults to original format.
qualityNoOutput quality for JPEG/WebP (1-100). Default 90.
outputDirNoDirectory to save. Defaults to config file outputDir, OUTPUT_DIR env var, or ~/gemini-images
filenameNoBase name for saved file. Auto-versioned if duplicate.
subfolderNoSubfolder within output directory
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses key traits: local execution, free, fast, no API calls. However, it does not mention potential side effects, file system modifications, or return behavior in detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with main action, then operations list, then alternative guidance. No redundancy or unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (10 parameters, nested objects, no output schema), the description covers core actions and context but omits explicit mention of output (e.g., saved file path). The output parameters imply saving, but it's not stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds a high-level summary of operations but does not significantly augment the detailed parameter descriptions already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the tool processes existing images locally using sharp, enumerates specific operations (crop, resize, remove background, etc.), and distinguishes from sibling tool generate_image by noting when to use that alternative.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises to use generate_image for AI-powered editing, providing clear when-to-use guidance for this tool versus its sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/JimothySnicket/gemini-image-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server