Design & Frontend ✓ OpenAI · Official

Codex Image Generation Skill (imagegen)

Generate or edit bitmap assets — photos, illustrations, textures, UI and product mockups — directly in Codex, with local transparent-background processing.

56/ 100
Use with care

Useful, but reliability, evidence or controls still have material gaps.

See how it was scored ↓
Works as-is in
Codex
Stars
★ 129k
Last updated
11d ago
License
Apache-2.0
image-generationgpt-image-2chroma-keybackground-removal
+4prompt-engineeringclipythonopenai-api

What does this skill do, and when should you use it?

imagegen is one of the bundled skills in OpenAI's Codex repository, teaching Codex when and how to generate or edit raster images. It defaults to Codex's built-in image_gen tool, which requires no API key; the bundled scripts/image_gen.py CLI (requiring OPENAI_API_KEY) is used only when the user explicitly asks for the CLI/API path or needs true native transparency. The skill ships a use-case taxonomy, shared prompt templates, batching strategy, and a complete chroma-key workflow that converts a flat key-color background into an alpha PNG/WebP locally. It also draws a clear boundary: SVG, icon, and logo work should stay code-native rather than be replaced by AI-generated bitmaps.

  • Generates new images via the built-in image_gen tool (concept art, product shots, website heroes, UI mockups) or style-matched variants from reference images
  • Edits images already in conversation context: inpainting, background replacement, object removal, compositing, lighting/weather changes
  • Handles batch requests via one built-in call per asset, or the CLI generate-batch subcommand in fallback mode
  • Creates transparent images by generating on a chroma-key background (default #00ff00) and running remove_chroma_key.py locally to produce alpha PNG/WebP
  • Applies save-path policy: moves project-bound assets from $CODEX_HOME/generated_images/ into the workspace with versioned filenames to avoid overwrites
  • In CLI fallback, calls gpt-image-2 via scripts/image_gen.py with quality and size control up to 3840px
Good fit
  • A frontend developer generating hero images, product mockups, or UI visuals for a landing page directly into the workspace
  • A game developer batch-producing textures and sprite bitmaps that must land as final files in the project directory
  • A marketer or designer swapping a product photo's background or changing lighting/weather while strictly preserving the product itself
  • Users needing transparent-background icons or assets via the chroma-key workflow, with CLI gpt-image-1.5 native transparency (after confirmation) for complex subjects like hair, glass, or smoke
  • Users producing multiple variants for one task, such as several ad creative versions
Not a fit
  • Tasks involving existing SVG/vector icon sets, logos, or simple shapes and diagrams — the skill explicitly directs these to code-native editing instead of generated bitmaps
  • Non-Codex environments: the built-in image_gen tool and $CODEX_HOME conventions are Codex-specific; other platforms are limited to the CLI fallback path, which needs adaptation
  • Users who need fine CLI controls (quality/size/masks) but won't set OPENAI_API_KEY — that path requires the key

How do you install this skill?

Before you use it
  • Image generation depends on an external model service; handling, retention, and privacy boundaries for prompts and input images are not explicitly documented.
  • CLI mode requires OPENAI_API_KEY, Python dependencies, and network access; mainland-China users may face service reachability or network-approval issues.
  • No tests or CI evidence cover the key paths, so output quality, text accuracy, transparency edges, and edit invariants require manual verification.
Before you start
Your agent needs
  • Shell / CLI
  • Network access
  • Local filesystem
Install first
  • Python (openai, pillow packages)
  • OPENAI_API_KEY (CLI fallback only)
  • Codex built-in image_gen tool (default mode)

The skill ships inside the Codex repository as a bundled sample/system skill and requires no separate installation.

Codex (install the Codex CLI; the skill comes with the repo)

curl -fsSL https://chatgpt.com/codex/install.sh | sh

or

npm install -g @openai/codex

CLI fallback dependencies (only if using scripts/image_gen.py)

uv pip install openai
uv pip install pillow

How do you use this skill?

Try saying

Once installed, send your agent any of these to trigger it:

  • Generate a minimal hero image of a ceramic coffee mug for our landing page, soft studio lighting, no logos or text, save as assets/hero.png
  • Replace the background of product photo hero.jpg with a warm sunset gradient; change only the background and keep the product and edges unchanged
  • Generate a mascot icon on a flat #00ff00 chroma-key background, then remove the background and output a transparent PNG to assets/mascot.png
  • Use CLI mode to batch-generate 5 ad banners in different styles, output to output/imagegen/

The skill triggers automatically when Codex detects an image generation or editing task. Default flow: pick the mode first (built-in image_gen preferred; CLI fallback only when explicitly requested or confirmed for native transparency), then decide intent (generate vs edit), output purpose (preview-only vs project asset), and execution strategy (single asset / repeated calls / generate-batch). You supply prompts, verbatim text, constraints, and input images; the skill labels each input's role and loads local files with view_image before built-in edits. Transparent requests follow the chroma-key flow:

python "${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/scripts/remove_chroma_key.py" \
  --input <source> \
  --out <final.png> \
  --auto-key border \
  --soft-matte \
  --transparent-threshold 12 \
  --opaque-threshold 220 \
  --despill

CLI fallback offers generate / edit / generate-batch subcommands, with intermediates in tmp/imagegen/ and final artifacts in output/imagegen/. Note: ordinary quality/size/path control is not a reason to switch to CLI, and downgrading to gpt-image-1.5 always requires asking the user first.

What are this skill's strengths and limitations?

Pros
  • Built-in tool mode requires no API key and works out of the box
  • Extremely explicit rules on when to use built-in vs CLI fallback and when to ask the user, reducing misuse
  • Ships full prompt templates, a use-case taxonomy with exact slugs, and per-asset-type examples
  • Transparent backgrounds have a concrete local chroma-key solution with soft matte, despill, and edge-tuning parameters
  • Clear save-path and no-overwrite policy keeps project assets out of default directories
Limitations
  • Tightly coupled to Codex: built-in image_gen, view_image, and $CODEX_HOME paths are Codex-specific and need rewriting for other Agent Skills clients
  • True native transparency requires downgrading to gpt-image-1.5 (gpt-image-2 lacks background=transparent) plus OPENAI_API_KEY
  • Chroma-key removal is limited for complex subjects like fur, smoke, glass, and translucent materials
  • scripts/image_gen.py must never be modified, limiting customization
  • The repo has no GitHub topics, and the README targets the whole Codex CLI, so standalone documentation for this skill is limited

How does this skill compare with similar options?

Side by side with related skills; every score comes from the same FSRS standard.

Skill FS score Stars Last updated License
Codex Image Generation Skill (imagegen) this page ✓ OpenAI · Official 56 · Use with care ★ 129k 11d ago Apache-2.0
GPT Image 2 Creative Workflow 53 · Use with care ★ 13k 15d ago MIT
Banana Claude — Gemini Image Creative Director 59 · Recommended ★ 1.1k 7d ago MIT
Academic Figure Prompt — Modern ML Airy Style 68 · Recommended ★ 2.6k 7mo ago MIT
Academic Figure Prompt Generator 69 · Recommended ★ 2.6k 7mo ago MIT

The skill itself contrasts its two execution paths: the built-in image_gen tool (default, key-free, transparency via chroma-key post-processing) versus the CLI fallback (scripts/image_gen.py with gpt-image-2/1.5, key required, supporting quality, sizes, masks, and native transparency). They are complementary, not competing.

How did FollowSkills review this skill?

FollowSkills review · FSRS-2.0
Use with care
56/ 100 5-point scale 2.8 / 5
The upstream repository has new commits since this review. The score still applies to the reviewed revision shown and may not cover the latest changes.
1Trust18 / 25 · 3.6/5

The documentation separates built-in and CLI modes, requires confirmation for the transparency downgrade, avoids overwriting files, handles API keys cautiously, and discusses network-approval risk. It does not fully disclose image/prompt data flows, retention or privacy behavior, built-in-tool external effects, or a general rollback mechanism, so 7 points are deducted.

2Reliability8 / 20 · 2.0/5

The script and docs provide parameter validation, missing-dependency guidance, output-collision protection, batch limits, and some transient-error retries; the main path is plausible from static inspection. However, there is no committed test suite or execution evidence, and built-in-tool failure coverage and recovery remain limited, so the score is capped conservatively.

3Adaptability10 / 15 · 3.3/5

Use cases, generate/edit distinctions, non-fit cases, trigger rules, and output handling are clearly described. Chinese-language support is not documented, and the CLI depends on OpenAI network services without evidence of mainland-China reachability or a practical alternative, so 5 points are deducted.

4Convention11 / 15 · 3.7/5

The package has strong information architecture, progressive disclosure, dependency notes, parameters, examples, limitations, and cross-references. It lacks an intrinsic version, changelog, explicit maintenance owner, and update path; license and governance are mainly supplied as external metadata, so 4 points are deducted.

5Effectiveness6 / 15 · 2.0/5

The skill covers generation, editing, batching, transparency workflows, and project-local artifact handling, with a clear core benefit. Static files do not verify output quality, text accuracy, or iteration outcomes, so limited manual review remains necessary and 1 point is deducted.

6Verifiability3 / 10 · 1.5/5

The SKILL.md, reference documents, and CLI source provide auditable rules, parameters, and diagnostics, making some claims source-checkable. There is no committed test suite, CI coverage, or third-party execution record, so the static evidence supports only a low score.

1 2 3 4 5 6

Open a dimension to read why it scored that way

Reviewed Jul 19, 2026 Reviewed revision 678157acaa81 Review evidence[1][2][3][4][5][6][7][8][9]

Evidence confidence:Low — Mostly static review, author material or a limited demo; useful for discovery, not high-risk decisions.

See the full review method →

FAQ

Do I need an OpenAI API key?
Not for the default built-in image_gen tool. The key (OPENAI_API_KEY) is only required if you explicitly choose the CLI fallback (scripts/image_gen.py), and the skill instructs Codex to never ask you to paste the full key in chat.
Where do generated images get saved?
In built-in mode they default to $CODEX_HOME/generated_images/ and similar paths. Project-bound assets must be moved or copied into the workspace, with final paths reported at the end. Preview-only images may stay at the default path and render inline.
How does transparent background work?
By default the built-in tool generates the subject on a flat chroma-key background (#00ff00, or #ff00ff for green subjects), then remove_chroma_key.py converts it to an alpha PNG/WebP locally. Only for complex subjects or failed local removal does it ask before switching to CLI gpt-image-1.5 --background transparent.
Can I use it in Claude Code or other platforms?
The prompt methodology (taxonomy, templates, chroma-key flow) is portable, but the built-in image_gen/view_image tool calls and $CODEX_HOME script paths are Codex-specific and would need adaptation elsewhere.

More skills from this repository

All from openai/codex

Dev & Engineering ✓ OpenAI · Official

Codex Issue Digest

Turns recent openai/codex bugs and enhancement requests into focused, owner-ready digests.

★ 129k FS 57 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Breaking Change Reviewer

Systematically detect compatibility risks across external integration surfaces before they reach users.

★ 129k FS 37 Not recommended 11d ago
Dev & Engineering ✓ OpenAI · Official

OpenAI Official Docs Assistant

Provides current, official-source guidance for OpenAI products, APIs, Codex, and model migrations.

★ 129k FS 52 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex Plugin Builder

Scaffold, validate, and maintain standards-shaped plugins for Codex.

★ 129k FS 55 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

PR Babysitter

Continuously track a GitHub pull request’s reviews, CI, and mergeability while handling safe fixes.

★ 129k FS 57 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex Pull Request Editor

Professionally update one or more GitHub pull request titles and bodies around motivation, net changes, and verification.

★ 129k FS 50 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

V8 Version Maintainer

Updates Codex’s pinned V8 versions and validates release-candidate and build-failure paths.

★ 129k FS 50 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex Bug Triage Assistant

Determines whether an openai/codex GitHub bug should be verified, clarified, or explained as expected behavior.

★ 129k FS 40 Not recommended 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex TUI Interactive Testing Guide

A focused workflow for launching Codex TUI and validating changes with trace logs.

★ 129k FS 37 Not recommended 11d ago
Dev & Engineering ✓ OpenAI · Official

Context Governance

Keep coding-agent context incremental, cache-stable, and strictly bounded.

★ 129k FS 35 Not recommended 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex Bundled Skill Installer

Install curated or repository-hosted Codex skills without manually assembling their files and paths.

★ 129k FS 53 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Review Agent Code Review Skill

Find actionable regressions in code changes through a read-only, defect-first review.

★ 129k FS 52 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Remote Executor Integration Tests

Validate Codex integration behavior across local and remote execution environments.

★ 129k FS 50 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Change Size Review Guide

Keep code changes reviewable by enforcing practical size limits and staging oversized work.

★ 129k FS 48 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex Path Types Guide

Choose Rust path types that preserve cross-platform URI handling and local filesystem behavior in Codex.

★ 129k FS 47 Use with care 11d ago
Dev & Engineering ✓ OpenAI · Official

Codex Sample Skill Creator Guide

A practical guide to designing, validating, and refining reusable Agent Skills.

★ 129k FS 46 Use with care 11d ago
Automation & Ops ✓ OpenAI · Official

CI Push Approval Assistant

Handle CI configuration push blocks and approval handoffs

★ 129k FS 45 Not recommended 11d ago
Dev & Engineering ✓ OpenAI · Official

Code Review and Testing Guidance

Helps coding agents choose and structure tests for logic changes.

★ 129k FS 43 Not recommended 11d ago
Dev & Engineering ✓ OpenAI · Official

Pull Request Code Review

Orchestrate a final pull request review and consolidate every actionable finding from specialized reviewers.

★ 129k FS 33 Not recommended 11d ago

Related skills