Design
从任何图片中提取精美的调色板,非常适合设计师从照片中寻找色彩灵感
用三种语言从你的代码中调用此工具。
# 1) Upload each file first → returns { filePath }
curl -X POST 'https://api.elysiatools.com/upload/image-color-palette' \
-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-color-palette' \
-F 'imageFile=/path/to/file.ext' \
-F 'colorCount=6' \
-F 'algorithm=kmeans' \
-F 'sortMode=percentage' \
-F 'sampleSize=10000' \
-F 'ignoreWhite=true' \
-F 'ignoreBlack=true'以 JSON 形式 POST 提交输入参数。文件类型参数需先单独上传。
POST https://api.elysiatools.com/zh/api/tools/image-color-palette| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| imageFile | file需先上传 | 是 | 上传图片以提取其调色板 |
| colorCount | number | 否 | 调色板中的颜色数量(3-15) |
| algorithm | select | 否 | 用于颜色提取的算法 |
| sortMode | select | 否 | 如何排序调色板中的颜色 |
| sampleSize | number | 否 | 从图片中采样的像素数量 |
将此工具加入你的 Model Context Protocol 服务,让 AI 智能体可以列出并调用它。
将以下内容加入你的 MCP 客户端配置:
{
"mcpServers": {
"elysiatools-image-color-palette": {
"name": "image-color-palette",
"description": "从任何图片中提取精美的调色板,非常适合设计师从照片中寻找色彩灵感",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=image-color-palette",
"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-color-palette",
"arguments": {
"imageFile": "https://example.com/file.ext",
"colorCount": 6,
"algorithm": "kmeans",
"sortMode": "percentage",
"sampleSize": 10000,
"ignoreWhite": true,
"ignoreBlack": true
}
}
}| ignoreWhite |
| checkbox |
| 否 |
| 排除白色和近似白色 |
| ignoreBlack | checkbox | 否 | 排除黑色和近似黑色 |
JSON 结果
{
"key": {...},
"metadata": {
"key": "value"
},
"error": "Error message (optional)",
"message": "Notification message (optional)"
}有问题或反馈?请联系 [email protected]