GET
图片处理
图片拼接
把多张图片横向或纵向拼成一张。
累计调用 15
今日调用 0
更新于 2026-10-16
调用地址
GET
https://itapi.top/api/imgmerge
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| urls | string | 必填 | 图片链接,英文逗号分隔 | https://itapi.top/og.png |
| mode | string | 可选 | h 横排 / v 竖排 | 暂无 |
| gap | int | 可选 | 间距像素 | 风景 |
| bg | string | 可选 | 背景色 | #ffffff |
| img | string | 可选 | 传 1 直接输出图片二进制(不套 JSON) | 1 |
| raw | string | 可选 | img 的别名,传 1 效果相同 | 1 |
返回字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码 |
| data.image | string | data URI(可直接放 img src) |
| data.format | string | 图片格式 |
| data.count | int | 拼接张数 |
| data.width | int | 总宽 |
| data.height | int | 总高 |
响应示例
200 OK
{"code":200,"msg":"success","data":{"count":2,"mode":"h","width":1600,"height":600,"image":"data:image/png;base64,iVBOR...","format":"png"}}
在线测试
代码示例
cURL · GET
curl "https://itapi.top/api/imgmerge?urls=https%3A%2F%2Fitapi.top%2Fog.png&mode=%E6%9A%82%E6%97%A0&gap=%E9%A3%8E%E6%99%AF&bg=%23ffffff&img=1&raw=1"
PHP
<?php
$res = file_get_contents("https://itapi.top/api/imgmerge?urls=https%3A%2F%2Fitapi.top%2Fog.png&mode=%E6%9A%82%E6%97%A0&gap=%E9%A3%8E%E6%99%AF&bg=%23ffffff&img=1&raw=1");
$json = json_decode($res, true);
print_r($json);
JavaScript
const res = await fetch("https://itapi.top/api/imgmerge?urls=https%3A%2F%2Fitapi.top%2Fog.png&mode=%E6%9A%82%E6%97%A0&gap=%E9%A3%8E%E6%99%AF&bg=%23ffffff&img=1&raw=1");
const json = await res.json();
console.log(json);
Python
import requests
r = requests.get("https://itapi.top/api/imgmerge?urls=https%3A%2F%2Fitapi.top%2Fog.png&mode=%E6%9A%82%E6%97%A0&gap=%E9%A3%8E%E6%99%AF&bg=%23ffffff&img=1&raw=1", timeout=10)
print(r.json())