imagegen

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

5|1|Updated Jun 26, 2026
One-click install
npx skills add https://github.com/looooonk/better-codex --skill imagegen-looooonk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: imagegen
Source: https://github.com/looooonk/better-codex/tree/main/codex-rs/skills/src/assets/samples/imagegen
Command: npx skills add https://github.com/looooonk/better-codex --skill imagegen-looooonk

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 lets Codex generate or edit those images directly in the project workflow. ## Core Features & Use Cases - Built-in image generation and editing: Uses the built-in image_gen tool by default for new images, edits, and simple transparent-background requests without requiring an API key. - Transparent background workflow: Generates subjects on a flat chroma-key background and removes it locally with a helper script to produce alpha PNG/WebP assets. - Fallback CLI mode: A bundled scripts/image_gen.py CLI supports generate, edit, and generate-batch subcommands with explicit model, quality, size, mask, and output-path controls when the user opts in. - Use Case: A developer building a landing page asks for a hero product image; the Skill generates it with the built-in tool, moves the final PNG into the workspace, and reports the saved path. ## Quick Start Ask Codex to generate a hero image of your product for the landing page and save it into the project assets folder.

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 this Skill?▼

Describe the image you want and Codex uses the built-in image_gen tool by default, with no API key required. The generated file is saved under $CODEX_HOME and can be moved into your project workspace.

How do I create an image with a transparent background?▼

The default path generates the subject on a flat chroma-key background with the built-in tool, then removes the key color locally using the remove_chroma_key.py helper to produce an alpha PNG. True native transparency requires the CLI fallback with gpt-image-1.5 after your confirmation.

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 batch generation from JSONL. It requires OPENAI_API_KEY and network access.

Does gpt-image-2 support transparent backgrounds?▼

No, gpt-image-2 does not support background=transparent. The Skill uses chroma-key generation plus local removal by default, and only switches to gpt-image-1.5 with background transparent after explicit user confirmation.

When should I not use AI image generation for an asset?▼

Avoid it when extending an existing SVG or vector icon system, creating simple shapes or diagrams better done in HTML/CSS/canvas, or editing an asset that already exists in an editable native format.