Files
SnapOtter/apps/docs/ja/tools/image/transparency-fixer.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

3.4 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
偽の透過PNGをAIマッティング(BiRefNet)で修正して本物のアルファを生成し、エッジのフリンジ除去も行います。 7eb748b80f93 human 88c95b97a32d

PNG Transparency Fixer

偽の透過PNGをワンクリックで修正します。AIマッティング(BiRefNet HR Mattingモデル)を用いて本物のアルファ透過を生成し、後処理のフリンジ除去でエッジをクリーンアップします。

API Endpoint

POST /api/v1/tools/image/transparency-fixer

処理: 非同期(202を返し、/api/v1/jobs/{jobId}/progressをSSEでポーリングしてステータスを取得)

モデルバンドル: background-removal4〜5 GB

Parameters

Parameter Type Required Default Description
file file Yes - 画像ファイル(multipart
defringe number No 30 フリンジ除去の強度(0〜100)。エッジ周辺の半透明なフリンジピクセルを除去します
outputFormat string No "png" 出力フォーマット: pngまたはwebp
removeWatermark boolean No false ウォーターマーク除去の前処理(メディアンフィルター)を適用します

Example Request

curl -X POST http://localhost:1349/api/v1/tools/image/transparency-fixer \
  -F "file=@fake-transparent.png" \
  -F 'settings={"defringe":40,"outputFormat":"png"}'

Response

Initial Response (202 Accepted)

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

Progress (SSE at /api/v1/jobs/{jobId}/progress)

event: progress
data: {"phase":"processing","stage":"Processing transparency...","percent":50}

Final Result (via SSE)

{
  "phase": "complete",
  "percent": 100,
  "result": {
    "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "downloadUrl": "/api/v1/download/{jobId}/fake-transparent_fixed.png",
    "originalSize": 180000,
    "processedSize": 150000,
    "filename": "fake-transparent.png"
  }
}

Notes

  • background-removalモデルバンドルのインストールが必要です(4〜5 GB)。
  • 高品質なアルファマッティングの主モデルとしてbirefnet-hr-mattingを使用します。HRモデルがメモリ不足になった場合はbirefnet-generalにフォールバックします。
  • defringeオプションは、AIマッティングが髪、毛、細かなエッジの周囲にときどき残す半透明のフリンジピクセルを除去します。アルファチャンネルをぼかし、信頼度の低いピクセルをゼロにすることで機能します。
  • removeWatermarkオプションは、メディアンフィルターの前処理ステップを適用します。これは基本的なウォーターマーク低減であり、専用のウォーターマーク除去ツールではありません。
  • 出力はPNGまたは可逆WebPのみです(どちらもアルファ透過をサポートします)。
  • HEIC/HEIF、RAW、TGA、PSD、EXR、HDRの入力フォーマットに、自動デコードで対応します。