Generate or edit images using OpenAI GPT Image API (gpt-image-2, gpt-image-1, etc). Triggers: "gpt image", "openai image", "generate image with openai", "draw image", "create image", "image generation", "AI drawing", "图片生成", "AI绘图", "生成图片", "画图". Use this skill whenever the user wants to generate or edit images and mentions OpenAI, GPT, or when OPENAI_API_KEY is available.
npx skills add https://github.com/feiskyer/claude-code-settings --skill gpt-image-skill
Generate or edit images using OpenAI's GPT Image models through a bundled Python script.
Before running any command, resolve the absolute directory containing this SKILL.md and refer to it as <skill-dir>. Never assume the current working directory is the Skill directory. Keep user input and output paths relative to the user's working directory unless the user requests another location.
~/.gpt-image.env or export OPENAI_API_KEY=<your-key>~/.gpt-image.env or export it.python3 -m pip install -r "<skill-dir>/requirements.txt" if not installed yet.<skill-dir>/gpt_image.py python3 "<skill-dir>/gpt_image.py" --prompt "description of image" --output "filename.png"
python3 "<skill-dir>/gpt_image.py" edit --prompt "editing instructions" --input image1.png image2.png --output "edited.png"
Parent directories in the output path are created automatically. When --format is omitted, the script infers it from .png, .jpg/.jpeg, or .webp; otherwise it defaults to PNG.
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 generation1024x1024 (default) — Square1024x1536 — Portrait (2:3)1536x1024 — Landscape (3:2)auto — Let the model decideauto (default) — Model decides optimal qualityhigh — Higher detail, slowermedium — Balancedlow — Fastestpng (default) — Losslessjpeg — Smaller file sizewebp — Modern format, good compressionauto (default) — Model decidestransparent — Transparent background (png/webp only)opaque — Solid background--n <count> — Number of images to generate (default: 1)--output <filename> — Output filename (default: auto-generated)python3 "<skill-dir>/gpt_image.py" --prompt "A serene mountain landscape at sunset with a lake"
python3 "<skill-dir>/gpt_image.py" \
--prompt "Modern minimalist logo for a tech startup" \
--size 1024x1024 \
--quality high \
--output "logo.png"
python3 "<skill-dir>/gpt_image.py" \
--prompt "Futuristic cityscape with flying cars" \
--size 1536x1024 \
--output "cityscape.png"
python3 "<skill-dir>/gpt_image.py" \
--prompt "A cute cartoon cat mascot" \
--background transparent \
--format png \
--output "mascot.png"
python3 "<skill-dir>/gpt_image.py" \
--prompt "Abstract art in the style of Kandinsky" \
--n 3 \
--output "art.png"
python3 "<skill-dir>/gpt_image.py" edit \
--prompt "Add a rainbow in the sky" \
--input photo.png \
--output "photo-with-rainbow.png"
python3 "<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"
python3 "<skill-dir>/gpt_image.py" \
--prompt "Detailed portrait of a cat in watercolor style" \
--model gpt-image-1 \
--output "cat-portrait.png"
If the script fails:
OPENAI_API_KEY is exportedOPENAI_API_BASE is correcthigh quality for final output, auto for quick iterationsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Improves the quality of images, especially screenshots, by enhancing resolution, sharpness, and clarity. Perfect for preparing images for presentations, documentation, or social media posts.
Downloads videos from YouTube and other platforms for offline viewing, editing, or archival. Handles various formats and quality options.
Lightweight WSI tile extraction and preprocessing. Use for basic slide processing tissue detection, tile extraction, stain normalization for H&E images. Best for simple pipelines, dataset preparation, quick tile-based analysis. For advanced spatial proteomics, multiplexed imaging, or deep learning pipelines use pathml.
Microscopy data management platform. Access images via Python, retrieve datasets, analyze pixels, manage ROIs/annotations, batch processing, for high-content screening and microscopy workflows.
Python library for working with DICOM (Digital Imaging and Communications in Medicine) files. Use this skill when reading, writing, or modifying medical imaging data in DICOM format, extracting pixel data from medical images (CT, MRI, X-ray, ultrasound), anonymizing DICOM files, working with DICOM metadata and tags, converting DICOM images to other formats, handling compressed DICOM data, or processing medical imaging datasets. Applies to tasks involving medical image analysis, PACS systems, radiology workflows, and healthcare imaging applications.
This skill should be used when working with pre-trained transformer models for natural language processing, computer vision, audio, or multimodal tasks. Use for text generation, classification, question answering, translation, summarization, image classification, object detection, speech recognition, and fine-tuning models on custom datasets.
Take feiskyer/gpt-image-skill from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.