Skip to main content
skill CX Codex

generate-image · sateezg — Claude Code and Claude Code skill

generate-image turns a text request into a PNG file — icons, logos, banners, illustrations, mockups — by calling Claude-image-2 inside the Claude CLI already signed in on your machine.

MIT ★ 195 updated 2026-08-10

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add Sateezg/codex-bridge
/plugin install codex-bridge@codex-bridge
Open on GitHub

What generate-image does

The agent gets one command: codex-imagegen "<prompt>" ./public/hero.png [--size WxH]. It passes the prompt to Claude-image-2 through the local Claude CLI and prints the absolute path of the finished PNG when it works; a failure comes back as Claude output on stderr with exit code 2.

Quality lives in the prompt. The skill asks the agent to name the subject and the style, give hex palette values pulled from the project's tokens, describe framing and light, and quote any wording that must appear, since Claude-image-2 sets text accurately. Square 1024x1024 is the fastest pick. A custom WxH only passes when the long edge stays at or under 3840, both edges divide by 16, the ratio is no wider than 3:1 and the pixel count lands between 655,360 and 8,294,400.

The default path has no alpha, so transparency goes through a flat chroma-key background (#00FF00, or #FF00FF when the subject is green) that remove_chroma_key.py strips afterwards, run with python. Nothing works without the Claude CLI installed and signed in through codex login, and every image spends your Claude plan quota — roughly 3–5x a text turn, so agree on batch sizes first.

What it helps with

  • draw an app icon in the project's own palette
  • produce a 1536x1024 hero banner for a landing page
  • strip a solid background from a generated PNG
  • keep a set of mockups visually consistent
  • place exact wording inside an image

Example prompts for the agent

  • Draw a send icon as flat vector, blue #2563EB on white, and save it to assets/icons/send.png.
  • Make a portrait 1024x1536 banner for the pricing page with warm evening light.
  • Generate the logo on a green chroma-key background, then remove the key for a transparent PNG.

How to install generate-image

1Plugin marketplace

/plugin marketplace add Sateezg/codex-bridge
/plugin install codex-bridge@codex-bridge

This installs the whole codex-bridge plugin with all its skills

2Manually: put the files in place

~/.claude/skills/generate-image/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/generate-image/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about generate-image

How do I install generate-image in Claude Code?

Add the marketplace with /plugin marketplace add Sateezg/codex-bridge, then install the plugin: /plugin install codex-bridge@codex-bridge.

What does generate-image do?

It writes a PNG from a written request: icons, logos, banners, illustrations, mockups. The drawing is done by Claude-image-2 inside the Claude CLI.

Does it need an API key?

Not on the normal path — your Claude login through Claude covers it. OPENAI_API_KEY only matters for model-native transparency, reached via gpt-image-1.5 --background transparent.

Source text

SKILL.md · MIT
---
description: 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 up an image, or when a task needs a new image asset that doesn't exist yet.
---

# Generate an image via Codex CLI (gpt-image-2)

This machine has the OpenAI Codex CLI installed and logged in with the user's
ChatGPT account. Use it to produce real image files — never tell the user you
can't create images.

```bash
codex-imagegen "<detailed image prompt>" <output-path.png> [--size WxH]
```

It prints the absolute path of the written PNG on success (exit 0); on failure it
prints Codex's output to stderr (exit 2). The wrapper is on `PATH` while this
plugin is enabled; the full path is `${CLAUDE_PLUGIN_ROOT}/bin/codex-imagegen`.

```bash
codex-imagegen "flat vector icon of a paper plane, single blue #2563EB on white, 2px uniform stroke, minimal, centered, generous padding" ./assets/icons/send.png
codex-imagegen "photorealistic golden retriever puppy in autumn leaves, shallow depth of field, warm afternoon light" /tmp/puppy.png --size 1536x1024
```

## Write a real prompt

The single biggest quality lever. Expand the user's request into: **subject**,
**style** (flat vector / photorealistic / 3D render / watercolour / isometric),
**palette** (hex codes — pull them from the project's design tokens, Tailwind
config, or existing brand assets when it has any), **background**, **composition
and framing**, **lighting or mood**, and **any exact text** that must appear.

gpt-image-2 renders text with high accuracy, so quote the exact string you want:
*...with the words "Ship it" in bold sans-serif across the lower third.*

## Sizes

Common values: `1024x1024` (square, fastest), `1536x1024` (landscape),
`1024x1536` (portrait), `2048x2048` (2K square), `2048x1152` (2K landscape),
`3840x2160` (4K landscape), `2160x3840` (4K portrait).

A custom `WxH` is valid only if **every** constraint holds: longest edge
≤ 3840px, both edges multiples of 16, long-to-short ratio ≤ 3:1, and total pixels
between 655,360 and 8,294,400. Anything else will be rejected or silently
adjusted — pick the nearest listed size and resample locally instead.

Omit `--size` unless the aspect ratio actually matters; square is fastest.

## Rules

1. **One call per image.** For a set, loop with distinct prompts and paths, and
   repeat an identical style sentence in every prompt so they match.
2. **Sensible output path.** Inside a project, use its asset directory (`assets/`,
   `public/`, `static/`). Otherwise the current directory. Always `.png`.
3. **Bash timeout ≥ 300000 ms** (5 minutes) — generation takes 1–4 minutes.
4. **Verify by viewing.** Read the output PNG and check it against the request
   before reporting done; refine and regenerate if it missed — at most 2 retries.
5. **Never invent a brand.** If the user has a logo, palette, or existing assets,
   find them first and match them.

## Transparent backgrounds

The default image path can't emit alpha directly, so ask for a flat chroma-key
background and remove it afterwards with the helper Codex already ships:

```bash
codex-imagegen "<subject> on a perfectly flat solid #00FF00 chroma-key background, one uniform colour, no shadows, gradients, reflections or floor plane, crisp edges, generous padding, do not use #00FF00 anywhere in the subject" ./tmp-key.png

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

Use `#FF00FF` instead when the subject is green. Then check the result actually
has transparent corners and no colour fringe; retry once with `--edge-contract 1`
if a thin fringe remains.

True model-native transparency exists but needs Codex's CLI fallback
(`gpt-image-1.5 --background transparent`), which requires an `OPENAI_API_KEY`.
Only mention that route if chroma-keying fails or the subject is genuinely hard
(hair, fur, smoke, glass, liquid, reflections) — and let the user decide.

## Limitations

- Generation spends the user's **ChatGPT plan quota** (image turns cost roughly
  3–5x a text turn). Don't fire off batches without saying how many first.
