imagegen

A guide for generating or editing raster images, meaning bitmap pictures made from pixels, for projects such as websites, games, mockups, and logos.

In plain words
What is it for?
It helps create new images, edit existing images, make batches of images through the fallback command-line tool, and preserve transparent backgrounds.
Why use it?
It clarifies which image-generation method to use and how to handle normal, transparent-background, and command-line requests.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/openai/codex/imagegen
Any agent
npx skills add openai/codex --skill imagegen
Clone the repo
git clone --depth 1 https://github.com/openai/codex

Made for: Claude Code, Codex.

Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00113 $0.04220
Opus 5 $0.00056 $0.02110
Sonnet 5 $0.00023 $0.00844
Haiku 4.5 $0.00011 $0.00422

Measured yesterday against content hash 681ddb4ad6d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

imagegen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/image_gen.py, scripts/remove_chroma_key.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

  • imagegen — 100% identical, 0 lines differ
  • imagegen — 100% identical, 0 lines differ
  • imagegen — 89% identical, 12 lines differ
  • imagegen — 86% identical, 67 lines differ
  • imagegen — 86% identical, 67 lines differ
  • imagegen — 86% identical, 671 lines differ
  • imagegen — 86% identical, 67 lines differ
  • imagegen — 86% identical, 67 lines differ
codex-rs/skills/src/assets/samples/imagegen/SKILL.md · 316 lines

How it starts

The opening of the file, as written. The whole thing — 316 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Image Generation Skill

Generates or edits images for the current project (for example website assets, game assets, UI mockups, product mockups, wireframes, logo design, photorealistic images, or infographics).

Top-level modes and rules

This skill has exactly two top-level modes:

  • Default built-in tool mode (preferred): built-in image_gen tool for image generation, editing, and transparent-image requests. Does not require OPENAI_API_KEY.
  • Fallback CLI mode: scripts/image_gen.py CLI. Use when the user explicitly asks for or confirms the CLI/API/model path. Requires OPENAI_API_KEY.

Within CLI fallback, the CLI exposes three subcommands:

  • generate
  • edit
  • generate-batch

Rules:

  • Use the built-in image_gen tool by default for normal image generation and editing requests.
  • Do not switch to CLI fallback for ordinary quality, size, or file-path control.
  • For transparent images, ask built-in image_gen for a transparent background and preserve the generated alpha.
  • Never silently switch from built-in image_gen or CLI gpt-image-2 to CLI gpt-image-1.5; ask the user first unless they explicitly requested gpt-image-1.5.
  • The word batch by itself does not mean CLI fallback. If the user asks for many assets or says to batch-generate assets without explicitly asking for CLI/API/model controls, stay on the built-in path and issue one built-in call per requested asset or variant.
  • If the built-in tool fails or is unavailable, tell the user the CLI fallback exists and that it requires OPENAI_API_KEY. Proceed only if the user explicitly asks for that fallback.
  • If the user explicitly asks for CLI mode, use the bundled scripts/image_gen.py workflow. Do not create one-off SDK runners.
  • Never modify scripts/image_gen.py. If something is missing, ask the user before doing anything else.

Built-in save-path policy:

  • In built-in tool mode, Codex saves generated images under $CODEX_HOME/* by default.
  • Do not describe or rely on OS temp as the default built-in destination.
  • Do not describe or rely on a destination-path argument (if any) on the built-in image_gen tool. If a specific location is needed, generate first and then move or copy the selected output from $CODEX_HOME/generated_images/....
  • Save-path precedence in built-in mode:
    1. If the user names a destination, move or copy the selected output there.
    2. If the image is meant for the current project, move or copy the final selected image into the workspace before finishing.
    3. If the image is only for preview or brainstorming, render it inline; the underlying file can remain at the default $CODEX_HOME/* path.
  • Never leave a project-referenced asset only at the default $CODEX_HOME/* path.
  • Do not overwrite an existing asset unless the user explicitly asked for replacement; otherwise create a sibling versioned filename such as hero-v2.png or item-icon-edited.png.

Read the full file on GitHub · 316 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 316 lines · 113 tokens per session scan A 681ddb4ad6d0

Subscribe to this mod's changes

imagegen is a skill published in the GitHub repository openai/codex (120,598 stars, last pushed today), licensed Apache-2.0. It adds 113 tokens to every session and 4,220 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

media-ingest

Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.

garrytan/gbrain · 52 tokens

diagnostic-stem-delivery

Audio production with diagnostic analysis, timecode parsing from documents, and verified export workflow.

HKUDS/OpenSpace · 23 tokens

vox-director

Turn ONE topic into a finished Vox-style paper-collage explainer / ad video, end to end on the Atlas Cloud API + local ffmpeg — script, collage keyframes, motion, voice-over, music, captions, all automated. Use this whenever the user wants a "Vox style" video, a paper/torn-paper collage animation, a "motion collage"…

Alisa0808/vox-director · 236 tokens

seedance-vocab-ja

This skill should be used when the user asks for Japanese Seedance 2.0 prompt wording, Japanese cinematic vocabulary, or translation of camera, lighting, action, VFX, audio, and production terms into Japanese.

Emily2040/seedance-2.0 · 50 tokens

model-compatibility

Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models.

artokun/comfyui-mcp · 47 tokens