{"id":"gpt-image-skill","name":"gpt-image-skill","summary":"OpenAI GPT画像API(gpt-image-2、gpt-image-1など)を使って画像を生成または編集できます。","body":"# GPT Image Skill\n\nGenerate or edit images using OpenAI's GPT Image models through a bundled Python script.\n\n## Requirements\n\n1. **OPENAI_API_KEY**: Must be configured in `~/.gpt-image.env` or `export OPENAI_API_KEY=<your-key>`\n2. **OPENAI_API_BASE** (optional): Custom API base URL for compatible endpoints (e.g. Azure OpenAI, proxies). Set in `~/.gpt-image.env` or export it.\n3. **Python3 with dependencies**: openai, Pillow. Install via `python3 -m pip install -r ${CLAUDE_SKILL_DIR}/requirements.txt` if not installed yet.\n4. **Executable**: `${CLAUDE_SKILL_DIR}/gpt_image.py`\n\n## Instructions\n\n### For image generation\n\n1. Ask the user for:\n   - What they want to create (the prompt)\n   - Desired size (optional, defaults to 1024x1024)\n   - Output filename (optional, auto-generates UUID-based name if not specified)\n   - Model preference (optional, defaults to gpt-image-2)\n   - Quality (optional, defaults to auto)\n   - Number of images (optional, defaults to 1)\n\n2. Run the script:\n\n   ```bash\n   python3 ${CLAUDE_SKILL_DIR}/gpt_image.py --prompt \"description of image\" --output \"filename.png\"\n   ```\n\n3. Show the user the saved image path when complete.\n\n### For image editing\n\n1. Ask the user for:\n   - Input image file(s) to edit (up to 3)\n   - What changes they want (the prompt)\n   - Output filename (optional)\n\n2. Run with input images:\n\n   ```bash\n   python3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit --prompt \"editing instructions\" --input image1.png image2.png --output \"edited.png\"\n   ```\n\n## Available Options\n\n### Models (--model)\n\n- `gpt-image-2` (default) — Latest model with strong instruction following, text rendering, and broad world knowledge\n- `gpt-image-1.5` — Mid-tier model\n- `gpt-image-1` — First-generation GPT image model\n- `gpt-image-1-mini` — Lightweight, faster generation\n\n### Sizes (--size)\n\n- `1024x1024` (default) — Square\n- `1024x1536` — Portrait (2:3)\n- `1536x1024` — Landscape (3:2)\n- `auto` — Let the model decide\n\n### Quality (--quality)\n\n- `auto` (default) — Model decides optimal quality\n- `high` — Higher detail, slower\n- `medium` — Balanced\n- `low` — Fastest\n\n### Output Format (--format)\n\n- `png` (default) — Lossless\n- `jpeg` — Smaller file size\n- `webp` — Modern format, good compression\n\n### Background (--background)\n\n- `auto` (default) — Model decides\n- `transparent` — Transparent background (png/webp only)\n- `opaque` — Solid background\n\n### Other Options\n\n- `--n <count>` — Number of images to generate (default: 1)\n- `--output <filename>` — Output filename (default: auto-generated)\n\n## Examples\n\n### Generate a simple image\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py --prompt \"A serene mountain landscape at sunset with a lake\"\n```\n\n### Generate with specific size and output\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py \\\n  --prompt \"Modern minimalist logo for a tech startup\" \\\n  --size 1024x1024 \\\n  --quality high \\\n  --output \"logo.png\"\n```\n\n### Generate landscape image\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py \\\n  --prompt \"Futuristic cityscape with flying cars\" \\\n  --size 1536x1024 \\\n  --output \"cityscape.png\"\n```\n\n### Generate with transparent background\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py \\\n  --prompt \"A cute cartoon cat mascot\" \\\n  --background transparent \\\n  --format png \\\n  --output \"mascot.png\"\n```\n\n### Generate multiple images\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py \\\n  --prompt \"Abstract art in the style of Kandinsky\" \\\n  --n 3 \\\n  --output \"art.png\"\n```\n\n### Edit existing images\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit \\\n  --prompt \"Add a rainbow in the sky\" \\\n  --input photo.png \\\n  --output \"photo-with-rainbow.png\"\n```\n\n### Combine multiple reference images\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py edit \\\n  --prompt \"Create a gift basket containing all items shown\" \\\n  --input item1.png item2.png item3.png \\\n  --output \"gift-basket.png\"\n```\n\n### Use a different model\n\n```bash\npython3 ${CLAUDE_SKILL_DIR}/gpt_image.py \\\n  --prompt \"Detailed portrait of a cat in watercolor style\" \\\n  --model gpt-image-1 \\\n  --output \"cat-portrait.png\"\n```\n\n## Error Handling\n\nIf the script fails:\n\n- Check that `OPENAI_API_KEY` is exported\n- If using a custom endpoint, verify `OPENAI_API_BASE` is correct\n- Verify input image files exist and are readable (for editing)\n- Ensure the output directory is writable\n- Check that the model name is valid\n\n## Best Practices\n\n1. Be descriptive in prompts — include style, mood, colors, composition details\n2. For logos/icons, use square size (1024x1024) with transparent background\n3. For social media, use portrait (1024x1536) for stories or square for posts\n4. For wallpapers/headers, use landscape (1536x1024)\n5. Use `high` quality for final output, `auto` for quick iterations\n6. GPT Image models excel at text rendering — include text in prompts when needed\n7. For editing, provide clear instructions about what to change and what to keep","author":"@feiskyer","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/feiskyer/claude-code-settings/tree/main/skills/gpt-image-skill","license":"MIT","category":"coding","lang":"en","tokens":1342,"stars":0,"calls30d":2,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"evals/evals.json","size":926,"sha256":"266e03598474e0c0974a2701e919f543ac961d3a348638353713119df5d86a4f"},{"path":"gpt_image.py","size":5976,"sha256":"813aa68fc297d2cc649ff719a8515b1ab425daac65169262bad557874955d6c1"},{"path":"requirements.txt","size":34,"sha256":"965c299e2682cbf0af534d06334d94cdc4215cbd7801ab345da4228a8494e0ca"}],"requires":{"mcp":[],"tools":["Read","Write","Glob","Grep","Task","Bash(cat:*)","Bash(ls:*)","Bash(tree:*)","Bash(python3:*)"]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":[]}}