Files
SnapOtter/apps/docs/zh-TW/tools/image/vignette.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

2.1 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
加入暈影效果,並可調整強度、顏色與位置。 0b9795fea2eb human d4a363bf211f

暈影

加入暈影效果,使影像邊緣變暗或著色。支援可調整的強度、顏色、半徑、柔和度、圓潤度與中心位置。

API 端點

POST /api/v1/tools/image/vignette

接受包含影像檔案與 JSON settings 欄位的 multipart 表單資料。

參數

參數 型別 必填 預設值 說明
strength number 0.5 暈影不透明度(0.1-1
color string "#000000" 暈影十六進位顏色
radius integer 70 外半徑,以半對角線的百分比表示(0-100)
softness integer 50 羽化柔和度(0-100);值越高產生越漸進的淡化
roundness integer 100 形狀:100 = 圓形,0 = 符合影像長寬比的橢圓
centerX integer 50 水平中心位置,以百分比表示(0-100)
centerY integer 50 垂直中心位置,以百分比表示(0-100)

範例請求

curl -X POST http://localhost:1349/api/v1/tools/image/vignette \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@photo.jpg" \
  -F 'settings={"strength": 0.7, "radius": 60, "softness": 70}'

範例回應

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/photo.jpg",
  "originalSize": 2450000,
  "processedSize": 2410000
}

注意事項

  • 較小的 radius 會讓影像更大範圍變暗;較大的半徑則將暈影限制在最外圍的邊緣。
  • 使用非黑色的 color(例如白色或褐色調)可製作創意暈影效果。
  • 調整 centerXcenterY 可讓清晰區域偏離中心,適用於將焦點引導至不在畫面中央的主體。
  • 輸出格式與輸入格式相同。HEIC、RAW、PSD 與 SVG 輸入會在處理前自動解碼。