mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Renames 18 ambiguous or hard-to-search tool names so image tools self-qualify like the other modalities ("Compress" becomes "Compress Image"), and cleans up a few awkward names. Propagated across search (constants.ts), display (en.ts + 20 locales), the OpenAPI base spec + 20 locale specs, and the docs tool-page headings in 21 languages. Removes the duplicate "Normalize Audio" summary shared by the video and audio endpoints. Tool ids and routes are unchanged, so no API paths or bookmarks break.
2.8 KiB
2.8 KiB
description, i18n_source_hash, i18n_provenance, i18n_output_hash
| description | i18n_source_hash | i18n_provenance | i18n_output_hash |
|---|---|---|---|
| 1枚の画像を行と列またはピクセルサイズでグリッドタイルに分割し、ZIPアーカイブとして返します。 | 838f5fa791b0 | human | ed25c8d33ed5 |
画像分割
1枚の画像を、列/行数または特定のピクセル寸法でグリッドタイルに分割します。すべてのタイルを含むZIPアーカイブを返します。
API Endpoint
POST /api/v1/tools/image/split
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| columns | integer | No | 3 | 分割する列数(1〜100) |
| rows | integer | No | 3 | 分割する行数(1〜100) |
| tileWidth | integer | No | - | タイルの幅(ピクセル、最小10)。tileWidthとtileHeightの両方が設定されている場合、columnsより優先されます。 |
| tileHeight | integer | No | - | タイルの高さ(ピクセル、最小10)。tileWidthとtileHeightの両方が設定されている場合、rowsより優先されます。 |
| outputFormat | string | No | "original" |
タイルの出力フォーマット: original, png, jpg, webp, avif, jxl |
| quality | number | No | 90 | 非可逆フォーマットの出力品質(1〜100) |
Example Request
curl -X POST http://localhost:1349/api/v1/tools/image/split \
-F "file=@large-image.png" \
-F 'settings={"columns":3,"rows":3,"outputFormat":"png"}' \
--output split-tiles.zip
Example Response
レスポンスはContent-Type: application/zipとともにZIPファイルとして直接ストリーミングされます。ファイル名はsplit-<jobId>.zipのパターンに従います。
ZIP内の各タイルは<originalBaseName>_r<row>_c<col>.<ext>という名前になります(例: photo_r1_c1.png, photo_r2_c3.webp)。
Notes
- 単一の画像ファイルを受け付けます。
- HEIC、RAW、PSD、SVGの入力フォーマットに対応します(自動的にデコードされます)。
tileWidthとtileHeightの両方が指定された場合、columns/rowsより優先されます。グリッド寸法はceil(imageWidth / tileWidth)およびceil(imageHeight / tileHeight)として計算されます。- 画像の寸法が均等に割り切れない場合、端のタイル(最右列、最下行)は指定したタイルサイズより小さくなることがあります。
- グリッドの最大サイズは100x100(10,000タイル)に制限されています。
- レスポンスはZIPを直接ストリーミングするため、JSONレスポンスボディはありません。curlでファイルを保存するには
--outputを使用してください。