imagegen

Generate website visual assets via Codex CLI's built-in image generation tool.

197|85|Updated Jul 5, 2026
One-click install
npx skills add https://github.com/yan-labs/yan-skills --skill imagegen-yan-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: imagegen
Source: https://github.com/yan-labs/yan-skills/tree/main/imagegen
Command: npx skills add https://github.com/yan-labs/yan-skills --skill imagegen-yan-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Websites need real visual assets—logos, mascots, og:images, in-page illustrations, user-scene photos—but manually prompting an image model, verifying output quality, compressing files, and placing them in the right project directories is repetitive and error-prone. This Skill turns a visual asset request into a complete pipeline: prompt writing, generation via Codex's built-in image_gen tool, three-stage acceptance checks, compression, and correct file placement, enforcing the no-placeholder-image rule. ## Core Features & Use Cases - Prompt Engineering Templates: Ready-made templates for seven asset types (logo/favicon source, mascot, og:image, in-page illustration, photorealistic user-scene, hand-drawn/watercolor illustration, cinematic poster) with required elements like hex palettes, exact dimensions, and "No text, no watermarks" constraints. - Three-Stage Acceptance: Contact-sheet thumbnail review at 120px, alpha bounding-box occupancy measurement (target 75-80%), and independent blind evaluation to catch composition, sizing, and style defects. - Compression & Placement: sips/cwebp/ImageMagick commands to convert multi-MB PNGs into web-ready JPEG/WebP, with per-asset-type directory conventions (public/brand/, public/og/, public/images/). - Use Case: A rankup site build needs a transparent mascot logo and a 1200x630 og:image. This Skill writes the prompt file, runs codex exec in the background, verifies true alpha transparency, fixes the 62% occupancy via ImageMagick trim/resize, and delivers compressed files to the correct public directories. ## Quick Start Ask the agent to generate a transparent 1024x1024 mascot logo and a 1200x630 og:image for your site using the imagegen skill, specifying your brand colors as hex values.

Frequently Asked Questions about imagegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate images with Codex CLI?

Image generation is not a CLI subcommand; it is Codex agent's built-in image_gen tool. Write a prompt file describing each image with exact filenames, dimensions, and style constraints, then run codex exec with --sandbox danger-full-access so the agent can call the tool over the network.

How do I generate a transparent PNG logo with AI image generation?

Specify "true alpha, not a white/dark square" in the prompt so the model self-checks transparency. If the result still has a baked background, use ImageMagick with -fuzz and -transparent to remove the solid color, then verify alpha_min equals 0.

What size should an og:image be for social sharing?

Use 1200x630 pixels (1.91:1 ratio), opaque, one unique image per page. Keep the subject on one side with clean negative space for title overlays, and verify it remains recognizable when scaled down to 120px thumbnails.

Why does my AI-generated image have text errors or watermarks?

Image models almost always garble rendered text, especially non-English characters. Add "No text, no letters, no logos, no watermarks" to every prompt and overlay text afterward with HTML/CSS instead of asking the model to draw it.

Can I run codex exec image generation in a background subagent?

No. Running codex exec with run_in_background inside a subagent causes the harness to mark the parked subagent idle and terminate it, so the completion notification never arrives. Always launch background generation from the main thread, or wait synchronously in the foreground.

How do I compress generated PNG images for web use?

Convert opaque images with sips to JPEG quality 82 or cwebp to WebP quality 82, typically reducing 757 KB to under 100 KB. Keep already-quantized flat transparent PNGs as-is since WebP conversion can make them larger.