图片拼接
image_concatCombine multiple images into a single image using horizontal, vertical, or grid layouts. Set spacing, background color, and optional output path to create a composite PNG.
Instructions
将多张图片拼接为一张。
支持三种布局:
horizontal: 横向拼接(左右排列)
vertical: 纵向拼接(上下排列)
grid: 网格拼接(按行列排列,需指定cols)
参数:
images: 图片路径或URL列表
layout: 拼接布局(horizontal/vertical/grid)
cols: grid布局的列数(仅grid布局有效)
gap: 图片间距(像素,默认0)
background: 背景色(默认#FFFFFF)
output_path: 可选,保存到文件路径
返回:拼接后的图片(base64 PNG)和元信息
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gap | No | 图片间距(像素) | |
| cols | No | grid布局的列数 | |
| images | Yes | 图片路径或URL列表(http/https开头为URL,否则为本地路径)。至少1张,最多8张。 | |
| layout | Yes | 拼接布局 | |
| background | No | 背景色 | #FFFFFF |
| output_path | No | 可选:输出图片保存的文件路径。无论是否设置,图片都会以base64返回。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| format | Yes | ||
| height | Yes | ||
| size_bytes | Yes |