
GPT Image Skill
FreeGenerate and edit images with OpenAI's GPT models.
Free · Opens the source repo
What GPT Image Skill does
The GPT Image Skill enables users to generate and edit images utilizing OpenAI's GPT Image API. This skill is particularly useful for developers and designers who need to create visual content quickly and efficiently. By leveraging the power of AI, users can produce images based on descriptive prompts, allowing for a high degree of customization in terms of style, size, and quality.
To use the skill, users must configure their OpenAI API key and have the necessary Python dependencies installed. The bundled Python script, gpt_image.py, is the primary interface for generating and editing images. Users can specify various parameters such as image size, output format, model version, and quality settings, making it flexible for different use cases. Whether creating a simple landscape or editing an existing image, the skill provides straightforward command-line instructions to facilitate the process.
The skill supports multiple models, allowing users to choose between the latest version and earlier iterations based on their needs. It also offers options for output formats, including PNG and JPEG, catering to different requirements for image quality and file size. This makes it a versatile tool for generating everything from social media graphics to detailed illustrations.
However, users should note that this skill is designed specifically for images generated through OpenAI's models and should not be used for creating diagrams or technical drawings, which are better suited for other tools like Mermaid. Overall, the GPT Image Skill is an excellent choice for those looking to integrate AI-driven image generation into their workflow.
When to use it
Use this skill when you need to create or modify images based on specific prompts using OpenAI's image generation capabilities.
When not to use it
Avoid using this skill for diagram creation or when you require generic image requests without specifying OpenAI as the provider.
What you can build with it
Create a logo for a startup
Generate a modern minimalist logo by providing a prompt and specifying the desired size and quality.
Edit an existing photo
Use the skill to add elements to a photo, like a rainbow, by specifying the input image and editing instructions.
Produce multiple art pieces
Generate several variations of abstract art by using a single prompt and adjusting the number of images to create.
How to install GPT Image Skill
View source1. Install with the skills CLI
npx skills add feiskyer/claude-code-settings/gpt-image-skill --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by feiskyerGPT Image Skill
Generate or edit images using OpenAI's GPT Image models through a bundled Python script.
Requirements
- OPENAI_API_KEY: Must be configured in
~/.gpt-image.envorexport OPENAI_API_KEY=<your-key> - OPENAI_API_BASE (optional): Custom API base URL for compatible endpoints (e.g. Azure OpenAI, proxies). Set in
~/.gpt-image.envor export it. - Python3 with dependencies: openai, Pillow. Install via
python3 -m pip install -r ${CLAUDE_SKILL_DIR}/requirements.txtif not installed yet. - Executable:
${CLAUDE_SKILL_DIR}/gpt_image.py
Instructions
For image generation
-
Ask the user for:
- What they want to create (the prompt)
- Desired size (optional, defaults to 1024x1024)
- Output filename (optional, auto-generates UUID-based name if not specified)
- Model preference (optional, defaults to gpt-image-2)
- Quality (optional, defaults to auto)
- Number of images (optional, defaults to 1)
-
Run the script:
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py --prompt "description of image" --output "filename.png" -
Show the user the saved image path when complete.
For image editing
-
Ask the user for:
- Input image file(s) to edit (up to 3)
- What changes they want (the prompt)
- Output filename (optional)
-
Run with input images:
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit --prompt "editing instructions" --input image1.png image2.png --output "edited.png"
Available Options
Models (--model)
gpt-image-2(default) — Latest model with strong instruction following, text rendering, and broad world knowledgegpt-image-1.5— Mid-tier modelgpt-image-1— First-generation GPT image modelgpt-image-1-mini— Lightweight, faster generation
Sizes (--size)
1024x1024(default) — Square1024x1536— Portrait (2:3)1536x1024— Landscape (3:2)auto— Let the model decide
Quality (--quality)
auto(default) — Model decides optimal qualityhigh— Higher detail, slowermedium— Balancedlow— Fastest
Output Format (--format)
png(default) — Losslessjpeg— Smaller file sizewebp— Modern format, good compression
Background (--background)
auto(default) — Model decidestransparent— Transparent background (png/webp only)opaque— Solid background
Other Options
--n <count>— Number of images to generate (default: 1)--output <filename>— Output filename (default: auto-generated)
Examples
Generate a simple image
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py --prompt "A serene mountain landscape at sunset with a lake"
Generate with specific size and output
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Modern minimalist logo for a tech startup" \
--size 1024x1024 \
--quality high \
--output "logo.png"
Generate landscape image
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Futuristic cityscape with flying cars" \
--size 1536x1024 \
--output "cityscape.png"
Generate with transparent background
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "A cute cartoon cat mascot" \
--background transparent \
--format png \
--output "mascot.png"
Generate multiple images
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Abstract art in the style of Kandinsky" \
--n 3 \
--output "art.png"
Edit existing images
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit \
--prompt "Add a rainbow in the sky" \
--input photo.png \
--output "photo-with-rainbow.png"
Combine multiple reference images
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit \
--prompt "Create a gift basket containing all items shown" \
--input item1.png item2.png item3.png \
--output "gift-basket.png"
Use a different model
python3 ${CLAUDE_SKILL_DIR}/gpt_image.py \
--prompt "Detailed portrait of a cat in watercolor style" \
--model gpt-image-1 \
--output "cat-portrait.png"
Error Handling
If the script fails:
- Check that
OPENAI_API_KEYis exported - If using a custom endpoint, verify
OPENAI_API_BASEis correct - Verify input image files exist and are readable (for editing)
- Ensure the output directory is writable
- Check that the model name is valid
Best Practices
- Be descriptive in prompts — include style, mood, colors, composition details
- For logos/icons, use square size (1024x1024) with transparent background
- For social media, use portrait (1024x1536) for stories or square for posts
- For wallpapers/headers, use landscape (1536x1024)
- Use
highquality for final output,autofor quick iterations - GPT Image models excel at text rendering — include text in prompts when needed
- For editing, provide clear instructions about what to change and what to keep
Frequently asked questions about GPT Image Skill
Similar skills
Algorithmic Art
Create generative art using p5.js and algorithmic philosophies.
Fal.ai Media Generation
Create images, videos, and audio with AI.
p5.js Production Pipeline
Create stunning generative art and interactive visuals.
ASCII Video Production
Transform videos into striking ASCII art animations.
Pixel Art
Transform images into retro pixel art and animations.
Generate Image
Create images quickly using AI providers.
