vips-image-system · 开放 API
接口
GET /templates — 模板列表(含参数说明)
GET /assets — assets/ 素材图片列表(API 从这里选图)
GET|POST /generate — 生成图片
generate 参数
template=模板名 (或传 layers=JSON 使用动态图层模式 + size=[w,h])
其余参数 = 模板 params 中声明的参数:图片路径、文字、颜色等
format = png|jpg|webp (默认 png)
json = 1 (返回 JSON:文件路径/宽高;图片同时保存到 output/generated/)
download = 1 (附加下载头)
示例
curl "http://localhost:8080/generate?template=card&title=新品发布&avatar=avatars/me.png" -o card.png
curl "http://localhost:8080/generate?template=card&title=大促&json=1"
curl -X POST http://localhost:8080/generate -H "Content-Type: application/json" -d '{"template":"poster","title":"夜读"}'