Should AI images be PNG, JPEG or WebP?
Choose PNG, JPEG or WebP for AI-generated images by transparency, file size, editing workflow and the formats TokenRex exposes for each image model.
Choose by destination
- Choose PNG for transparent assets, logos and files that will be edited again.
- Choose WebP for website images when the destination supports it and you want a compact file; it can also preserve transparency.
- Choose JPEG for opaque photos where a smaller file matters and transparency is not needed.
- Keep an original PNG when an asset will pass through several design or editing steps.
TokenRex image model formats
- GPT Image 2.5 Flare and Sunburst expose PNG, JPEG and WebP; transparent output requires PNG or WebP.
- GPT Image 2 and GPT Image 1 Mini expose PNG, JPEG and WebP but not the transparent background control.
- Gemini image models do not accept OpenAI output_format controls through TokenRex. Their available formats are listed on each model page.
Avoid format mistakes
- Do not convert a transparent image to JPEG; the transparent area will be filled with a solid colour.
- Do not compress your only master file aggressively. Export a separate delivery copy for the website.
- Measure the result in the place it will appear, especially for text, sharp product edges and brand colours.
Sources
Example
curl https://tokenrex.ai/api/public/v1/images/generations \
-H "Authorization: Bearer $TOKENREX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-image-2.5-flare","prompt":"Simple blue app icon","background":"transparent","output_format":"webp"}'Questions
- Is WebP always better than PNG?
- No. WebP is often compact for websites, while PNG remains a common choice for editing and compatibility.
- Why does TokenRex reject transparent JPEG?
- JPEG cannot store transparent pixels, so the request would not produce the requested result.