Files
SnapOtter/apps/docs/zh-TW/tools/image/red-eye-removal.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.4 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
AI 驅動的偵測與更正,處理相機閃光燈造成的紅眼。 647c6ff1ef7c human a2e5e426a371

紅眼移除

AI 驅動的偵測與更正,處理相機閃光燈造成的紅眼。

API 端點

POST /api/v1/tools/image/red-eye-removal

處理方式: 非同步(傳回 202,透過 SSE 輪詢 /api/v1/jobs/{jobId}/progress 以取得狀態)

模型套件包: face-detection200-300 MB

參數

參數 類型 必填 預設值 說明
file file - 圖片檔案(multipart
sensitivity number 50 紅眼偵測靈敏度(0-100)。數值越高越能偵測到較細微的紅眼
strength number 70 更正強度(0-100)。中和紅色的積極程度
format string - 輸出格式(選用覆寫值)
quality number 90 輸出品質(1-100

範例請求

curl -X POST http://localhost:1349/api/v1/tools/image/red-eye-removal \
  -F "file=@flash-photo.jpg" \
  -F 'settings={"sensitivity":60,"strength":80}'

回應

初始回應(202 Accepted

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "async": true
}

進度(SSE 於 /api/v1/jobs/{jobId}/progress

event: progress
data: {"phase":"processing","stage":"Detecting red eyes...","percent":40}

最終結果(透過 SSE

{
  "phase": "complete",
  "percent": 100,
  "result": {
    "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "downloadUrl": "/api/v1/download/{jobId}/flash-photo_redeye_fixed.png",
    "originalSize": 280000,
    "processedSize": 290000,
    "facesDetected": 2,
    "eyesCorrected": 4
  }
}

注意事項

  • 需要安裝 face-detection 模型套件包(200-300 MB)。
  • 會先偵測臉部,接著在每張臉部中定位眼睛區域,最後辨識並更正紅眼像素。
  • facesDetected 計數表示找到多少張臉;eyesCorrected 是完成紅眼更正的個別眼睛總數。
  • 輸出一律為 PNG,以達到最佳品質保留。
  • 透過自動解碼支援 HEIC/HEIF、RAW、TGA、PSD、EXR 與 HDR 輸入格式。