Redimensionar, convertir y comprimir imágenes
Imágenes es una API que redimensiona, cambia el formato y comprime una imagen. Perfecta para preparar fotos y capturas para web, email o redes sociales desde n8n, Make o Zapier, sin montar servidores.
Cómo funciona
Le mandas una imagen (JPEG, PNG, WebP, AVIF, GIF o TIFF). Le dices qué quieres cambiar: tamaño (width/height), formato de salida (format) y/o compresión (quality). Te devuelve la imagen procesada. Tiene que venir al menos uno de esos cuatro campos. Si no le dices nada que cambiar, la petición falla en vez de gastarte un crédito por no hacer nada.
Dos límites a tener en cuenta: de un GIF animado solo se procesa el primer fotograma (esta herramienta trabaja con una imagen, no con animaciones), y las fotos en formato HEIC (el que usa el iPhone por defecto) no están soportadas todavía. Conviértelas a JPEG antes de enviarlas.
Lo único que necesitas
- Tu API key. La creas en tu panel con "+ Crear llave". Se muestra una sola vez, así que cópiala y guárdala.
- En tu plataforma de automatización, un paso de tipo "HTTP Request" / "Hacer una petición HTTP" (lo tienen n8n, Make, Zapier, Pipedream…).
Redimensionar una imagen
Le envías tu imagen tal cual (como archivo binario) y el tamaño que quieres como Query Parameters. En el nodo HTTP Request:
- Method:
POST - URL:
https://api.cofferdock.com/images - Send Headers: actívalo y añade dos:
x-api-key= tu llave, yContent-Type= el tipo de tu imagen (por ejemploimage/jpeg) - Send Body: actívalo → elige la opción para mandar un archivo binario (en n8n: "n8n Binary File")
- Query Parameters:
width=800(por ejemplo)
En Options → Response → Response Format elige File para recibir la imagen procesada directamente.
Cambiar el formato o comprimir
Añade format (jpeg, png, webp o avif) y/o quality (1 a 100) como Query Parameters, igual que width/height. Por ejemplo format=webp&quality=70 para convertir a WebP comprimido.
En Make: mismo método y URL, los parámetros en Query String, las cabeceras y la imagen como dato binario en el cuerpo.
Parámetros disponibles
| Parámetro | Para qué sirve |
|---|---|
width | Ancho en píxeles del resultado. |
height | Alto en píxeles del resultado. |
fit | Cómo encajar la imagen si das ancho y alto a la vez. Por defecto nunca recorta ni deforma. |
format | Formato de salida: jpeg, png, webp o avif. Si no lo dices, mantiene el formato original. |
quality | Calidad/compresión, de 1 a 100. Cuanto más bajo, más pequeño el archivo y más pérdida. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/images - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: la imagen va en el cuerpo como binario (
image/png,image/jpeg,image/webp,image/avif,image/gif,image/tiffoapplication/octet-stream) o comoapplication/jsoncon{ "file": "<base64>", ... }. - Parámetros:
width,height,fit,format,quality(Query Parameters o campos JSON). Al menos uno es obligatorio. - Salida: por defecto, con imagen binaria de entrada devuelve el binario; con JSON de entrada devuelve base64 en
image.output=image/output=binaryuoutput=jsonfuerza cualquiera de las dos. - Límites: imagen de entrada hasta 20 MB (50 MB en Business/Scale) en modo binario, o ~4 MB reales en JSON con base64. 30 peticiones/min. 1 llamada = 1 crédito.
Parámetros
| Campo | Tipo | Notas |
|---|---|---|
width, height | entero | 1 a 8000. Si solo das uno, el otro se ajusta manteniendo la proporción. |
fit | cover/contain/fill/inside/outside | Por defecto inside (nunca recorta ni deforma). Solo importa si das width y height a la vez. |
format | jpeg/png/webp/avif (jpg también vale) | Si no lo das, mantiene el formato de entrada (o pasa a png si ese formato no se puede escribir, p.ej. gif/tiff). |
quality | entero 1-100 | jpeg/webp/avif: calidad de compresión (por defecto 80, 80 y 50 respectivamente). png: sin este campo es sin pérdida; con él, paleta de color reducida (más pequeño, algo de pérdida). |
file | string base64 | Solo en modo JSON. |
output | image/binary/json | Por defecto según el modo de entrada. |
Ejemplos
curl (redimensionar y convertir a WebP):
curl -X POST "https://api.cofferdock.com/images?width=800&format=webp&quality=75" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: image/jpeg" \
--data-binary @foto.jpg \
-o miniatura.webp
JavaScript (Node 18+):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/images?width=800&format=webp&quality=75', {
method: 'POST',
headers: { 'x-api-key': 'TU_LLAVE', 'Content-Type': 'image/jpeg' },
body: fs.readFileSync('foto.jpg'),
});
fs.writeFileSync('miniatura.webp', Buffer.from(await r.arrayBuffer()));
Python (modo JSON con base64):
import base64, requests
img_b64 = base64.b64encode(open('foto.jpg', 'rb').read()).decode()
r = requests.post(
'https://api.cofferdock.com/images',
headers={'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json'},
json={'file': img_b64, 'width': 800, 'format': 'webp', 'quality': 75},
)
data = r.json()
open('miniatura.webp', 'wb').write(base64.b64decode(data['image']))
Forma de la respuesta
{ "success": true, "image": "iVBORw0KGgo…", "mime_type": "image/webp",
"meta": { "format": "webp", "width": 800, "height": 533,
"original_format": "jpeg", "original_width": 4032, "original_height": 3024,
"size_bytes": 54211, "used": 14, "remaining": 486, "unlimited": false } }
Error de validación:
{ "error": "Unknown format \"bmp\". Use one of: jpeg, png, webp, avif (jpg also accepted as an alias for jpeg)" }
Lo que recibes
La imagen procesada directamente (o en base64 con output=json).
Resize, convert and compress images
Images is an API that resizes, changes the format and compresses an image. Great for prepping photos and screenshots for web, email or social media from n8n, Make or Zapier, with no servers to maintain.
How it works
You send an image (JPEG, PNG, WebP, AVIF, GIF or TIFF). You tell it what to change: size (width/height), output format (format) and/or compression (quality). It returns the processed image. At least one of those four fields is required. If there's nothing to change, the request fails instead of spending a credit for doing nothing.
Two limits worth knowing: of an animated GIF only the first frame is processed (this tool works with one image, not animations), and HEIC photos (the iPhone's default format) aren't supported yet. Convert them to JPEG before sending.
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
Resize an image
You send your image as is (as binary data) and the size you want as Query Parameters. In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/images - Send Headers: on → add two:
x-api-key= your key, andContent-Type= your image's type (e.g.image/jpeg) - Send Body: on → choose the binary file option (in n8n: "n8n Binary File")
- Query Parameters:
width=800(for example)
Under Options → Response → Response Format choose File to get the processed image directly.
Change the format or compress
Add format (jpeg, png, webp or avif) and/or quality (1 to 100) as Query Parameters, same as width/height. For example format=webp&quality=70 to convert to compressed WebP.
In Make: same method and URL, the parameters in Query String, the headers, and the image as binary data in the body.
Available parameters
| Parameter | What it does |
|---|---|
width | Result width in pixels. |
height | Result height in pixels. |
fit | How to fit the image when you give both width and height. Defaults to never cropping or distorting. |
format | Output format: jpeg, png, webp or avif. If you don't set it, the original format is kept. |
quality | Quality/compression, 1 to 100. The lower, the smaller the file and the more loss. |
API overview
- Endpoint:
POST https://api.cofferdock.com/images - Auth: header
x-api-key: YOUR_KEY. - Input: the image goes in the body as binary (
image/png,image/jpeg,image/webp,image/avif,image/gif,image/tifforapplication/octet-stream) or asapplication/jsonwith{ "file": "<base64>", ... }. - Parameters:
width,height,fit,format,quality(Query Parameters or JSON fields). At least one is required. - Output: by default, binary input returns binary; JSON input returns base64 in
image.output=image/output=binaryoroutput=jsonforces either. - Limits: input image up to 20 MB (50 MB on Business/Scale) in binary mode, or ~4 MB real in JSON with base64. 30 requests/min. 1 call = 1 credit.
Parameters
| Field | Type | Notes |
|---|---|---|
width, height | integer | 1 to 8000. If you give only one, the other adjusts keeping the aspect ratio. |
fit | cover/contain/fill/inside/outside | Defaults to inside (never crops or distorts). Only matters when you give both width and height. |
format | jpeg/png/webp/avif (jpg also works) | If you don't set it, the input format is kept (or falls back to png if that format can't be written, e.g. gif/tiff). |
quality | integer 1-100 | jpeg/webp/avif: compression quality (defaults to 80, 80 and 50 respectively). png: without this field it's lossless; with it, a reduced color palette (smaller, some loss). |
file | base64 string | JSON mode only. |
output | image/binary/json | Defaults based on the input mode. |
Examples
curl (resize and convert to WebP):
curl -X POST "https://api.cofferdock.com/images?width=800&format=webp&quality=75" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: image/jpeg" \
--data-binary @photo.jpg \
-o thumbnail.webp
JavaScript (Node 18+):
const fs = require('fs');
const r = await fetch('https://api.cofferdock.com/images?width=800&format=webp&quality=75', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'image/jpeg' },
body: fs.readFileSync('photo.jpg'),
});
fs.writeFileSync('thumbnail.webp', Buffer.from(await r.arrayBuffer()));
Python (JSON/base64 mode):
import base64, requests
img_b64 = base64.b64encode(open('photo.jpg', 'rb').read()).decode()
r = requests.post(
'https://api.cofferdock.com/images',
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json'},
json={'file': img_b64, 'width': 800, 'format': 'webp', 'quality': 75},
)
data = r.json()
open('thumbnail.webp', 'wb').write(base64.b64decode(data['image']))
Response shape
{ "success": true, "image": "iVBORw0KGgo…", "mime_type": "image/webp",
"meta": { "format": "webp", "width": 800, "height": 533,
"original_format": "jpeg", "original_width": 4032, "original_height": 3024,
"size_bytes": 54211, "used": 14, "remaining": 486, "unlimited": false } }
Validation error:
{ "error": "Unknown format \"bmp\". Use one of: jpeg, png, webp, avif (jpg also accepted as an alias for jpeg)" }
What you get back
The processed image directly (or as base64 with output=json).