Transparent AI image: PNG or WebP, not JPEG, on GPT Image 2.5
For a transparent AI image, request png or webp with background transparent on GPT Image 2.5. JPEG has no alpha. Code to request and verify the alpha channel.

For a transparent AI image on Sume, use GPT Image 2.5 with background: "transparent" and an output_format of png or webp. JPEG has no alpha channel, so it cannot hold transparency. The OpenAI guide makes the same point, and Sume only exposes background on the two GPT Image 2.5 variants.
Which format for which job
PNG is lossless and the safe choice for logos, stickers and anything you will edit again. WebP also supports alpha and gives smaller files for web pages. Use JPEG only for an opaque photo where file size matters more than edge quality. If a sticker will be edited and saved again, keep it as PNG, because each JPEG save adds loss.
Prompt for flat subjects with no cast shadow and no backdrop words. A soft shadow becomes semi-transparent pixels and looks like a gray halo on a dark page.
| Format | Alpha | Best for |
|---|---|---|
| png | Yes | Logos, stickers, edit chains |
| webp | Yes | Web pages, smaller files |
| jpeg | No | Opaque photos only |
| svg | No GPT 2.5 option | In the vocabulary but no v1 model advertises it |
Request and verify
Never assume the file is transparent. Download it and read the alpha channel.
import os, requests
H = {"Authorization": f"Bearer {os.environ['SUME_API_KEY']}"}
def generate(body):
r = requests.post("https://api.sume.com/v1/images", headers=H, json=body, timeout=60)
if r.status_code != 200: # 202 = still running, read data.status_url
raise SystemExit(f"{r.status_code}: {r.text[:300]}")
return r.json()["data"][0]["url"]
from io import BytesIO
from PIL import Image
url = generate({
"model": "openai/gpt-image-2.5",
"prompt": "A flat sticker of a smiling paper plane, no shadow",
"background": "transparent",
"output_format": "png",
"image_size": "1024x1024",
})
im = Image.open(BytesIO(requests.get(url, timeout=60).content))
alpha = im.convert("RGBA").getchannel("A").getextrema()
print(im.format, "alpha range", alpha)
print("transparent" if alpha[0] < 255 else "opaque")Price
GPT Image 2.5 is billed on tokens. The fal pages list $30 per million output image tokens, $8 per million image input tokens and $5 per million text input tokens. Sume bills the provider list price times 1.25. The table is output-only, so reference and prompt tokens add a little on top of it.
| Quality | Provider list | Sume at list x 1.25 |
|---|---|---|
| medium | $0.0132 | $0.0165 |
| high | $0.0527 | $0.0658 |
If the alpha is missing
These three checks cover the usual causes of an opaque file.
- Check that the format is
pngorwebp. - Remove scene words such as "on a table" from the prompt.
- Confirm the model is a GPT Image 2.5 variant, since other models answer
400 unsupported_parameterforbackground.
If the call returns 202
POST /v1/images waits up to 30 seconds and returns 200 with the images. A slow job falls back to a 202 job envelope, and you read the images from GET /v1/jobs/{id}/result. The code above exits on any non-200 so you notice, and a failed synchronous job returns 502 and is not billed.
Use on a page
On a web page, serve the WebP version to browsers and keep the PNG as the master. Test the image on a light and a dark section before launch. Check the edges at 200 percent zoom: a thin light fringe means the cut-out was drawn against a white scene, and a fresh generation with a flatter prompt usually fixes it.
Sources
Related posts
More in Developers
- Trim an AI-generated clip without a media import
Generated artifacts already live on media.sume.com, which is the host video-trim accepts. Use media-imports only for clips from outside Sume.
- Trim and caption a 30-second AI clip: two fixed prices, $0.22
Trim is $0.02 per job and captions are $0.20 per accepted job for videos up to 60 s, so a 30-second AI clip costs $0.22 after the render.
- Korean TTS segment text has no spaces, unless a digit is in it
Sume's TTS segment text joins tokens with spaces only if one has a Latin letter or digit; else with nothing. Use segments for timing, your script for text.
- TTS sentence slices: mp3 gives timings only, wav gives audio_urls
Sume TTS segmentation returns sentence timings for any container, but slice audio_urls only with wav or raw. Request shape, the 70 ms rule and when to pick wav.
Written by Sume