codex - 💡(How to fix) Fix Codex image generation saves transparent-background requests as opaque RGB PNGs [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18905Fetched 2026-04-22 07:50:55
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Code Example

Create a complex t-shirt print design only, not a mockup.
The output must be a PNG with real transparency.
The area outside the artwork must be actual transparent alpha pixels, not white, black, gray, checkerboard, paper, fabric, or a simulated background.
No t-shirt, no model, no background, no frame, no poster, no canvas border.

---

sips -g pixelWidth -g pixelHeight -g hasAlpha -g space <generated-file>.png
file <generated-file>.png
xxd -l 29 <generated-file>.png

---

hasAlpha: no
space: RGB
PNG image data ... 8-bit/color RGB
PNG IHDR color type: 2
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.417.41555 (1858)

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.3.0 arm64 arm

What issue are you seeing?

Codex built-in image generation appears unable to emit or preserve real transparent PNG alpha for transparent-background asset requests.

I was testing the built-in image_gen tool for a standalone apparel-artwork workflow. The desired output was the design only, with no shirt/mockup/background, as a transparent PNG suitable for downstream upscaling and print preparation.

I tried multiple generation prompts that explicitly requested real PNG alpha transparency, then tried an edit/background-extraction pass using a transparent-looking apparel design as the edit target. In every case, Codex saved an opaque RGB PNG with no alpha channel.

The output can visually look like isolated artwork, but local inspection shows that the file itself is opaque RGB rather than transparent.

What steps can reproduce the bug?

Uploaded thread: 019db213-5186-75c1-b7b2-f1040a7b7fc5

Repro steps:

  1. In Codex, use the built-in image_gen tool with a prompt that asks for an isolated design asset with real PNG transparency. Example prompt language:
Create a complex t-shirt print design only, not a mockup.
The output must be a PNG with real transparency.
The area outside the artwork must be actual transparent alpha pixels, not white, black, gray, checkerboard, paper, fabric, or a simulated background.
No t-shirt, no model, no background, no frame, no poster, no canvas border.
  1. Generate the image and inspect the saved PNG.

  2. Repeat with a stricter prompt requiring a "real PNG alpha channel" and actual transparent pixels outside the artwork.

  3. Try an edit/background-extraction pass using a transparent-looking apparel design as the visible edit target, asking Codex to preserve the artwork and remove only the background into real alpha.

  4. Inspect the resulting PNGs with commands such as:

sips -g pixelWidth -g pixelHeight -g hasAlpha -g space <generated-file>.png
file <generated-file>.png
xxd -l 29 <generated-file>.png

Observed result:

hasAlpha: no
space: RGB
PNG image data ... 8-bit/color RGB
PNG IHDR color type: 2

PNG color type 2 is RGB. A true transparent PNG would normally be RGBA/color type 6, or otherwise include transparency data.

What is the expected behavior?

When a prompt requests a transparent-background PNG, Codex image generation should emit or preserve real alpha transparency in the saved PNG.

For this workflow, expected output would be a PNG with transparent pixels outside the generated artwork, such as RGBA/color type 6 or otherwise valid PNG transparency data.

If the current Codex image-generation integration does not support transparency, the app should either expose the equivalent background: transparent capability when available, or report that transparency is unsupported rather than returning an opaque RGB PNG that only appears visually isolated.

Additional information

The same general prompt produced a usable transparent-background image in ChatGPT.com, so this may be a Codex wrapper/output serialization limitation rather than a model capability limitation.

The Codex built-in image tool exposed only a prompt field in this session; there was no visible way to request or preserve transparent output through an explicit image-generation option.

This report intentionally omits local file paths, account names, product names, and other personal identifiers. Current Codex session logs are included via the uploaded thread link in the repro section.

extent analysis

TL;DR

The issue can be addressed by modifying the image generation prompt or exploring alternative image processing tools that support transparent PNG output.

Guidance

  • Verify that the Codex image generation tool supports transparent PNG output by checking the official documentation or release notes.
  • Experiment with different prompt variations that explicitly request transparent background, such as adding "background: transparent" or "RGBA" to the prompt.
  • Consider using external image editing software to add transparency to the generated images, as the issue may be related to the Codex wrapper or output serialization.
  • Check if future updates or versions of the Codex App address the transparency issue, as the problem may be resolved in a later release.

Example

No code snippet is provided, as the issue is related to the Codex App's image generation tool and its prompt-based interface.

Notes

The issue may be specific to the Codex App's implementation, as the same prompt produced a usable transparent-background image in ChatGPT.com. The lack of explicit image-generation options in the Codex tool may contribute to the problem.

Recommendation

Apply workaround: Use external image editing software to add transparency to the generated images, as this approach can provide a reliable solution until the Codex App's image generation tool is updated to support transparent PNG output.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING