Edit and manipulate images using natural language prompts...
This skill enables AI-powered image editing and creation using Google's Gemini 3 Pro Image model (nicknamed "Nano Banana Pro"). It allows editing existing images or creating new images from scratch through natural language instructions.
Use this skill when users request:
If needed, run the following script to install dependencies:
${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/install_dependencies.sh
This creates a Python virtual environment and installs the required packages (google-genai, Pillow).
Virtual environment location:
${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/NANO_BANANA_VENV env var for multi-platform support (e.g., Docker containers)API Key Setup:
Get an API key from Google AI Studio
Run the setup script to save the key to the plugin config:
${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv/bin/${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/setup-gemini-token.py YOUR_API_KEY
The script will:
.nano-banana-config.json in the plugin directoryAll script examples below use ${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 to ensure the venv's Python interpreter is used.
Use the create_image.py script to generate new images from natural language prompts:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
OUTPUT_IMAGE "creation instruction" --resolution 1K --aspect-ratio 1:1
Example: Create an icon
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
cat-icon.png "A playful orange tabby cat icon, simple and clean design" \
--resolution 1K --aspect-ratio 1:1
Example: Create a high-resolution illustration
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
sunset.png "A vibrant sunset over mountains with purple and orange sky" \
--resolution 4K --aspect-ratio 16:9
Example: Create with reference images for style
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
landscape.png "A mountain landscape in this artistic style" \
--reference style.png --resolution 2K --aspect-ratio 3:2
Prompting Tips:
references/prompting_guide.md for comprehensive prompting strategiesUse the edit_image.py script to edit existing images with natural language prompts:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/edit_image.py \
INPUT_IMAGE OUTPUT_IMAGE "editing instruction" --resolution 1K --aspect-ratio 1:1
Example: Remove text overlay
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/edit_image.py \
slide.png slide-cleaned.png \
"Remove the text labels from the top of this diagram"
Example: Background removal with high resolution
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/edit_image.py \
photo.jpg photo-no-bg.png \
"Remove the background and make it transparent white" \
--resolution 2K --aspect-ratio 4:3
Example: Style transfer with reference image
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/edit_image.py \
photo.jpg artistic.png \
"Apply the artistic style from the reference to this photo" \
--reference style.png --resolution 2K
Important: When recreating memes, comics, or templates with different characters, always pass both the template AND the character references.
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
output.png "Recreate this meme template using these characters" \
--reference template.png --reference character1.png --reference character2.png \
--resolution 2K --aspect-ratio 16:9
Why both?
Example: Recreating a two-panel comic meme
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
my-meme.png "Recreate this two-panel comic using these two women as the characters. Maintain the exact composition and poses from the template." \
--reference original-meme.png --reference my-characters.png \
--resolution 2K --aspect-ratio 16:9
Create group photos maintaining facial resemblance:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
group.png "Office group photo of these people making funny faces" \
--reference person1.png --reference person2.png --reference person3.png \
--resolution 2K --aspect-ratio 5:4
Blend multiple objects with high fidelity:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
product.png "Product showcase featuring these items on a marble surface" \
--reference item1.png --reference item2.png --reference item3.png \
--resolution 4K --aspect-ratio 16:9
Edit an image while using additional references:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/edit_image.py \
background.jpg composite.png \
"Add these people to the scene, natural lighting" \
--reference person1.png --reference person2.png \
--resolution 2K
Enable real-time information for factual content:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
weather.png "An infographic about today's weather in San Francisco" \
--search --resolution 2K --aspect-ratio 3:4
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
plant-guide.png "Create an educational infographic about String of Turtles houseplant care" \
--search --resolution 2K --aspect-ratio 3:4
When to use --search:
Resolution Options:
1K (default) - Fast, good for iteration and testing (1024×1024 at 1:1)2K - Professional quality (2048×2048 at 1:1)4K - Maximum quality, studio-grade (4096×4096 at 1:1)Common Aspect Ratios:
1:1 - Social media posts, profile pictures, icons16:9 - Presentations, YouTube thumbnails, desktop wallpapers9:16 - Instagram Stories, TikTok, mobile vertical content4:3 - Traditional displays, print media3:2 - Standard photography21:9 - Ultra-wide cinematic shotsExample with custom resolution and aspect ratio:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
banner.png "A website hero banner with mountains and sunrise" \
--resolution 4K --aspect-ratio 21:9
create_image.py for generating new imagesedit_image.py for modifying existing images--search when generating content requiring real-time informationFor comprehensive prompting strategies, see references/prompting_guide.md
For best practices and workflow optimization, see references/best_practices.md
Gemini 3 Pro Image supports:
Input Limits:
Output Specifications:
Resolution Examples:
"No Gemini API key configured" error:
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/setup-gemini-token.py YOUR_API_KEY"No image in response" message:
Poor edit quality:
"MALFORMED_FUNCTION_CALL" error when editing:
Prompts with dollar signs or special characters getting stripped:
$3, $4.50) and other bash special characters get removed from prompts$variable syntax triggers variable expansion'Espresso $3, Latte $4'"Espresso \\$3, Latte \\$4"Example:
# ❌ Wrong - dollar signs get expanded as variables
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
menu.png "Coffee menu: Espresso $3, Latte $4"
# ✅ Correct - use single quotes
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
menu.png 'Coffee menu: Espresso $3, Latte $4'
# ✅ Also correct - escape the dollar signs
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/create_image.py \
menu.png "Coffee menu: Espresso \$3, Latte \$4"
For simple, deterministic image operations, you can also use PIL/Pillow (Python) instead of the AI model. This is faster, free, and more predictable for basic tasks:
Use the included quick_crop.py script for fast, precise cropping:
# Remove 100px from the right edge
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/quick_crop.py \
input.png output.png --remove-right 100
# Exact crop box
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/quick_crop.py \
input.png output.png --left 0 --top 0 --right 1200 --bottom 800
# Remove pixels from bottom
${NANO_BANANA_VENV:-${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/.venv}/bin/python3 ${CLAUDE_PLUGIN_ROOT}/skills/nano-banana-image-editor/scripts/quick_crop.py \
input.png output.png --remove-bottom 50
For custom operations, use PIL directly:
from PIL import Image
img = Image.open('input.png')
# Crop: (left, top, right, bottom)
cropped = img.crop((0, 0, img.size[0] - 100, img.size[1])) # Remove 100px from right
cropped.save('output.png')
from PIL import Image
img = Image.open('input.png')
resized = img.resize((1920, 1080))
resized.save('output.png')
from PIL import Image
img = Image.open('input.png')
rotated = img.rotate(90, expand=True)
rotated.save('output.png')
references/prompting_guide.md
references/best_practices.md