Process Image
process_imageProcess an existing image locally by cropping, resizing, removing background, converting format, or trimming whitespace. Free and fast with 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
| Name | Required | Description | Default |
|---|---|---|---|
| imagePath | Yes | Path to the image file to process | |
| crop | No | Crop image. Use width+height for pixel-exact, or aspectRatio for ratio-based. Strategy controls where to crop from. | |
| resize | No | Resize image. Maintains aspect ratio if only width or height given. | |
| removeBackground | No | Remove background. Use threshold for white backgrounds, or color for chroma key (green screen). | |
| trim | No | Auto-trim whitespace borders | |
| format | No | Convert to format. Defaults to original format. | |
| quality | No | Output quality for JPEG/WebP (1-100). Default 90. | |
| outputDir | No | Directory to save. Defaults to config file outputDir, OUTPUT_DIR env var, or ~/gemini-images | |
| filename | No | Base name for saved file. Auto-versioned if duplicate. | |
| subfolder | No | Subfolder within output directory |