> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2.6 官轉：輸出格式和背景引數有哪些互斥條件？

> 適用於 GPT Image 2.6 官轉的 gpt-image-2.6-sunburst / gpt-image-2.6-flare：只有 transparent + jpeg 會 400，gif 支援 1-bit 透明，svg 用 opaque 才寫白底。

> [!NOTE]
>
> 本文適用於 **GPT Image 2.6 官轉** 的兩款模型：`gpt-image-2.6-sunburst`（精細視覺）和 `gpt-image-2.6-flare`（快速迭代）。2.5 / 2 沒有 gif / svg 輸出，規則不要直接套用。

## 簡短回答

只有一組硬互斥：`background: "transparent"` 不能配 `output_format: "jpeg"`，會直接返回 400。其餘組合都能通過，但透明能力不同：

| `background` | `png` | `jpeg` | `webp` | `gif` | `svg` |
| - | - | - | - | - | - |
| `transparent` | ✅ 完整 alpha | ❌ 400 | ✅ 完整 alpha | ✅ 1-bit 透明 | ✅ 不寫背景 |
| `opaque` | ✅ 實底 | ✅ 實底 | ✅ 實底 | ✅ 實底 | ✅ 白底矩形 |
| `auto` | ✅ | ✅ | ✅ | ✅ | ✅ |

以上為 2026-11-12 在 GPT Image 2.6 官轉上實測（`quality: "low"`、`n: 1`；GIF 用 512×512 / 2 幀；SVG 用 `svg.model: "gpt-4.1-mini"`）。完整矩陣以 `gpt-image-2.6-sunburst` 為主；`jpeg + transparent`、`gif + transparent`、`svg + opaque` 三組在 `gpt-image-2.6-flare` 上覆測結果一致。

## JPEG 是唯一的 400

JPEG 沒有 alpha 通道，`background: "transparent"` 會直接報：

```text theme={null}
Transparent background is not supported for JPEG output format
```

文生圖 `/v1/images/generations` 和圖片編輯 `/v1/images/edits` 都一樣。改成 `png` / `webp`（要動畫就 `gif`）即可；`opaque` 和 `auto` 在 JPEG 下正常。

> [!WARNING]
>
> 編輯介面這條 400 實測要 62 秒才返回（文生圖約 19 秒），不要因為等得久就重複提交。

## GIF 能透明，但只有 1-bit alpha

`output_format: "gif"` + `background: "transparent"` 在 2.6 上可用，文生圖和編輯介面都通過。實測透明畫素佔比 46%–60%，`opaque` 對照組為 0%。

但 GIF 的透明是調色盤透明，只有“全透明 / 不透明”兩種狀態，沒有半透明羽化；邊緣要求高時用 `png` / `webp`。這條只適用於支援 GIF 輸出的 2.6，2.5 及以前沒有 GIF 輸出。

## SVG 沒有 alpha，`opaque` 才寫背景

SVG 是向量格式，本身沒有 alpha 通道，透明是預設狀態：

* `transparent`：不寫背景矩形。
* `opaque`：寫入一張全畫布白色矩形，例如 `<rect width="1024" height="1024" fill="#fff" />`。
* `auto`：實測兩次都沒寫背景，不能當 `opaque` 用；要白底請顯式傳 `opaque`。

> [!NOTE]
>
> `output_format: "svg"` 只支援文生圖介面，`n` 必須為 1，並且必須帶 `svg.model`；背景矩形的最終寫法由編寫模型落筆，換 `svg.model` 後需以實際檔案為準。

## `auto` 不是固定 `opaque`

`background` 不傳時預設 `auto`。`auto` 會跟著提示詞語義走，而不是固定輸出實底：

* 提示詞寫“純白背景”時，`png` / `jpeg` / `gif` 回顯 `opaque`，實際無 alpha。
* 提示詞寫“主體、無背景”時，`png` / `webp` / `gif` / `svg` 回顯 `transparent`，前三種實際帶透明畫素。
* `jpeg` 下 `auto` 會被強制成 `opaque`，不報錯。

所以生產環境想要確定性，顯式傳 `transparent` 或 `opaque`；不要用 `auto` 去賭結果。

## 順帶兩個格式約束

* `output_compression` 只對 `jpeg` / `webp` 生效。
* `frame_count` / `frame_duration_ms` 只用於 `gif`，不要傳給 PNG、JPEG、WebP 或 SVG。

## 相關文件

> [card] [GPT Image 2.6 新能力](https://docs.apiyi.com/zh-Hant/api-capabilities/gpt-image-2/gpt-image-2-6.md)
>
> SVG、GIF、`complexity` 與標記引導編輯的完整說明。

> [card] [怎麼生成透明背景的圖片](https://docs.apiyi.com/zh-Hant/faq/image-transparent-background.md)
>
> 透明背景的引數寫法、提示詞要求和常見報錯。

> [card] [文生圖 API 參考](https://docs.apiyi.com/zh-Hant/api-capabilities/gpt-image-2/text-to-image.md)
>
> `/v1/images/generations` 的完整欄位。

> [card] [圖片編輯 API 參考](https://docs.apiyi.com/zh-Hant/api-capabilities/gpt-image-2/image-edit.md)
>
> `/v1/images/edits` 與多圖編輯。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.