create_image
Creates image from user prompt. Use when the user wants to generate, create, or edit images using AI. Triggers: "create an image of", "generate a picture", "draw", "make an illustration", "visualize", "edit this image", "modify the photo", "change the background". Supports text-to-image generation and image editing with masks. NOT for image analysis or description—only for creating or modifying visual content.
Best use case
create_image is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Creates image from user prompt. Use when the user wants to generate, create, or edit images using AI. Triggers: "create an image of", "generate a picture", "draw", "make an illustration", "visualize", "edit this image", "modify the photo", "change the background". Supports text-to-image generation and image editing with masks. NOT for image analysis or description—only for creating or modifying visual content.
Teams using create_image should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/create_image/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How create_image Compares
| Feature / Agent | create_image | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Creates image from user prompt. Use when the user wants to generate, create, or edit images using AI. Triggers: "create an image of", "generate a picture", "draw", "make an illustration", "visualize", "edit this image", "modify the photo", "change the background". Supports text-to-image generation and image editing with masks. NOT for image analysis or description—only for creating or modifying visual content.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Create Image
## Overview
This skill generates images from natural language descriptions or edits existing images using AI image generation models. It provides a **unified interface** supporting multiple vendors:
- **Google Gemini** (default) - Fast drafts and high-quality pro output
- **OpenAI** - HD quality with optional mask-based editing
## Quick Start
```bash
# Create output directory first
mkdir -p ./output
# Generate an image (Google, default)
python3 .claude/skills/create_image/image_gen.py "A sunset over mountains" -o ./output/sunset.png
# Generate with OpenAI
python3 .claude/skills/create_image/image_gen.py "A sunset over mountains" --vendor openai -o ./output/sunset.png
# High quality
python3 .claude/skills/create_image/image_gen.py "Detailed portrait" --hq -o ./output/portrait.png
# Edit an existing image
python3 .claude/skills/create_image/image_gen.py "Make the shirt green" --reference ./photo.jpg -o ./output/edited.png
```
---
## Vendors
| Vendor | Flag | Models | Best For |
|--------|------|--------|----------|
| Google Gemini | `--vendor google` (default) | gemini-2.5-flash-image (default), gemini-3-pro-image-preview (--hq) | Fast iterations, aspect ratio control |
| OpenAI | `--vendor openai` | gpt-image-1 | HD quality, mask-based targeted edits |
### API Keys
| Vendor | Environment Variable |
|--------|---------------------|
| Google | `GEMINI_API_KEY` |
| OpenAI | `OPENAI_API_KEY` |
---
## CLI Reference
### Basic Usage
```bash
python3 .claude/skills/create_image/image_gen.py "<prompt>" [options]
# Prompt from file
python3 .claude/skills/create_image/image_gen.py -p <prompt-file> [options]
```
> **Note:** Output files should be written to `./output/` (writable workspace directory).
### Options
| Flag | Long Form | Default | Description |
|------|-----------|---------|-------------|
| | (positional) | None | Inline text prompt |
| `-p` | `--prompt-file` | None | Path to file containing prompt (.txt, .md, etc.) |
| `-o` | `--output` | `generated_image.png` | Output file path |
| `-r` | `--aspect-ratio` | `1:1` | Aspect ratio (1:1, 16:9, 9:16, etc.) |
| | `--vendor` | `google` | Vendor: `google` or `openai` |
| | `--hq` | off | High quality mode |
| `-m` | `--model` | (vendor default) | Override model |
| `-v` | `--verbose` | off | Verbose output |
| | `--api-key` | (from env) | API key override |
| | `--reference` | None | Reference image (enables edit mode) |
| | `--mask` | None | Mask image (OpenAI only) |
### Prompt Sources
You can provide the prompt in two ways:
1. **Inline (positional argument):** `python3 .claude/skills/create_image/image_gen.py "your prompt here"`
2. **From file:** `python3 .claude/skills/create_image/image_gen.py -p ./prompt.txt`
The file option is useful for:
- Long, detailed prompts
- Reusable prompt templates
- Multi-line prompts with formatting
### Supported Aspect Ratios
`1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `9:16`, `16:9`, `21:9`
---
## Programmatic API
### generate_image()
```python
from image_gen import generate_image
result = generate_image(
prompt="A sunset over mountains",
output_path="./output/sunset.png", # optional
aspect_ratio="16:9", # default: "1:1"
vendor="google", # or "openai"
high_quality=False, # True for pro/HD
model=None, # override default model
api_key=None, # override env variable
)
```
### edit_image()
```python
from image_gen import edit_image
result = edit_image(
prompt="Make the shirt green",
reference_image="./photo.jpg",
output_path="./output/edited.png", # optional
vendor="google", # or "openai"
high_quality=False, # True for pro/HD
model=None, # override default model
mask_image=None, # OpenAI only: path to mask
api_key=None, # override env variable
)
```
### Return Value
Both functions return the same dictionary:
```python
{
"success": bool, # True if successful
"image_path": str | None, # Path where image was saved
"text": str | None, # Text response (Google only)
"error": str | None, # Error message if failed
"image": PIL.Image.Image | None, # PIL Image object
"model": str, # Model that was used
"vendor": str, # Vendor that was used
}
```
---
## Instructions for Claude
### Step 1: Determine Parameters
From the user's request, extract:
- **Prompt**: The image description or edit instruction (required)
- For long prompts, save to a file and use `-p`
- **Vendor**: User preference, or default to `google`
- **Mode**: Generate (no reference) or Edit (reference provided)
- **Quality**: Standard (default) or high (`--hq`)
- **Aspect ratio**: Based on intended use (default: `1:1`)
- **Output path**: Where to save the image
### Step 2: Choose Vendor
| Scenario | Recommended Vendor |
|----------|-------------------|
| Default / fast iterations | `google` |
| User has only OpenAI key | `openai` |
| Need mask-based targeted edits | `openai` |
| User explicitly requests | As specified |
### Step 3: Execute
```bash
# Create output directory
mkdir -p ./output
# Generate image
python3 .claude/skills/create_image/image_gen.py "<prompt>" --vendor <vendor> -r <aspect-ratio> -o ./output/<filename>.png [--hq]
# Edit image
python3 .claude/skills/create_image/image_gen.py "<prompt>" --reference ./<image> -o ./output/<filename>.png
```
**Programmatic (via inline python):**
```bash
python3 << 'EOF'
import sys
sys.path.insert(0, '.claude/skills/create_image')
from image_gen import generate_image, edit_image
result = generate_image(prompt="...", vendor="google", aspect_ratio="16:9", output_path="./output/image.png")
EOF
```
### Step 4: Handle Result
```python
if result["success"]:
print(f"Saved to: {result['image_path']}")
else:
print(f"Error: {result['error']}")
```
---
## Examples
### Text-to-Image Generation
```bash
mkdir -p ./output
# Inline prompt (short)
python3 .claude/skills/create_image/image_gen.py "A cartoon cat wizard" -o ./output/wizard_cat.png
# Widescreen landscape
python3 .claude/skills/create_image/image_gen.py "Mountain panorama at sunset" -r 16:9 -o ./output/mountains.png
# High quality with Google Pro
python3 .claude/skills/create_image/image_gen.py "Detailed portrait" --hq -r 3:4 -o ./output/portrait.png
# Using OpenAI
python3 .claude/skills/create_image/image_gen.py "Steampunk clockwork" --vendor openai -o ./output/steampunk.png
```
### Image Editing
```bash
# Edit with inline prompt
python3 .claude/skills/create_image/image_gen.py "Make the background a beach" --reference ./portrait.jpg -o ./output/beach.png
# Edit with Google Pro
python3 .claude/skills/create_image/image_gen.py "Change shirt to green" --reference ./person.jpg --hq -o ./output/green.png
# Targeted edit with OpenAI mask
python3 .claude/skills/create_image/image_gen.py "Replace background with space" --vendor openai --reference ./portrait.png --mask ./bg_mask.png -o ./output/space.png
```
---
## Mask Image Guidelines (OpenAI only)
For targeted image editing with OpenAI:
- Use **PNG format**
- Same dimensions as reference image
- **Transparent areas**: Where the model may change pixels
- **Opaque areas**: Where the original must be preserved
---
## Error Handling
| Error Type | Cause |
|------------|-------|
| `ValueError` | Invalid aspect ratio, vendor, missing API key, or empty prompt |
| `FileNotFoundError` | Prompt file, reference, or mask image doesn't exist |
| `result["error"]` | API/network errors (check `result["success"]`) |Related Skills
create-python-code
Use ONLY for complex Python tasks requiring reusable scripts, multi-file processing, or data pipelines. DO NOT USE for: one-off calculations, web fetch + process, simple file transforms, or tasks under 30 lines. For simple tasks, just write inline Python directly with mcp__ag3ntum__Bash without loading this skill.
infocompressor
Use when the user needs to compress, condense, or summarize lengthy content while preserving ALL critical details. Triggers: "compress this", "make it shorter but keep everything", "create a cheat sheet", "dense summary", "reference format", "compact version", "information-dense". NOT for casual summaries—only when user explicitly wants maximum density with zero data loss.
deep-research
Use when the user asks to research, investigate, explore, or analyze a topic requiring multiple sources. Triggers: "research X", "find out about", "what's the current state of", "compare options for", "deep dive into", "gather information on", "write a report about". NOT for simple factual questions answerable in one search—only for multi-source synthesis needing 5+ sources.
Self-Review Skill
Run this skill before committing to catch issues early. It runs linting, structural tests, and verifies no debug artifacts remain.
scanning-docker-images-with-trivy
Trivy is a comprehensive open-source vulnerability scanner by Aqua Security that detects vulnerabilities in OS packages, language-specific dependencies, misconfigurations, secrets, and license violati
scanning-container-images-with-grype
Scan container images for known vulnerabilities using Anchore Grype with SBOM-based matching and configurable severity thresholds.
performing-container-image-hardening
This skill covers hardening container images by minimizing attack surface, removing unnecessary packages, implementing multi-stage builds, configuring non-root users, and applying CIS Docker Benchmark recommendations to produce secure production-ready images.
implementing-image-provenance-verification-with-cosign
Sign and verify container image provenance using Sigstore Cosign with keyless OIDC-based signing, attestations, and Kubernetes admission enforcement.
implementing-container-image-minimal-base-with-distroless
Reduce container attack surface by building application images on Google distroless base images that contain only the application runtime with no shell, package manager, or unnecessary OS utilities.
image-enhancer
Improves the quality of images, especially screenshots, by enhancing
analyzing-disk-image-with-autopsy
Perform comprehensive forensic analysis of disk images using Autopsy to recover files, examine artifacts, and build investigation timelines.
acquiring-disk-image-with-dd-and-dcfldd
Create forensically sound bit-for-bit disk images using dd and dcfldd while preserving evidence integrity through hash verification.