Images

Resize, convert or compress an image

Resizes (with a fit mode), converts between JPEG/PNG/WebP/AVIF and/or compresses ONE image. Provide at least one of width, height, format or quality. Input formats: PNG, JPEG, WebP, AVIF, GIF, TIFF.

Costs 1 credit per call.

post/images

Request

  • Base URL: https://api.cofferdock.com
  • URL: https://api.cofferdock.com/images
  • Auth: API key in header x-api-key

Request body

filestring byte required

The image, base64-encoded.

widthinteger

Target width in pixels (1-8000). If you leave height empty, the aspect ratio is kept.

heightinteger

Target height in pixels (1-8000). If you leave width empty, the aspect ratio is kept.

fit'cover' | 'contain' | 'fill' | 'inside' | 'outside'

How to fit when both width and height are given.

position'center' | 'top' | 'right top' | 'right' | 'right bottom' | 'bottom' | 'left bottom' | 'left' | 'left top' | 'entropy' | 'attention'

Only affects fit=cover or fit=contain: which part of the image to keep. Use it to crop to a ratio without taking the center, e.g. fit=cover + position=top.

format'jpeg' | 'png' | 'webp' | 'avif'

Output format (default: same as input).

qualityinteger

Compression quality from 1 to 100 for lossy formats (JPEG, WebP): higher = better image and bigger file.

output'json' | 'binary' | 'url' | 'image'

How to return the image: "json" (base64 in the JSON response), "binary" (the image itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, binary when the input was sent raw.

Response

The resulting image (shape depends on output).

OR

Changes

No recorded changes to this operation across all 1 revision of this API.