OpenAI has added transparent-background output to GPT-Image-2. This removes a post-processing step for assets that need to sit on different backgrounds.

OpenAI Developers announced that the feature is available in preview for GPT-Image-2 in the OpenAI API.

"Transparent backgrounds are now available in preview for GPT-Image-2 in the API. Generate reusable assets you can place on any background—for product imagery, graphic design, website mockups, and marketing campaigns."
— OpenAI Developers (@OpenAIDevs)

What it replaces

Without native transparency, a common workflow is to generate an isolated subject and remove the background afterward.

The old route was to request a flat background, derive a mask with a segmentation tool, and clean up the edges. Fine hair, glass, reflections, and shadows are where that cleanup tends to show.

Native alpha output puts object boundaries and transparency into the generated image rather than deriving them from a separate mask. The practical test is whether it preserves antialiased edges and translucent details well enough to skip cleanup.

API usage

Pass background="transparent" and request PNG or WebP, both of which can preserve transparency. JPEG does not support an alpha channel. This example requests PNG and decodes the returned b64_json bytes:

# Python OpenAI SDK Example
import base64
from openai import OpenAI

client = OpenAI()

response = client.images.generate(
    model="gpt-image-2",
    prompt="A sleek obsidian robotic hexagon emblem with glowing cyan circuit traces, clean vector style",
    background="transparent",  # Native alpha channel
    output_format="png",         # PNG preserves transparency
    size="1024x1024"
)

image_bytes = base64.b64decode(response.data[0].b64_json)
with open("transparent-asset.png", "wb") as image_file:
    image_file.write(image_bytes)

Where transparent output helps

The clearest cases are compositing an isolated product image and placing an icon or illustration across different page backgrounds. The generated file still needs visual review, especially around hair, glass, shadows, and other partly transparent edges.

The limitation it removes

Native alpha output does one specific job: it makes generated assets easier to compose with an existing layout. It does not guarantee a usable asset, but it removes the mandatory background-removal stage when the generated transparency is clean.

References