This page was machine-translated. Spotted a mistake?Help improve it.
Skip to content

Image Watermark

ロゴや別の画像を、ベース画像上にウォーターマークとして重ねます。ウォーターマークはベース画像の幅に対して相対的にスケールされ、角または中央に配置されます。

API Endpoint

POST /api/v1/tools/image/watermark-image

2枚の画像ファイルとJSON形式のsettingsフィールドを含むmultipartフォームデータを受け付けます。

Parameters

ParameterTypeRequiredDefaultDescription
positionstringNo"bottom-right"ウォーターマークの配置: center, top-left, top-right, bottom-left, bottom-right
opacitynumberNo50ウォーターマークの不透明度の割合(0〜100)
scalenumberNo25メイン画像の幅に対するウォーターマークの幅の割合(1〜100)

File Fields

Field NameRequiredDescription
fileYesメイン/ベース画像
watermarkYesウォーターマーク/ロゴ画像

Example Request

bash
curl -X POST http://localhost:1349/api/v1/tools/image/watermark-image \
  -H "Authorization: Bearer si_your-api-key" \
  -F "[email protected]" \
  -F "[email protected]" \
  -F 'settings={"position": "bottom-right", "opacity": 60, "scale": 20}'

Example Response

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

Notes

  • 両方の画像が検証・デコードされます(HEIC、RAW、PSD、SVGに対応)。
  • ウォーターマークは、その幅がメイン画像の幅のscale%になるよう、比例的にリサイズされます。
  • 不透明度は、dest-inブレンディングで合成されたアルファマスクを介して適用されます。
  • 角の位置では、画像の縁から20pxの余白が設けられます。
  • ウォーターマーク画像が透過を持つ場合(例: PNGロゴ)、合成時に透過は保持されます。
  • 処理前に、両方の画像でEXIF方向が自動適用されます。