网格切图
网格切图 是有文档说明的 APIAny 免费 API 工具:先在浏览器试用,再用 API 密钥调用同一操作。
把一张图片平均切成网格,并以 ZIP 下载全部切片。
POST /api/free/grid-cut-image来源
本页引用了哪些官方资料?
以下引文来自 APIAny 对照实现的官方 API 文档。
The Fetch API provides an interface for fetching resources (including across the network).
The typical use case for this high speed Node.js module is to convert large images in common formats to smaller, web-friendly JPEG, PNG, WebP and AVIF images of varying dimensions.
The Images API provides several endpoints that let you generate images from text prompts or create edits of existing images.
在线网格切图
上传、设置、预览与下载都不需要 API Key。
1. 上传与设置
无需 API Key 即可在线处理;只有点击运行后,文件才会发送到本站。
2. 预览与下载
包含预览、文件大小变化和下载按钮
通过 API 接入
仅程序调用需要 API Key;参数、响应和错误信息集中展示。
POST /api/free/grid-cut-image在线使用免 Key;程序调用此接口时需要 APIAny Key。
- 可生成 4 到 25 张等分切片。
- 剩余像素会包含在最后一行和最后一列中。
响应结果
请求成功后返回 zip 类型响应,Content-Type 与本页说明一致。
常见错误
- 400
- 缺少文件或参数、值无效,或者超出页面标注的限制。
- 401
- 程序调用缺少 API Key,或 Key 无效、已停用。
- 429
- 在线或鉴权调用已达到共享限速。
参数与限制
| 参数 | 要求 | 默认值 | 可用值 |
|---|---|---|---|
image图片文件 | 必填 | — | file |
rows行数 | 选填 | 3 | 2, 3, 4, 5 |
columns列数 | 选填 | 3 | 2, 3, 4, 5 |
format切片格式 | 选填 | webp | webp, png, jpeg |
API 调用示例
下面是用于程序代码的鉴权示例;上方在线 Playground 不会要求或暴露你的 API Key。
curl -X POST "https://apiany.ai/api/free/grid-cut-image" \ -H "Authorization: Bearer $API_KEY" \ -F "image=@input.jpg" \ -F "rows=3" \ -F "columns=3" \ --output tiles.zip
常见问题
使用 网格切图 需要 API Key 吗?
在线 Playground 无需 Key;程序请求请通过 Authorization: Bearer 或 X-API-Key 发送 APIAny Key。
网格切图 有哪些使用限制?
在线工具每分钟最多 3 次、每天 30 次;鉴权免费账户为 5 RPM,付费账户为 500 RPM,并在全部免费 API 间共享。
网格切图 支持哪些输入?
请按参数表提供必填与选填字段;不支持的格式和超出范围的值会被拒绝。
网格切图 返回什么?
成功请求返回 zip 响应;失败时使用上方列出的 HTTP 状态码。