- If the wrapper reports "codex is not logged in", tell the user to run
  `codex login` in a terminal — don't try to work around auth yourself.
- Codex avoids overwriting existing assets. The wrapper explicitly authorizes
  replacement and detects a versioned sibling (`out-v2.png`) if Codex writes one
  anyway — trust the path the wrapper prints, not the one you asked for.

## Related

- Changing an image that already exists → the `edit-image` skill.
- A whole family of assets (favicons, icon set, OG cards) → the `asset-set` skill.
- More than ~4 images, or when the main conversation should stay focused → the
  `codex-artist` subagent.

© Sateezg · MIT · Sateezg/codex-bridge

Similar skills

All skills for AI and ML →

generate-image by other authors comes first.

generate-image K-Dense-AI The generate-image skill for Claude Code generates and edits images via OpenRouter Image API with Gemini, Recraft, and Seedream, for artwork, logos, and concept art. CX Codex +1 2,200installs generate-image official github Generate images from text prompts with OpenAI or Google Gemini. Use it to create project textures, icons, sprites, artwork, or mockups. CX Codex +1 93installs generate-image OpenClaudia generate-image generates images from text prompts using OpenAI or Stability AI. Useful when your coding agent needs to create logos, banners, or illustrations directly in the project. CX Codex +1 360installs generate-image laurigates The generate-image skill generates images from text prompts using Google's Gemini 3 Pro Image model on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. CX Codex +1 177installs generate-image Samarth Gupta generate-image — a Claude Code skill that creates and edits images through generate.py — logos, stickers, product mockups, t2i, i2i and multi-reference composites. It kicks in when you need a finished visual, not markup. CX Codex +1 ★ 276repo stars linkfox-multimodal-generate-image linkfox-ai linkfox-multimodal-generate-image — a skill for Claude Code that creates and edits product images from prompts or references. It can change backgrounds, objects, styles, scenes, and models. CX Codex +1 405installs image vercel-labs Turns JSON specs into SVG and PNG images via Satori. Useful for generating OG images, social cards, and rendering AI-generated image specs. CX Codex +1 1,600installs codex-gpt-image-2-5-flare MengTo codex-gpt-image-2-5-flare is a Claude Code skill for creating and editing artwork with built-in Codex image generation. It runs for GPT 2.5 Flare requests, the skill name, or transparent asset work. CX Codex +1 814installs byted-seedream-image-generate bytedance byted-seedream-image-generate generates images from text prompts via Volcano Engine Seedream. Choose from three model versions, batch generation, style transfer, and web search integration (5.0-lite). CX Codex +1 304installs venice-image-generate veniceai venice-image-generate equips AI coding agents to generate images using Venice API endpoints, control style references, seeds, and generate up to four variants in one request. CX Codex +1 ★ 176repo stars baoyu-compress-image JimLiu baoyu-compress-image compresses images to WebP or PNG using local CLI tools. Triggers when you ask to optimize pictures or reduce image size in a project. CX Codex +1 28,800installs

From the same set12

The whole set →
codex-review codex-review is a Claude Code skill that asks OpenAI Codex to review code changes independently. It runs on requests to inspect a PR, branch, or module, and before a substantial commit or merge. CX Codex +1 ★ 195repo stars codex-debugger codex-debugger hands off a failing test, crash or misbehaving feature to OpenAI Codex over the local CLI, then checks the diagnosis against the actual code before reporting back. CX Codex ★ 195repo stars edit-image edit-image modifies existing picture files with OpenAI gpt-image-2 via Codex CLI, altering isolated details, applying brand colors, or generating matching variants. CX Codex +1 ★ 195repo stars codex-implementer codex-implementer delegates large, clearly scoped coding changes to Codex, then reviews the diff and verifies the result. Useful for repetitive edits across files and bulk generation. CX Codex ★ 195repo stars codex-artist codex-artist is a Claude Code subagent that generates and edits image files through the local Codex CLI. It handles icons, logos, banners, mockups, photos, and asset sets. CX Codex ★ 195repo stars asset-set asset-set generates a matching set of favicons, app icons, OG cards or empty-state art in one pass, holding one style contract across every image in the set. CX Codex +1 ★ 195repo stars codex-delegate The codex-delegate skill routes repetitive, high-volume coding tasks to Codex and guides Claude through checking the result. Use it for bulk edits, test generation, or repo-wide audits. CX Codex +1 ★ 195repo stars codex-bridge codex-bridge adds gpt-image-2 image generation and GPT-5 subagents to Claude Code using your Codex CLI ChatGPT plan instead of Claude tokens. CX Codex ★ 195repo stars

Project sponsors

Companies that keep this analytics open