Media
Convierte un archivo de buffer de pixeles raw sin cabecera en una imagen PNG. Debes indicar dimensiones, cantidad de canales y profundidad de bits.
Llama a esta herramienta desde tu código en tres lenguajes.
# 1) Request a presigned URL → returns { uploadUrl, storageKey }
curl -X POST 'https://api.elysiatools.com/api/upload/presign/raw-to-png' \
-H 'Content-Type: application/json' \
-d '{"filename":"imageFile.ext","contentType":"application/octet-stream","size":12345}'
# 2) PUT the file bytes directly to the presigned uploadUrl
curl -X PUT '<presigned uploadUrl>' \
--data-binary @/path/to/file.ext
# 3) Call the tool, passing the returned storageKey for each file field
curl -X POST 'https://api.elysiatools.com/es/api/tools/raw-to-png' \
-F 'imageFile=uploads/2026/01/01/your-tool-1700000000000-abc123.ext' \
-F 'width=1920' \
-F 'height=1080' \
-F 'channels=3' \
-F 'bitDepth=8' \
-F 'compression=6'Envía una petición POST con tus entradas en JSON. Los parámetros de tipo archivo requieren una subida previa.
POST https://api.elysiatools.com/es/api/tools/raw-to-png| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| imageFile | filesubida requerida | Sí | — |
| width | text | Sí | — |
| height | text | Sí | — |
| channels | select | Sí | — |
| bitDepth | select | Sí | — |
| compression | select | No | — |
Resultado de archivo
{
"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)"
}Añade esta herramienta a tu servidor Model Context Protocol para que los agentes de IA puedan listarla y llamarla.
Añade este bloque a la configuración de tu cliente MCP:
{
"mcpServers": {
"elysiatools-raw-to-png": {
"name": "raw-to-png",
"description": "Convierte un archivo de buffer de pixeles raw sin cabecera en una imagen PNG. Debes indicar dimensiones, cantidad de canales y profundidad de bits.",
"baseUrl": "https://api.elysiatools.com/mcp/sse?toolId=raw-to-png",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}Tras conectar al endpoint SSE, lista las herramientas expuestas:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Invoca la herramienta por su id; los argumentos se construyen a partir de sus parámetros:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "raw-to-png",
"arguments": {
"imageFile": "https://example.com/file.ext",
"width": "1920",
"height": "1080",
"channels": "3",
"bitDepth": "8",
"compression": "6"
}
}
}¿Dudas o problemas? Contacta con [email protected]