Files
SnapOtter/apps/docs/zh-TW/tools/image/gif-webp.md
T
SnapOtterandGitHub 4963ab3bbd feat(docs-i18n): translate all documentation into 20 languages
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2026-07-11 13:52:47 +08:00

1.7 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
在動態 GIF 與 WebP 之間互相轉換,並保留所有影格。 20946e5001cb human 7fedb3b49b7b

GIF/WebP 轉換器

在動態 GIF 檔案與 WebP 之間互相轉換,保留所有影格與動畫時序。WebP 動畫通常比同等的 GIF 小 25-35%。

API 端點

POST /api/v1/tools/image/gif-webp

接受包含一個 GIF 或 WebP 檔案的 multipart 表單資料,以及一個 JSON settings 欄位。

參數

參數 型別 必填 預設值 說明
quality integer 80 WebP 編碼的輸出品質(1-100
lossless boolean false 使用無損 WebP 壓縮
resizePercent integer 100 依百分比縮放輸出(10-100

範例請求

curl -X POST http://localhost:1349/api/v1/tools/image/gif-webp \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@animation.gif" \
  -F 'settings={"quality": 85, "resizePercent": 50}'

範例回應

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/animation.webp",
  "originalSize": 3500000,
  "processedSize": 2200000
}

注意事項

  • 僅接受 .gif.webp 檔案。此工具不支援其他圖片格式。
  • 轉換方向會自動判定:GIF 輸入產生 WebP 輸出,WebP 輸入產生 GIF 輸出。
  • qualitylossless 選項僅在編碼為 WebP 時適用。轉換為 GIF 時,輸出會使用標準的 GIF 調色盤。
  • 使用 resizePercent 縮小大型動畫的尺寸(與檔案大小)。