Media
将WebP图像转换为优化的WebP格式,使用高级压缩设置
用三种语言从你的代码中调用此工具。
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/webp-to-optimized-webp' \
-F 'file=@/path/to/imageFile.ext'
# 2) Call the tool with the returned filePath values
curl -X POST 'https://api.elysiatools.com/zh/api/tools/webp-to-optimized-webp' \
-F 'imageFile=/path/to/file.ext' \
-F 'quality=85' \
-F 'effort=6' \
-F 'method=6' \
-F 'filterStrength=80' \
-F 'filterSharpness=2' \
-F 'filterType=1' \
-F 'smartSubsample=true' \
-F 'autoFilter=true' \
-F 'nearLossless=false'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/webp-to-optimized-webp| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| imageFile | file需先上传 | 是 | — |
| quality | range | 否 | Higher quality = larger file size. 90+ enables near-lossless |
| effort | range | 否 | Maximum effort for best compression ratio |
| method | range | 否 | Maximum method for best compression quality |
| filterStrength | range | 否 |
将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-webp-to-optimized-webp": {
"name": "webp-to-optimized-webp",
"description": "将WebP图像转换为优化的WebP格式,使用高级压缩设置",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=webp-to-optimized-webp",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}连接到 SSE 端点后,列出已开放的工具:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}通过工具 id 调用,参数由其参数表构建:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "webp-to-optimized-webp",
"arguments": {
"imageFile": "https://example.com/file.ext",
"quality": 85,
"effort": 6,
"method": 6,
"filterStrength": 80,
"filterSharpness": 2,
"filterType": 1,
"smartSubsample": true,
"autoFilter": true,
"nearLossless": false
}
}
}| Strength of the deblocking filter |
| filterSharpness | range | 否 | Filter sharpness for preserving edges |
| filterType | number | 否 | 0: simple, 1: strong, 2: cross |
| smartSubsample | checkbox | 否 | Optimize chroma channel processing |
| autoFilter | checkbox | 否 | Let the encoder choose optimal filter settings |
| nearLossless | checkbox | 否 | Very high quality with minimal compression |
文件结果
{
"filePath": "/public/processing/randomid.ext",
"fileName": "output.ext",
"contentType": "application/octet-stream",
"size": 1024,
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}有问题或反馈?请联系 [email protected]