画像ツールAPI
画像の圧縮、リサイズ、変換、回転、トリミング、背景除去、アップスケール、顔ぼかし、透かしのエンドポイント。すべてのエンドポイントはmultipart/form-dataを受け付け、処理済み画像をバイナリファイルとして返します。
画像圧縮
POST
/api/image-compress視覚品質を維持しながら画像を圧縮してファイルサイズを削減します。JPEG、PNG、WebP形式に対応。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル(JPG、PNG、WebP) |
quality | number | Optional | 圧縮品質、10-100。デフォルト:80 |
targetSizeKB | number | Optional | 目標ファイルサイズ(KB単位)。設定するとqualityを上書きします。 |
keepMetadata | string | Optional | EXIF メタデータを保持する場合は"true"に設定 |
Response:
Binary filebash
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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
width | number | Optional | 目標幅(ピクセル) |
height | number | Optional | 目標高さ(ピクセル) |
percentage | number | Optional | スケール率(例:50で半分のサイズ) |
fit | string | Optional | "inside"(アスペクト比を維持)または"fill"(正確なサイズに引き伸ばし) |
Response:
Binary filebash
# 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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
format | string | Required | 出力フォーマット:"png"、"jpg"、"webp"、"avif" |
quality | number | Optional | 出力品質、10-100 |
Response:
Binary filebash
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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
angle | number | Required | 回転角度(度単位、例:90、180、270) |
flipH | string | Optional | 水平反転する場合は"true"に設定 |
flipV | string | Optional | 垂直反転する場合は"true"に設定 |
Response:
Binary filebash
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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
x | number | Required | トリミング矩形の左オフセット(ピクセル) |
y | number | Required | トリミング矩形の上オフセット(ピクセル) |
width | number | Required | トリミング矩形の幅(ピクセル) |
height | number | Required | トリミング矩形の高さ(ピクセル) |
Response:
Binary filebash
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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
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-upscaleAIを使用してディテールを維持しながら画像の解像度を向上させます。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
scale | number | Optional | アップスケール倍率:2または4。デフォルト:2 |
Response:
Binary filebash
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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
Response:
Binary filebash
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
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 画像ファイル |
text | string | Required | 透かしテキスト |
position | string | Optional | 位置:"center"、"top-left"、"top-right"、"bottom-left"、"bottom-right" |
Response:
Binary filebash
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