Skip to content
Skills Library
Marketing & content · Building & coding

codex-imagegen

/codex-imagegen

Generates raster images (game sprites, textures, icons, backgrounds, illustrations, concept art, mockups) through the OpenAI Codex CLI's built-in image generator, billed to the user's ChatGPT plan instead of a paid API key, and returns the files to the calling agent to review and post-process. Use when a task needs a new bitmap image or a variant of an existing one from references, even if the user does not mention Codex or ChatGPT, for example "generate an image", "draw a sprite", "make a texture, icon or background", "I need art for the game", "generate it with ChatGPT". Do not use for SVG o

Licence
MIT
Last repository change
10.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/generate.py

What it does and when to use it

Generates raster images (game sprites, textures, icons, backgrounds, illustrations, concept art, mockups) through the OpenAI Codex CLI's built-in image generator, billed to the user's ChatGPT plan instead of a paid API key, and returns the files to the calling agent to review and post-process. Use when a task needs a new bitmap image or a variant of an existing one from references, even if the user does not mention Codex or ChatGPT, for example "generate an image", "draw a sprite", "make a texture, icon or background", "I need art for the game", "generate it with ChatGPT". Do not use for SVG o

Triggers from the description

s built-in image generator, billed to the usergenerate an imagedraw a spritemake a texture, icon or backgroundI need art for the gamegenerate it with ChatGPT
Original author description

Generates raster images (game sprites, textures, icons, backgrounds, illustrations, concept art, mockups) through the OpenAI Codex CLI's built-in image generator, billed to the user's ChatGPT plan instead of a paid API key, and returns the files to the calling agent to review and post-process. Use when a task needs a new bitmap image or a variant of an existing one from references, even if the user does not mention Codex or ChatGPT, for example "generate an image", "draw a sprite", "make a texture, icon or background", "I need art for the game", "generate it with ChatGPT". Do not use for SVG o

How it works

  1. Generate
  2. Write the prompt
  3. After generating
  4. Spend the quota carefully
  5. Limits
Original SKILL.md headings · 63 lines, 797 words
SKILL.md preview
---
name: codex-imagegen
description: Generates raster images (game sprites, textures, icons, backgrounds, illustrations, concept art, mockups) through the OpenAI Codex CLI's built-in image generator, billed to the user's ChatGPT plan instead of a paid API key, and returns the files to the calling agent to review and post-process. Use when a task needs a new bitmap image or a variant of an existing one from references, even if the user does not mention Codex or ChatGPT, for example "generate an image", "draw a sprite", "make a texture, icon or background", "I need art for the game", "generate it with ChatGPT". Do not use for SVG or vector graphics, charts, visuals that are simpler to build in code (CSS, canvas, shaders, procedural generation), editing existing vector assets, or inside Codex itself, which has image generation built in.
license: MIT
compatibility: Requires the OpenAI Codex CLI signed in with a ChatGPT account whose plan includes image generation, and Python 3.8+.
metadata:
  author: lothlorienblade
  version: "1.0.0"
---

# Codex Image Generation

Generate raster images with the image generator built into the OpenAI Codex CLI. The images are billed to the ChatGPT plan the CLI is signed in with, so no API key is needed. [scripts/generate.py](scripts/generate.py) runs Codex non-interactively, finds the images it saved, and copies them into a folder you choose.

## Generate

```bash
python scripts/generate.py --prompt "<prompt>" --out-dir <folder> --name <file name without extension>
```

The script path is relative to this skill's folder. Use `python3` or `py` where `python` is not the interpreter. A run takes one to two minutes, so allow a command timeout of about 10 minutes.

Options:

- `--reference a.png --reference b.png`: reference images for style, palette, or shape. For a series that must look like one set, pass images from the series that are already approved: without references every call draws in its own style.
- `--model` and `--effort`: the Codex agent model, `gpt-6.1-sol` at `medium` by default, or `CODEX_IMAGEGEN_MODEL` and `CODEX_IMAGEGEN_EFFORT` when set. The agent only relays the prompt to the `image_gen` tool, which draws the same way whichever model calls it, so a frontier model at high effort only spends quota. Change these when the user asks or when the default is not available.
- `--keep-user-config`: load `~/.codex/config.toml`. It is skipped by default because the user's MCP servers and plugins slow the run and spend quota. Use it only if `image_gen` is unavailable without it.
- `--prompt-file`: read a long prompt from a UTF-8 file instead of `--prompt`.

The script prints `IMAGE: <path>` for every copied file and exits with:

