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).