imagegen
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 Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established ic
Security Assessment
About imagegen
The 'imagegen' skill enables AI-driven generation and editing of raster images, providing a solution for tasks that require bitmap visuals rather than vector or code-native assets. It is designed for scenarios where creating new images, transforming existing ones, or producing visual variants is essential, such as mockups, illustrations, product shots, or textures. By leveraging this skill, users can efficiently generate high-quality bitmap assets without relying on manual graphic design tools, which streamlines workflows and accelerates visual content creation.
This skill offers two top-level operational modes: the preferred built-in tool mode using the 'image_gen' tool and a fallback CLI mode via 'scripts/image_gen.py'. The built-in tool covers typical image generation and editing needs without requiring API keys, while the CLI mode provides explicit subcommands for generating, editing, or batch processing images, but requires an 'OPENAI_API_KEY'. The skill enforces a clear save-path policy, ensuring that generated images are appropriately stored in project-referenced locations or rendered inline for previews, with versioned filenames to prevent accidental overwrites. Shared prompt guidance and additional resources support consistent and effective image generation.
Typical use cases include creating concept art, website hero images, product photography, or stylistically guided visuals, as well as editing existing images to modify lighting, remove objects, or adjust backgrounds. The skill is especially valuable for designers, developers, and content creators who need rapid, high-quality raster assets. It is not intended for vector or code-native editing tasks, small local asset adjustments, or extending established icon or logo libraries. Overall, 'imagegen' helps professionals generate visual content efficiently, supporting both creative ideation and project-specific asset creation.
FAQ
Can I use 'imagegen' to generate vector graphics or SVGs?
No, 'imagegen' is designed for raster/bitmap image creation and editing. Tasks better handled with SVGs, HTML/CSS, or code-native graphics should use appropriate vector or code-based tools.
Do I need an API key to use the built-in 'image_gen' tool?
No, the built-in tool does not require 'OPENAI_API_KEY'. API keys are only required for the explicit CLI fallback mode.
What should I do if the built-in tool fails or is unavailable?
Inform the user that a CLI fallback exists and requires 'OPENAI_API_KEY'. Only proceed with CLI mode if the user explicitly requests it.
Where are generated images saved by default?
In built-in mode, images are saved under '$CODEX_HOME/*' by default. For project-related assets, they should be moved or copied into the workspace or a user-specified location.
Can 'imagegen' handle batch image generation?
Yes, the CLI mode supports a 'generate-batch' subcommand for producing multiple assets or variants, but this requires explicit CLI usage and an API key.
Install imagegen
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
openai/skills