| Code | Meaning | What to do |
| --- | --- | --- |
| 0 | Images copied | Review them |
| 1 | Other failure; the tail of the log and the full log path are printed | Read the error, fix the cause, do not retry blindly |
| 2 | The plan's usage limit is reached; `USAGE_LIMIT:` gives the reset time | Do not retry. Tell the user when the limit resets |
| 3 | The model is not offered to this CLI version | Suggest updating the CLI (`npm i -g @openai/codex@latest`) instead of silently switching models |

## Write the prompt

Write prompts in English, which the generator follows most precisely. State:

- what is shown and what it is for (game sprite, seamless texture, app icon, menu background);
- style, view angle, lighting, palette;
- background: `transparent background` for sprites and icons, which gives a real alpha channel;
- **the aspect ratio, chosen for where the image will be used**, such as `square 1:1` for a sprite or `landscape 16:9` for a screen background. Without it the generator draws a square, and a square cropped to a banner loses its composition.

The generator does not honor exact pixel sizes: pick the closest supported aspect ratio and get the exact size by cropping and scaling afterwards. Aspect ratios by asset type, the 3:1 limit, and prompt recipes: [references/prompting.md](references/prompting.md).

Generate one image per call and give each a descriptive `--name`, so a weak result can be redone alone.

## After generating

1. **Look at every image yourself** before showing it: does it match the prompt, is the background really transparent, are there artifacts? The generator often leaves a colored fringe along the alpha edge and stray pixels; clean them before the image goes into a game or UI.
2. **Fit it to its purpose**: trim empty margins, scale to the target size, slice into tiles. Check the seams of tiles and walls: the generator rarely makes truly seamless edges, and corners and joins are often easier to finish by hand or procedurally.
3. **Show the result to the user.**
4. **Put into the project only what the user approved or asked for**, where the project keeps its assets. Keep drafts in a temporary folder.

## Spend the quota carefully

Every image uses the ChatGPT plan's usage limit, and image generation uses it much faster than text.

- Before a batch of more than three images, tell the user how many calls you plan.
- Do not regenerate in a loop. If a result is wrong, change the prompt for a specific reason.
- On exit code 2, stop and report when the limit resets.

## Limits

- **Never use an API key for this.** The script removes `OPENAI_API_KEY` from Codex's environment and refuses to run unless Codex is signed in with ChatGPT; Codex's own API fallback (`image_gen.py`) is billed separately.
- **Do not edit `~/.codex/config.toml`**: it is the user's own Codex setup. Every setting is passed as a flag for one call.
- **Codex gets no write access to the project.** It runs in a read-only sandbox in a temporary folder; the script copies the images itself.
Files in this package (4)
  • SKILL.md 6 KB
  • agents/openai.yaml 1 KB
  • references/prompting.md 3 KB
  • scripts/generate.py 7 KB

Versions

RepositoryScoreLicence
This page · lothlorienblade/agent-skills100MIT
mgiovani/cc-arsenal100MIT
nathanonn/agent-skills100MIT
hyperb1iss/hyperskills100MIT
htlin222/dotfiles100MIT
jevonhou/codex-imagegen-cc100MIT
cyl19970726/hhh-skills100MIT
giulioco/skills100Apache-2.0
alesha-pro/quorum100MIT

Database snapshot: 13.11.2026 · package version 829dafe85822 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100codex-image
    Generates or edits raster images (illustrations, concept art, UI mockups, sprites, icons, textures, photos, cutouts) with OpenAI Codex's built-in image generation, using the ChatGPT login Codex is signed into. Saves PNGs where the project needs them, runs batches in parallel,…
  • 100imagegen
    Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, UI mockups, product shots, or transparent-background cutouts. Use when the result should be an image asset rather than repo-native SVG, HTML/CSS, or canvas.
  • 84generate-image
    Generate images (icons, logos, banners, illustrations, mockups, photos, textures, diagrams-as-art) with OpenAI gpt-image-2 through the locally installed Codex CLI, using the user's existing ChatGPT login — no API key. Use whenever the user asks to generate, create, draw, or mock…
  • 100codex-image-gen
    Generates or edits raster images (illustrations, photos, icons, textures, mockups, posters, logo concepts, transparent cutouts, placeholder assets) by driving the codex CLI's built-in image tool, and saves them to a path. Use by default whenever an image is to be generated or an…
  • 100codex-image
    Generate or edit raster images (photos, illustrations, mockups, hero images, product shots, bitmap icons, transparent cutouts) with OpenAI GPT Image 2 by triggering the local Codex CLI, billed to the user's ChatGPT subscription — no API key needed. Use when the user says…
  • 100imagegen
    Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when the active client should create a new image, transform an existing image, or derive visual…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.