generate_image
Generate images using AI with optional transparency, reference style images, and exact sizing. Supports PNG, JPG, WebP output with customizable cropping.
Instructions
Generate image assets using Gemini AI with optional transparency and reference images.
[Claude Desktop Guidance]
Prefer outputType='file' for medium or large images. base64 and combine responses can exceed Claude Desktop's context limit.
On Claude Desktop for Windows, use the FileSystem extension to choose reference-image paths and a writable absolute outputPath before calling this tool.
Use base64 only for small previews or when the client explicitly needs inline image data.
[Model Guidance]
Flash3.1 (recommended): High quality, very fast, supports grounding and advanced features.
Lite3.1 (Nano Banana 2 Lite): Ultra-fast, cost-effective, 1K-only, no search grounding. Ideal for quick drafting and low-latency iteration.
Pro3: Higher fidelity, but more costly and slower.
Flash2.5: Legacy, maintained for compatibility. Does not support 0.5K, 2K, or 4K resolutions.
[Aspect Ratios] Gemini supports the following aspect ratios (model-dependent):
Common to all models: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Flash3.1 only: 1:4, 4:1, 1:8, 8:1
Normal mode: provide outputWidth/outputHeight and the server will choose the closest Gemini aspect ratio and source resolution, then resize to the requested pixel size. No-resize mode: set noresize=true and provide aspectRatio plus output_resolution. The server will return Gemini's native pixel dimensions for that combination without post-generation resizing.
If you intentionally want to control resizing/cropping in normal mode, use the 'resizeMode' parameter: 'crop' (default, center crop), 'letterbox' (fit with padding), 'contain' (trim transparent margins then fit), or 'stretch' (distort to fit).
[IMPORTANT] Always preserve the user's prompt as-is, including language and nuance. Do not translate or summarize.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| debug | No | Debug mode: output intermediate processing images and prompt | |
| model | No | Model tier to use for generation (see tool description for details; "flash" and "pro" are aliases for Flash2.5 and Pro3; "Lite3.1" is the low-latency Nano Banana 2 Lite model, 1K-only, no grounding) | Flash3.1 |
| prompt | Yes | User-provided image prompt. Preserve the original wording and detail; do not summarize or translate. Only append transparency-related hints if needed. | |
| noresize | No | Skip post-generation resizing and return Gemini native dimensions directly. When true, provide aspectRatio and output_resolution instead of outputWidth/outputHeight. | |
| fringeMode | No | Fringe reduction mode: auto (size-based), crisp (binary alpha), hd (force-clear 1px boundary for large images). | auto |
| outputPath | No | Output directory path (MUST be an absolute path when outputType is file or combine). In Claude Desktop on Windows, use the FileSystem extension to choose or prepare a writable absolute path such as C:\temp. | |
| outputType | No | Output format: file=file only, base64=base64 only, combine=both. In Claude Desktop, prefer file for medium or large images to avoid context-size limits; use base64 only for small previews. | combine |
| resizeMode | No | Resize mode: crop=center crop, stretch=distort, letterbox=fit with padding, contain=trim transparent margins then fit | crop |
| aspectRatio | No | Gemini aspect ratio to use directly when noresize=true. Ignored in normal resize mode. | |
| outputWidth | No | Output image width in pixels. Required unless noresize=true. In normal mode, the image will be generated using the closest supported Gemini aspect ratio and resolution, then resized to this width. | |
| transparent | No | Request transparent background (PNG or WebP only). Background color is selected by histogram analysis. | |
| outputHeight | No | Output image height in pixels. Required unless noresize=true. In normal mode, the image will be generated using the closest supported Gemini aspect ratio and resolution, then resized to this height. | |
| output_format | No | Output format | png |
| thinking_mode | No | Thinking mode (3.1 only) | minimal |
| colorTolerance | No | Tolerance for color matching (0-255). Higher values are more permissive for transparent color selection and keying. | |
| grounding_type | No | Grounding tool usage (3.1 only) | none |
| outputFileName | Yes | Output filename (extension auto-added if missing) | |
| referenceImages | No | Reference images for style guidance (Flash2.5: max 3, others: max 14) | |
| include_metadata | No | Include grounding and reasoning metadata in JSON output (optional, may increase payload size). | |
| include_thoughts | No | Optional (default: false). Request thought fields from Gemini (3.1 only). Thought content is returned in MCP response only when include_metadata=true. | |
| transparentColor | No | Color to make transparent. Hex (e.g. #FF00FF). null defaults to #FF00FF when transparent=true. | |
| output_resolution | No | Gemini generation source resolution (optional in normal mode, required when noresize=true). In normal mode, the final image is resized to the requested pixel size after generation. |