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/ru/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'Отправьте POST-запрос с входными данными в JSON. Параметры типа «файл» требуют предварительной загрузки.
POST https://api.elysiatools.com/ru/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 | Нет | 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)"
}Добавьте этот инструмент на свой сервер Model Context Protocol, чтобы ИИ-агенты могли перечислять и вызывать его.
Добавьте этот блок в конфигурацию вашего 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-endpoint выведите список доступных инструментов:
{
"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
}
}
}Вопросы или проблемы? Свяжитесь с [email protected]