Bundled imagegen CLI rejects gpt-image-2 transparent backgrounds despite documented preview support
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What issue are you seeing?
The bundled imagegen fallback CLI rejects gpt-image-2 with background=transparent before sending an API request, even in --dry-run mode. Current official documentation describes transparent backgrounds as available in preview for this model.
This report concerns skills/src/assets/samples/imagegen/scripts/image_gen.py, rather than the built-in Codex image-generation tool.
Reproduced from repository commit d6489472f3c15e87d2d7763a5fde033545c530f8 (official main when checked on September 8, 2026). The installed system-skill script and repository script have identical SHA-256 hashes.
What steps can reproduce the bug?
From the repository root, run:
python3 codex-rs/skills/src/assets/samples/imagegen/scripts/image_gen.py generate \
--model gpt-image-2 \
--prompt "An isolated red cube on an actual transparent background" \
--background transparent \
--output-format png \
--dry-run
Actual result: exit code 1, with:
Error: transparent backgrounds are not supported in gpt-image-2, the latest model. Use --model gpt-image-1.5 --background transparent --output-format png instead.
Additional local dry-run checks:
| Request | Exit code |
|---|---|
gpt-image-2, transparent PNG |
1 |
gpt-image-2, transparent WebP |
1 |
generate-batch, default image-2 model, per-job transparent PNG |
1 |
gpt-image-2, background auto, PNG |
0 |
gpt-image-1.5, transparent PNG |
0 |
These were local validation checks only. No image-generation API request was made, and successful transparent generation or account eligibility has not been verified.
What is the expected behavior?
Allow the documented gpt-image-2 transparent PNG/WebP request through local validation, while retaining output-format validation (for example, rejecting transparent JPEG). The API can report any applicable preview-access restriction.
If the restriction is intentionally still required for this CLI, clarify its scope and rationale so the CLI guidance can be reconciled with the public API documentation.
Additional information
Official sources:
- Image generation guide: Customize image output documents transparent backgrounds in preview for
gpt-image-2, using PNG or WebP. - August 20 Cookbook: Generate Transparent Image Assets for Campaigns and Presentations demonstrates
client.images.generate(model="gpt-image-2", background="transparent", output_format="png", ...).
The rejection is in _validate_model_specific_options, which is called before request execution. The bundled SKILL.md and the cli.md, image-api.md, prompting.md, and sample-prompts.md references also retain unsupported-transparency/model-fallback guidance.
PR #37788 switched the built-in imagegen skill workflow to native transparency while retaining the CLI fallback restriction. Related issue #40572 concerns exposing controls in the built-in tool; this report is specifically about the separate fallback CLI rejecting the documented API option locally.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in skills/src/assets/samples/imagegen/scripts/image_gen.py at _validate_model_specific_options, then reproduce the provided gpt-image-2 transparent PNG command with --dry-run. Check the bundled SKILL.md and cli.md, image-api.md, prompting.md, and sample-prompts.md guidance. Done means transparent PNG and WebP requests pass local validation, transparent JPEG remains rejected, and the guidance matches the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100