
What GPT Image 2 transparent PNGs actually are
gpt-image-2 can emit PNG or WebP with a real alpha channel. Preview in the API. background="transparent". The prompt still wins: if you describe a scene, you may get a scene.
Hyuk · · 2 min read · AI · Updated
Transparent backgrounds are in preview for gpt-image-2 in the Image API. OpenAI’s cookbook and the image-generation guide say the same thing: set background="transparent" and write PNG or WebP. JPEG has no alpha.
This is not a ChatGPT-only toggle in those docs. It is an API parameter. You may need organization verification before GPT Image models run.
The point is reuse. Generate a cutout once. Drop it on a seasonal banner, a slide theme, a template, or a garment mockup. You do not run a separate background-removal step.
The call
from openai import OpenAI
import base64
client = OpenAI()
result = client.images.generate(
model="gpt-image-2",
prompt="One sculptural amber glass perfume bottle, isolated object, fully transparent alpha, no backdrop, no floor, no watermark.",
background="transparent",
size="1024x1536",
quality="high",
output_format="png",
)
image_bytes = base64.b64decode(result.data[0].b64_json)
with open("product.png", "wb") as f:
f.write(image_bytes)PNG is the default. WebP also keeps transparency. Omit output_compression for PNG. For edits, the prompting guide says to repeat “preserve the transparent background” so a later turn does not paint a scene back in.
A .png filename is not proof. The cookbook opens the file in Pillow and checks RGBA, then counts fully transparent pixels from the alpha histogram.
The prompt still wins
OpenAI is explicit: prompt instructions take priority over background="transparent". If you ask for a marble table and a sunset, you may get a table and a sunset.
Keep the subject isolated. Ask for actual alpha. Ban backdrop, scenery, floor, rectangle, plinth, checkerboard, and extra shadows. For charts, also keep the plot area, grid, and gaps between bars transparent. White cards and filled panels defeat the slide.
Four cookbook jobs
Seasonal product shots. Four home-fragrance bottles, one brand block, portrait 1024x1536, quality="high". Same PNGs over spring/summer/autumn/winter layouts. The interesting edges are glass, organza ribbon, rattan reeds, pampas wisps, and cotton cord. The cookbook’s claim is that baking alpha at generation time holds those edges better than a later cutout.
Enterprise slides. Bar and doughnut charts at 1536x1024 on a navy-teal PowerPoint gradient. Mock numbers are in the prompt. The model still returns raster art. Verify labels and proportions against the source. For reporting where the numbers must be exact, render the chart in code and use image generation for illustration.
Template stickers. App icon, die-cut character, botanical sprig at 1024x1024. Assets that sit on any canvas.
Print mockups. One circular outdoor graphic plus blank ivory tee and forest-green sweatshirt, all transparent. Pillow trims empty alpha, scales the art, and composites onto the chest. That is local compositing, not a Printify or Printful API in the notebook.
What it is not
It is preview. OpenAIDevs said more transparency work is coming. Do not treat it as a guaranteed pixel-perfect masker.
Do not convert RGBA to RGB on the way to disk. That drops the channel.
gpt-image-2 is the current default for new image work. The prompting guide still lists gpt-image-1.5 and gpt-image-1 for older flows. This transparency preview is documented for gpt-image-2.
Source cutoff: the transparent-assets cookbook, the GPT image prompting guide, and the Image generation API guide, as retrieved August 22, 2026.
Sources
Related
Comments
Comments are off until Giscus is configured.