imagegen

Generate and edit raster images using GPT Image models via built-in tool or CLI.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/chhpt/skills --skill imagegen-chhpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: imagegen
Source: https://github.com/chhpt/skills/tree/main/skills/imagegen
Command: npx skills add https://github.com/chhpt/skills --skill imagegen-chhpt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openai, pillow, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Creating bitmap assets like photos, illustrations, sprites, mockups, and transparent cutouts normally requires design tools or manual API scripting; this Skill generates and edits raster images directly in the project workflow with a built-in image tool and a guarded CLI fallback. ## Core Features & Use Cases - Built-in generation and editing: Create new images or edit existing ones with the built-in image_gen tool, including multi-asset batches via repeated calls. - Transparent-background workflow: Generate subjects on a flat chroma-key background and remove it locally with remove_chroma_key.py to produce alpha PNG/WebP cutouts. - CLI fallback mode: Use scripts/image_gen.py with generate, edit, and generate-batch subcommands for explicit model, quality, size, mask, and output-path control via the OpenAI Image API. - Use Case: A developer needs a landing-page hero image and a transparent product cutout; the Skill generates the hero with the built-in tool, then produces the cutout via chroma-key generation and local alpha extraction, saving both into the workspace. ## Quick Start Ask the agent to generate a hero image of your product for the landing page and save it into the project workspace.

Frequently Asked Questions about imagegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with a transparent background?

Generate the subject on a flat solid chroma-key background (default #00ff00) with the built-in image_gen tool, then run remove_chroma_key.py locally to convert the key color to alpha. True native transparency requires the CLI fallback with gpt-image-1.5 and --background transparent, after user confirmation.

When should I use the image_gen CLI fallback instead of the built-in tool?

Use scripts/image_gen.py only when the user explicitly asks for CLI/API/model controls, or confirms a true-transparency fallback. The built-in image_gen tool handles normal generation, editing, and simple transparent requests without requiring OPENAI_API_KEY.

Does gpt-image-2 support transparent backgrounds?

No, gpt-image-2 does not support background=transparent. The default path is built-in generation on a chroma-key background plus local removal; true transparency requires gpt-image-1.5 with --background transparent and output format png or webp.

What image sizes does gpt-image-2 support?

gpt-image-2 accepts auto or WIDTHxHEIGHT sizes where edges are multiples of 16, max edge is 3840px, aspect ratio is at most 3:1, and total pixels stay between 655,360 and 8,294,400. Popular sizes include 1024x1024, 1536x1024, 2048x1152, and 3840x2160.

Why does the image generation CLI fail with an API key error?

The CLI fallback requires OPENAI_API_KEY set as an environment variable for live API calls; dry-run mode works without it. Create a key in the OpenAI platform UI and export it in your shell before running generate or edit commands.

When should I not use AI image generation for a visual asset?

Avoid it when extending an existing SVG/vector icon or logo system, building simple shapes or diagrams better done in HTML/CSS/canvas, or editing an asset that already exists in an editable native format. The Skill targets bitmap output, not code-native visuals.