Docs画像ツール

画像ツールAPI

画像の圧縮、リサイズ、変換、回転、トリミング、背景除去、アップスケール、顔ぼかし、透かしのエンドポイント。すべてのエンドポイントはmultipart/form-dataを受け付け、処理済み画像をバイナリファイルとして返します。

画像圧縮

POST/api/image-compress

視覚品質を維持しながら画像を圧縮してファイルサイズを削減します。JPEG、PNG、WebP形式に対応。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル(JPG、PNG、WebP)
qualitynumberOptional圧縮品質、10-100。デフォルト:80
targetSizeKBnumberOptional目標ファイルサイズ(KB単位)。設定するとqualityを上書きします。
keepMetadatastringOptionalEXIF メタデータを保持する場合は"true"に設定
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/image-compress \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "quality=75" \
  -o compressed.jpg

画像リサイズ

POST/api/image-resize

画像を特定のサイズまたはパーセンテージでリサイズします。ピクセル指定とパーセンテージスケーリングに対応。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
widthnumberOptional目標幅(ピクセル)
heightnumberOptional目標高さ(ピクセル)
percentagenumberOptionalスケール率(例:50で半分のサイズ)
fitstringOptional"inside"(アスペクト比を維持)または"fill"(正確なサイズに引き伸ばし)
Response:Binary file
bash
# Resize to specific width (height auto-calculated)
curl -X POST https://freefiletools.io/api/image-resize \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "width=800" \
  -o resized.jpg

# Resize by percentage
curl -X POST https://freefiletools.io/api/image-resize \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "percentage=50" \
  -o resized.jpg

画像変換

POST/api/image-convert

画像をフォーマット間で変換します。PNG、JPG、WebP、AVIFに対応。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
formatstringRequired出力フォーマット:"png"、"jpg"、"webp"、"avif"
qualitynumberOptional出力品質、10-100
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/image-convert \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "format=webp" \
  -F "quality=85" \
  -o photo.webp

画像回転

POST/api/image-rotate

画像の回転や反転を行います。任意の回転角度と水平/垂直反転に対応。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
anglenumberRequired回転角度(度単位、例:90、180、270)
flipHstringOptional水平反転する場合は"true"に設定
flipVstringOptional垂直反転する場合は"true"に設定
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/image-rotate \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "angle=90" \
  -o rotated.jpg

画像トリミング

POST/api/image-crop

画像を特定の矩形領域にトリミングします。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
xnumberRequiredトリミング矩形の左オフセット(ピクセル)
ynumberRequiredトリミング矩形の上オフセット(ピクセル)
widthnumberRequiredトリミング矩形の幅(ピクセル)
heightnumberRequiredトリミング矩形の高さ(ピクセル)
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/image-crop \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "x=100" \
  -F "y=50" \
  -F "width=500" \
  -F "height=400" \
  -o cropped.jpg

背景除去

POST/api/remove-bg

画像の背景を自動的に除去します。透過背景のPNGを返します。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
Response:透過背景のPNG画像
bash
curl -X POST https://freefiletools.io/api/remove-bg \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -o no-background.png

画像アップスケール

POST/api/image-upscale

AIを使用してディテールを維持しながら画像の解像度を向上させます。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
scalenumberOptionalアップスケール倍率:2または4。デフォルト:2
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/image-upscale \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "scale=4" \
  -o upscaled.jpg

顔ぼかし

POST/api/blur-face

プライバシー保護のため、画像内のすべての顔を自動検出してぼかします。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/blur-face \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -o blurred.jpg

画像に透かしを追加

POST/api/watermark-image

画像にテキストの透かしを追加します。テキストと位置をカスタマイズできます。

Parameters

NameTypeRequiredDescription
fileFileRequired画像ファイル
textstringRequired透かしテキスト
positionstringOptional位置:"center"、"top-left"、"top-right"、"bottom-left"、"bottom-right"
Response:Binary file
bash
curl -X POST https://freefiletools.io/api/watermark-image \
  -H "x-api-key: fft_your_api_key" \
  -F "[email protected]" \
  -F "text=Copyright 2024" \
  -F "position=bottom-right" \
  -o watermarked.jpg