imagegen

Generate and edit raster images using the built-in image_gen tool or a GPT Image CLI fallback.

Updated Jul 22, 2026
One-click install
npx skills add https://github.com/Chau165/local_skill --skill imagegen-chau165
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: imagegen
Source: https://github.com/Chau165/local_skill/tree/main/codex/skills/.system/imagegen
Command: npx skills add https://github.com/Chau165/local_skill --skill imagegen-chau165

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 or editing bitmap assets such as photos, illustrations, sprites, mockups, and transparent cutouts normally requires manual design work; this Skill lets Codex produce those raster images directly from prompts while enforcing consistent prompt structure, output paths, and model constraints. ## Core Features & Use Cases - Built-in image_gen mode by default: Generate, edit, and produce transparent-background images without needing an OpenAI API key, with clear save-path rules for project-bound assets. - Explicit CLI fallback: A bundled scripts/image_gen.py CLI with generate, edit, and generate-batch subcommands for users who explicitly request API/model controls such as quality, size, masks, and batch JSONL jobs. - Structured prompt workflow: A use-case taxonomy and labeled prompt schema (scene, subject, style, constraints, verbatim text) shared across both modes, plus a chroma-key removal script for transparent cutouts. - Use Case: A developer needs a landing-page hero image and three game sprites; the Skill issues one built-in image_gen call per asset, then moves the selected finals into the project workspace with versioned filenames. ## Quick Start Ask Codex to generate a hero image of your product with soft studio lighting and save it into the current 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 the imagegen skill?

Describe the image you want and Codex uses the built-in image_gen tool by default, with no API key required. The prompt is normalized into a structured spec covering scene, subject, style, composition, and constraints before generation.

How do I create an image with a transparent background?

Ask the built-in image_gen tool for a transparent background and it preserves the generated alpha channel. In CLI fallback mode, gpt-image-2 does not support background transparency, so the confirmed gpt-image-1.5 path or local chroma-key removal with remove_chroma_key.py is used instead.

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

Use the scripts/image_gen.py CLI only when you explicitly need API or model controls such as quality, size, masks, input fidelity, or JSONL batch generation. It requires OPENAI_API_KEY and network access, and ordinary quality or path preferences do not justify switching.

Does gpt-image-2 support custom image sizes?

Yes, gpt-image-2 accepts auto or any WIDTHxHEIGHT 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, 2048x1152, and 3840x2160.

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

Avoid it when extending an existing SVG icon set, logo system, or illustration library in the repo, or when simple shapes and diagrams are better built directly in SVG, HTML/CSS, or canvas. The Skill targets bitmap output, not code-native vector assets.

Why does the imagegen CLI fail with an API key error?

The CLI 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.