Media
使用高质量插值算法和锐化增强技术放大图片
用三种语言从你的代码中调用此工具。
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/image-quality-upscaler' \
-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/image-quality-upscaler' \
-F 'imageFile=/path/to/file.ext' \
-F 'scale=2' \
-F 'targetWidth=0' \
-F 'targetHeight=0' \
-F 'maintainAspectRatio=true' \
-F 'interpolation=lanczos3' \
-F 'sharpenAmount=1.5' \
-F 'enhanceColors=true' \
-F 'outputFormat=jpeg' \
-F 'quality=92'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/image-quality-upscaler| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| imageFile | file需先上传 | 是 | 支持 JPG、PNG、WebP、BMP、TIFF 等常见图片格式 |
| scale | select | 否 | 选择放大倍数(2x为推荐值,可保持较好的质量和细节) |
| targetWidth | number | 否 | 设置后优先使用此宽度而非倍数 |
| targetHeight | number | 否 | 设置后优先使用此高度而非倍数 |
| maintainAspectRatio | checkbox | 否 | 保持原始图像的宽高比 |
将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-image-quality-upscaler": {
"name": "image-quality-upscaler",
"description": "使用高质量插值算法和锐化增强技术放大图片",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=image-quality-upscaler",
"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": "image-quality-upscaler",
"arguments": {
"imageFile": "https://example.com/file.ext",
"scale": "2",
"targetWidth": 0,
"targetHeight": 0,
"maintainAspectRatio": true,
"interpolation": "lanczos3",
"sharpenAmount": 1.5,
"enhanceColors": true,
"outputFormat": "jpeg",
"quality": 92
}
}
}| interpolation | select | 否 | Lanczos3提供最佳质量,Nearest速度最快 |
| sharpenAmount | range | 否 | 增强图像细节,值越大锐化效果越明显 |
| enhanceColors | checkbox | 否 | 轻微增强色彩饱和度和亮度 |
| outputFormat | select | 否 | JPEG适合照片,PNG适合需要透明背景的图像 |
| quality | range | 否 | 输出图像的质量(1-100),仅对JPEG和WebP有效 |
文件结果
{
"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]